relocation R_X86_64_32 against `a local symbol' can not be used when making a shared
hi,
I tried to install apache 1.3.37 with module_ssl and openssl in a AMD 64 bit server, when I make the apache, I got following error:
gcc -L/usr/local/src/openssl-0.9.8e -shared -o libssl.so mod_ssl.lo ssl_engine_config.lo ssl_engine_compat.lo ssl_engine_ds.lo ssl_engine_dh.lo ssl_engine_init.lo ssl_engine_kernel.lo ssl_engine_rand.lo ssl_engine_io.lo ssl_engine_log.lo ssl_engine_mutex.lo ssl_engine_pphrase.lo ssl_engine_vars.lo ssl_engine_ext.lo ssl_scache.lo ssl_scache_dbm.lo ssl_scache_shmht.lo ssl_scache_shmcb.lo ssl_expr.lo ssl_expr_scan.lo ssl_expr_parse.lo ssl_expr_eval.lo ssl_util.lo ssl_util_ssl.lo ssl_util_sdbm.lo ssl_util_table.lo -lssl -lcrypto -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -lgcc
/usr/bin/ld: /usr/local/src/openssl-0.9.8e/libssl.a(s2_srvr.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/src/openssl-0.9.8e/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [libssl.so] Error 1
make[3]: *** [all] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/usr/local/src/apache_1.3.37/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/local/src/apache_1.3.37'
make: *** [build] Error 2
I search google,found:
This means that the file libssl.a(s2_srvr.o) was not compiled with the -fPIC flag, which it should. When you fix this kind of error, make sure only objects that are used in shared libraries are compiled with -fPIC.
In this case, globally adding -fPIC to C[XX]FLAGS resolves the issue,but how to do that with "make" command ? is anyone know?
thanks!
|