Summary: | www-apache/mod_python-3.3.1 fails due to strange LDFLAG issue | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Patrizio Bassi <patrizio.bassi> |
Component: | New packages | Assignee: | Apache Team - Bugzilla Reports <apache-bugs> |
Status: | RESOLVED UPSTREAM | ||
Severity: | trivial | ||
Priority: | High | ||
Version: | 2007.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | src/makefile patch |
Description
Patrizio Bassi
2007-08-26 18:14:09 UTC
Sanitize your LDFLAGS, retry, if it still fails then and if it's python-related, re-CC us. LDFLAGS are a bit bleeding edge but safe. whole world is safely merged with those. the point is not if the flag is leading to linking issues or whatever... the problem is that a part of my LDFLAGS gets somehow stripped out...and this should not happen... I get the same error with the latest version in portage. I set up my /etc/portage/env/www-apache/mod_python file with the most basic of CFLAGS and no LDFLAGS and it still fails. There is an error in the configuration somewhere that sets up a LDFLAG that this package cannot handle. Created attachment 130287 [details, diff]
src/makefile patch
I did some investigation and I found that after ./configure is run, this line appears in src/makefile:
LDFLAGS= -L/usr/lib/python2.5/config -Xlinker -export-dynamic -Wl,-O1 -Wl,--hash-style
So, I wrote a patch that takes out the --has-style. I use the new binutils where --hash-style needs to be followed by '={something}', so it was taking on a value that it doesn't support: -soname. I did a search though all the files and profiles but I could not figure out where in the world --hash-styles was added at. Whereever it is being added at, would be a good place to take it out and replace it with --hash-style=gnu for those with the new binutils or more things might start breaking, if portage adds it. If the configure scripts for mod_python add it, I don't know where, so someone needs to find that and write a patch to take it out there. My patch only works if you have python 2.5, so it's best to sed it out, but I am not good at using sed, so I have no idea how to remove --hash-style after configure with sed, this patch works for me as a temp solution. Something more permanent needs to be done.
Hope this helps. :) Let's get this fixed in portage somehow better than my solution. :P
Cheers.
Okay, forget the patch, I wrote a sed line that works. :) I have this in my ebuild now: src_compile() { econf --with-apxs=${APXS2} || die "econf failed" sed -i 's/ -Wl,--hash-style//' src/Makefile emake OPT="`apxs2 -q CFLAGS` -fPIC" || die "econf failed" } Cheers. in cvs I don't have the option to reopen this bug, but it needs to be. I looked in the new ebuild to find: src_unpack() { unpack ${A} cd "${S}" # Remove optimisations, we do that outside Portage sed -i -e 's:--optimize 2:--no-compile:' dist/Makefile.in sed -i -e 's/ -Wl,--hash-style//' src/Makefile } The new sed line is in src_unpack. This won't do since src/Makefile does not even exist until econf or ./configure is run, so this fix does not work. :( It needs to go right after the econf statement in src_compile like my previous example. I have looked all over the source and I cannot find where --hash-value is being added. Something with the configure process is putting it in the makefile. There must be a global variable or something in the system adding it. I will hunt some more, but it both running econf and ./configure manually adds that LD Flag. Is there any way to test if it is a global variable of some type? That sed line does fix the issue when it is in scr_compile, but it is not the true fix. The true cause needs to be found, but I have no idea how to test for that. Thanks. you're right...and actually it's still failing... oops :) fixed now not really.. /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc -o mod_python.la -rpath /usr/lib64/apache2/modules -module -avoid-version finfoobject.lo hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_python.lo -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,--as-needed=both -L/usr/lib64/python2.5/config -Xlinker -export-dynamic -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,--as-needed -Wl,--hash-style -lm -lpython2.5 -lpthread -ldl -lutil -lm /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: unrecognized option '--as-needed=both' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status apxs:Error: Command failed with rc=65536 what's going on with the filter here? Nothing really; submit this upstream if you want it fixed. |