binarycrusader / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

libproxy doesn't build with LDFLAGS="--as-needed" #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. configure with LDFLAGS="--as-needed"
2. make
3. see it FAIL with 
gcc -I../../src/lib -g -std=c99 -g3 -O0 -pipe
-DPLUGINDIR=\"/usr/local/lib/libproxy/0.2.3/plugins\"
-DSYSCONFDIR=\"/usr/local/etc\" -D_POSIX_C_SOURCE=1 -Wl,-O0
-Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -o .libs/proxy
proxy-proxy.o  -ldl -L/opt/gnome2/lib64 ../lib/.libs/libproxy.so -lm 
-Wl,--rpath -Wl,/usr/local/lib
../lib/.libs/libproxy.so: undefined reference to `dlsym'
../lib/.libs/libproxy.so: undefined reference to `dlerror'
../lib/.libs/libproxy.so: undefined reference to `dlopen'
../lib/.libs/libproxy.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status

What is the expected output? What do you see instead?
I expected it to compile fine.

What version of the product are you using? On what operating system?
0.3.2 on Fedora 10

Please provide any additional information below.
I removed the --as-needed flag and it works!
So the fix must be to add -ldl to the compiling flags.

Original issue reported on code.google.com by 4tmue...@gmail.com on 5 Feb 2009 at 10:59

GoogleCodeExporter commented 9 years ago
This patch doesn't necessarily break other platforms as the patch in issue #25 
does.
See http://www.gentoo.org/doc/en/articles/autotools-practices.xml for further
information. Especially
"Also, though defining CFLAGS and LDFLAGS on a per-target basis seems useful, 
adding
static flags in Makefile.am is a bad thing for portability, as you can't tell 
if the
compiler you're using supports them, or if you really need them (-ldl put in 
LDFLAGS
is a good example of a flag needed on Linux but not on FreeBSD); in such cases 
you
should use configure.ac to add these flags."

Original comment by 4tmue...@gmail.com on 5 Feb 2009 at 11:01

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dominiqu...@gmail.com on 9 Feb 2009 at 10:22

GoogleCodeExporter commented 9 years ago
merged with svn commit 303

Original comment by dominiqu...@gmail.com on 10 Feb 2009 at 8:31