[pacman-dev] [PATCH 2/2] Fix libtool detection of --as-needed flag

Allan McRae allan at archlinux.org
Sat Oct 22 05:34:33 EDT 2011


On 22/10/11 18:38, Allan McRae wrote:
> The fix for -Wl,--as-needed in commit b0f9477f assumes that
> --as-needed/--no-as-needed is the only option given in a -Wl line.
> However, it is perfectly valid to specify multiple flags comma
> separated after a single -Wl (e.g. the default LDFLAGS in Arch
> Linux makepkg.conf).
>
> Adjust the fix so it detect --as-needed in a more general context
>
>> readelf -d lib/libalpm/.libs/libalpm.so.?.?.? | grep NEEDED | wc -l
> Before: 13
> After: 5
>
> Signed-off-by: Allan McRae<allan at archlinux.org>
> ---

And lets play spot the error...   I will fix this and resubmit.


>   ltmain.sh |    9 +++++++--
>   1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/ltmain.sh b/ltmain.sh
> index fafd01b..a2406da 100644
> --- a/ltmain.sh
> +++ b/ltmain.sh
> @@ -5800,8 +5800,13 @@ func_mode_link ()
>   	arg=$func_stripname_result
>   	;;
>
> -      -Wl,--as-needed|-Wl,--no-as-needed)
> -	deplibs="$deplibs $arg"
> +      -Wl,*--as-needed*)
> +	deplibs="$deplibs -Wl,--as-needed"
> +	continue
> +	;;
> +
> +      -Wl,*--no-as-needed*)
> +	deplibs="$deplibs -Wl,--no-as-needed"
>   	continue
>   	;;
>



More information about the pacman-dev mailing list