Bug 3878

Summary: arm-oe-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Simon Vanveerdeghem <simon.vanveerdeghem>
Component: devtools / tool chainAssignee: Bogdan Marinescu <bogdan.a.marinescu>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium CC: meta.mr.watcher, meta.watcher, richard.purdie
Version: 1.4   
Target Milestone: 1.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Simon Vanveerdeghem 2013-02-12 10:55:20 UTC
I have build meta-toolchain-qte, this create a toolchain. 
I have installed the toolchain, and run the environment-setup-...

I have made a qt application that i will build with the toolchain
I run qmake (this create the Makefile), then i run make. The toolchain build all the C files but when the toolchain links the object files together it fails with following error.

arm-oe-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-oe-linux-gnueabi-ld: use the --help option for usage information


When i use poky to build the application, i have no errors (bitbake <appname>).
Comment 1 Richard Purdie 2013-02-14 15:43:07 UTC
I don't think this is a bug in OE itself, only how you're using the toolchain. The issue is you're passing cc flags to ld. If you're going to do this, use gcc as the linker, then this will work (LD verses CCLD).
Comment 2 Simon Vanveerdeghem 2013-02-14 16:11:31 UTC
Hi,


Okey, thanks, this helps when is use the g++ as the linker.

When i look further to the recipes of qt i see the have recently changed the exports that are used in the toolchain. But they have also changed the linker form g++ to ld 

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-qt/meta?id=a68c456e851023606c882f287a398bbaba16f298

I don't know why the have changed that, i think the comment the have posted is about the " OE_QMAKE_CXX=${TARGET_PREFIX}g++' to OE_QMAKE_CXX=$CXX' " but they have also changed OE_QMAKE_LINK=${TARGET_PREFIX}g++' to OE_QMAKE_LINK=$LD'
Comment 3 Richard Purdie 2013-03-07 15:56:04 UTC
I think this is fixed by http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=3b9636a0a986f87d996a10fcc4b01add5c4d1e64. If this doesn't help, please reopen the bug.