Page 1 of 1

Buildsystem problem in libtool

Posted: 07 Dec 2006 17:09
by GiantDwarf
Hi,
i have some libs that i need to link in a special order. Therefor i added the compiler flags

Code: Select all

-Wl,--start-group -llib1 -llib2 -llib3 -Wl,--end-group
but when the gcc is called to link the libs i end up with:
-Wl,--start-group -Wl,--end-group -llib1 -llib2 -llib3
after the libtool was called.


I think the problem is in the libtool script in line 2110 which strips every -Wl, stuff and puts it in another order (which isn't too clever for the grouping :wink:).

Code: Select all

---snip--- -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; --snap---
i tried it with:
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 'if ((! /^-Wl,--start-group/) && (! /^-Wl,--end-group/)) {s/^-Wl,//}'`

but :oops: this isn' perl.
Is anybody able to help me as i have realy no clue of SED.

Thanx a lot.

Posted: 18 Dec 2006 12:51
by GiantDwarf
Uups,
are there no guys out there that can help me with this problem? I already thought of the idea that the buildsystem with all of the scripts is so complicated that no one ever knows exactly what is going on and which template is creating the template to creates another template :D.

So does realy no one has a clue how i can get rid of my problem and how i can use these start-group end-group stuff???

Thanx

Posted: 04 Jan 2007 19:45
by RĂ©mi Denis-Courmont
libtool comes from err... libtoolize, which is not from VLC.

However, it looks like your underlying libs are actually missing some NEEDED entries, which is the actual bug. You should only need to specify underlying lib's lib when linking statically otherwise.