IMX8 Cross-compilation "unrecognized option '-Wl,-O1'"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8 Cross-compilation "unrecognized option '-Wl,-O1'"

4,590 Views
1042484520
Contributor II

Dear NXP:

   为什么用yocto编译的IMX8的Tool chain不支持LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"的参数?

   在交叉编译内核的时候会报错:

   aarch64-fslc-linux-ld: unrecognized option '-Wl,-O1'
   aarch64-fslc-linux-ld: use the --help option for usage information
   scripts/Makefile.build:534: recipe for target 'drivers/firmware/efi/libstub/lib-ksyms.o' failed
   make[4]: *** [drivers/firmware/efi/libstub/lib-ksyms.o] Error 1
   scripts/Makefile.build:587: recipe for target 'drivers/firmware/efi/libstub' failed
   make[3]: *** [drivers/firmware/efi/libstub] Error 2
   make[3]: *** Waiting for unfinished jobs....

0 Kudos
Reply
5 Replies

4,320 Views
joanxie
NXP TechSupport
NXP TechSupport
0 Kudos
Reply

4,320 Views
1042484520
Contributor II

Hi Joan:

 

   unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE

   上述unset操作是否会对内核的编译速度、优化程度造成一定的影响?

Thanks!

0 Kudos
Reply

4,320 Views
joanxie
NXP TechSupport
NXP TechSupport

to be honest, I'm not sure for this, I think unsetting these flags maybe affect the performance

0 Kudos
Reply

4,320 Views
1042484520
Contributor II

Hi Joan:

      那关于aarch64-fslc-linux-ld: unrecognized option '-Wl,-O1'问题有什么官方的解决方案吗?

Thanks!

0 Kudos
Reply

4,320 Views
joanxie
NXP TechSupport
NXP TechSupport

for using toolchain, suggest that you can use this as below:

Task #7 - Create the toolchain 

https://community.nxp.com/docs/DOC-95225 

0 Kudos
Reply