codegooglecom / libproxy

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

libproxy-0.4.6: Link error with -DWITH_WEBKIT=OFF -DWITH_MOZJS=ON #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This has been reported downstream at:
http://bugs.gentoo.org/show_bug.cgi?id=339216

Attached is a full build.log.

Affected people are getting the following:
CMakeFiles/PLlibproxy.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++  -fPIC -march=core2 -O2 -pipe -msse4.1  
-Wl,-O1 -Wl,--as-needed -shared -Wl,-soname,Libproxy.so -o 
../../../perl/blib/arch/auto/Net/Libproxy.so 
CMakeFiles/PLlibproxy.dir/Libproxy.c.o -lperl ../../../lib/libproxy.so.1.0.0 
../../../libmodman/libmodman.so.1.0.0 -lm -lpthread -lmozjs -lplds4 -lplc4 
-lnspr4 -lpthread -lmozjs -lplds4 -lplc4 -lnspr4 -ldl 
-Wl,-rpath,/var/tmp/portage/net-libs/libproxy-0.4.6/work/libproxy-0.4.6_build/li
b:/var/tmp/portage/net-libs/libproxy-0.4.6/work/libproxy-0.4.6_build/libmodman: 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: 
cannot find -lmozjs
collect2: ld returned 1 exit status
make[2]: *** [perl/blib/arch/auto/Net/Libproxy.so] Error 1
make[2]: Leaving directory 
`/var/tmp/portage/net-libs/libproxy-0.4.6/work/libproxy-0.4.6_build'
make[1]: *** [bindings/perl/src/CMakeFiles/PLlibproxy.dir/all] Error 2
make[1]: Leaving directory 
`/var/tmp/portage/net-libs/libproxy-0.4.6/work/libproxy-0.4.6_build'
make: *** [all] Error 2
emake failed

Attached patch (by Samuli Suominen) solves this issue, but we aren't sure about 
perl module and utils/ really requiring mozilla-js libs.

Thanks

Original issue reported on code.google.com by pachora...@gmail.com on 1 Oct 2010 at 9:15

Attachments:

GoogleCodeExporter commented 9 years ago
Fulle build.log

Original comment by pachora...@gmail.com on 1 Oct 2010 at 9:15

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, let's debug this bug report. The problem we are facing only occurs when 
webkit backend is disabled and xulrunner is enable. To reproduce the problem, 
build libproxy with the following build option.

  cmake ... -DWITH_WEBKIT=OFF -DWITH_MOZJS=ON

Next time you report a bug against a project using CMake, please provide the 
complete configuration options (cmake ... -Dblabla), this way we don't have to 
read Gentoo ebuilds, Redhat spec or Debian Makefiles.

The patch seems wrong to me, the flags for mozjs should not be spread all over 
the different CMakeFiles. Libproxy team will investigate this and provide a 
proper correction soon, thanks for reporting.

Original comment by nicolas.dufresne@gmail.com on 12 Oct 2010 at 3:23

GoogleCodeExporter commented 9 years ago
OK, thanks a lot, next time will make a better report :-)

Best regards

Original comment by pachora...@gmail.com on 12 Oct 2010 at 3:39

GoogleCodeExporter commented 9 years ago
It make no sense that the proxy utility and the Perl bindings gets linked to 
mozilla-js.

As explained at
http://www.cmake.org/Wiki/CMake_FAQ#Why_do_I_have_unwanted_semicolons_.3B_in_my_
compiler_flags.3F
if CMake links A to B and B to C, all the flags from A will be appended when
C is linked. This behaviour is wrong, but CMake provides a workaround which
is implemented in r774.

Original comment by nicolas.dufresne@gmail.com on 12 Oct 2010 at 5:55