LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-11-2007, 04:13 PM   #1
jimmyjiang
Member
 
Registered: Jun 2006
Posts: 132

Rep: Reputation: 15
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!
 
Old 07-11-2007, 04:32 PM   #2
GregLee
Member
 
Registered: Feb 2004
Location: Waimanalo, HI
Distribution: Slackware 10, Fedora 6
Posts: 308

Rep: Reputation: 30
"make" does what it's told in the Makefile of the relevant directory. So edit Makefile. Look for a line begining "CFLAGS =" and add to it "-fPIC".
 
Old 07-11-2007, 05:19 PM   #3
jimmyjiang
Member
 
Registered: Jun 2006
Posts: 132

Original Poster
Rep: Reputation: 15
I only found one, and modified it, still same :
EXTRA_CFLAGS=-fPIC \
 
Old 07-12-2007, 11:12 PM   #4
jimmyjiang
Member
 
Registered: Jun 2006
Posts: 132

Original Poster
Rep: Reputation: 15
I figured it out. I reconfigure openssl0.9.8e:
./config -fPIC
and it works!
if still not work, try openssl 0.9.7m.
thanks for all help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
relocation error in libgdk-1.2.so.0. Undefined symbol: g_source_add big_manel Linux - Software 1 02-13-2006 08:06 PM
Making static symbols private/local in shared libraries skoona Programming 1 02-18-2005 03:14 PM
bluefish: relocation error: bluefish: undefined symbol: gtk_file_chooser_di pymehta Linux - Software 3 02-05-2005 11:00 PM
Relocation error for symbol but it is being exported nukkel Programming 0 12-04-2004 03:23 AM
dcgui-qt: relocation error: /usr/lib/libqt-mt.so.3: undefined symbol: glXGetConfig akqw Linux - Software 0 10-05-2003 10:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration