[yocto] Forcing link order for autotools recipe

Khem Raj raj.khem at gmail.com
Sun Sep 16 22:51:25 PDT 2012


On Sat, Sep 15, 2012 at 4:59 PM, Chris Tapp <opensource at keylevel.com> wrote:
> I've got a recipe that uses autotools. It builds ok under Poky, but if I try to build it on my host (e.g. when developing) then it fails to build with lots of 'symbol not found' link errors related to libs that are on the system and which are in the gcc lib search path.
>
> I've finally tracked this down to link order. The final command is of the form:
>
> g++ -lGL -lcurl -o binary a.o b.o
>
> If I change this to:
>
> g++ -o binary a.o b.o -lGL -lcurl
>
> then it builds ok.
>
> Stranger still is the original form works fine on another system (older Ubuntu). The ld versions are different (2.21.53 on the one that fails, 2.20.1 on the one that works).
>
> Can I get autotools to always link the libraries last?

you did not mention the failing distro but what Ross mentioned could
be one reason
another reason could be that its using gold as default linker where
overlinking is not the default as it used to be. The linking behavior
is correct there you need to fix the application to specify the
libraries correctly.

>
> Chris Tapp
>
> opensource at keylevel.com
> www.keylevel.com
>
>
>
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list