Bug 51581 - APR wrapper compilation error
Summary: APR wrapper compilation error
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 7.0.19
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-29 03:33 UTC by zhangyu1898
Modified: 2011-08-01 04:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhangyu1898 2011-07-29 03:33:54 UTC
CFLAGS='-m64' ./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/ssl --with-java-home=/usr/local/jdk

/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_meth.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libtcnative-1.la] error 1
make: *** [all-recursive] error 1

use
CFLAGS='-m64 -fPIC' ./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/ssl --with-java-home=/usr/local/jdk

still give me same error
Comment 1 Rainer Jung 2011-07-29 08:59:34 UTC
The compiler complains about your OpenSSL build and suggests tu use other flags for that. Please check your OpenSSL.

There are usually two ways to fx this:

- either provide shared libraries for OpenSSL. Check OpenSSL-Docs how to do this.

- or if you want to build against statically linked OpenSSL (the complicated way), you might try with "-fPIC" added when compiling OpenSSL, but I don't think it'll help

- I expect you can work around the problem by linking against OpenSSL with -Bdirect (or -Wl,-Bdirect depending on where you set the flag).

It's a known problem with OpenSSl which pops up every now and then in variations:

http://rt.openssl.org/Ticket/Display.html?id=1226
http://rt.openssl.org/Ticket/Display.html?id=1521
http://rt.openssl.org/Ticket/Display.html?id=2466
etc.
Comment 2 zhangyu1898 2011-08-01 04:05:37 UTC
solution: compile openssl with shared option.

all problem solved.