Operating System - HP-UX
1753521 Members
5047 Online
108795 Solutions
New Discussion юеВ

compile problem Apache1.3.23 with mod_ssl with gcc

 
SOLVED
Go to solution
HPP
Regular Advisor

compile problem Apache1.3.23 with mod_ssl with gcc

Hi,
I am trying to compile Apache_1.3.23 and mod_ssl with gcc. I am getting error while linking (ld). The error as follows:
library must be position independent. Use +z or +Z to recompile.
I did try with -fPIC flag with gcc, but no luck. If i try +z option with gcc, it gives error as "no such file of directory".

Any help!!!

Thanks
Be Teachable
5 REPLIES 5
harry d brown jr
Honored Contributor
Solution

Re: compile problem Apache1.3.23 with mod_ssl with gcc

Are you using gnu's make, ld, and as?

live free or die
harry
Live Free or Die
Hartmut Lang
Trusted Contributor

Re: compile problem Apache1.3.23 with mod_ssl with gcc

Using "gcc -shared -fpic ..." works for me without any problem.

What does "gcc -v ..." say?

Hardy
HPP
Regular Advisor

Re: compile problem Apache1.3.23 with mod_ssl with gcc

harry and harmut,
thanks for the reply.
I am using gmake, but non GNU ld. where can i get GNU ld? what is the package name at hpux.cs.utah.edu that contains GNU ld?
I even tried using "-fpic -shared", but no luck. If i give -shared option for gcc, it gives "excecute permission denied" while configure and make for some script and exits. I am running as root.

Any inputs gratly appreciated. thanks
Be Teachable
HPP
Regular Advisor

Re: compile problem Apache1.3.23 with mod_ssl with gcc

I even tried with HP-UX ANSIC C compiler and it gives the same error as :
library must be position independent. Use +z or +Z to recompile.
I did give CC="cc +Z" and CC="cc +z".

The ouput of gcc -v :
gcc -v
Reading specs from /opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/specs
Configured with: ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure : (reconfigured) ./configure
Thread model: single
gcc version 3.0.1

Be Teachable
Hartmut Lang
Trusted Contributor

Re: compile problem Apache1.3.23 with mod_ssl with gcc

Where do you have the problem: compiling the Apache code or compiling the mod_ssl code?
Do you want to generate 32- or 64-bit code?

I don't think you should use GNUs ld, HP ld will be fine, but you have to use GNU as.

The error with the "+z or +Z" comes from HPs ld. It says that the compiled code (the objects) do not contain position independant code. "+z or +Z" are the options for HPs cc to create position independant objects. If you use gcc you have to set options "-fpic" instead. "-fpic" is one of the "Options for Code Generation Conventions" you find in the gcc manual (http://gcc.gnu.org/onlinedocs/).
If you call the linker through gcc you have to set the "-shared" option, which is one of the "Options for linking" in the gcc manual.

This is my experience with gcc 2.95.3.


Hardy