I am using mcuxpresso v11.2.0.
I have enabled -flto for C++, C compilers and for the linker. I am using an external library which causes the link time optimization to fail Error: invalid offset, value too big (0x00002C90)
I've narrowed down the issue to an external lib that I cannot modify. Therefore, I would like to enable -flto for everything except this external library.
Is this possible?
Thanks,
Victor
解決済! 解決策の投稿を見る。
Hi Victor,
simply right-click on a file or folder and set the compiler/etc options.
The fact that you have per-file or per-folder options is marked with an icon decorator:
See Icon and Label Decorators in Eclipse | MCU on Eclipse .
(the above shows as well how to restore it it to the defaults)
I hope this helps,
Erich
Is the library compiled or provided as archive?
There are basically two things:
a) compiling the sources with LTO
b) linking with LTO
b) requires a), but it should be possible compile some source files with or without LTO. Simply do not set that option for these files or folders.
Hello Erich,
Compiling the source of the libs is not possible, the sources are closed. However my code could result in a smaller binary if I could enable the option for my source files.
Is it possible to select what files we want to compile with and without -flto in Mcuxpresso? If so, how?
Given I'm using a code base mixing C and C++, the workaround I'm using is to enable -flto for the C++ compiler and the linker, but not the C compiler, and it works.
However I would really like to compile the open source C files with -flto too.
Hi Victor,
simply right-click on a file or folder and set the compiler/etc options.
The fact that you have per-file or per-folder options is marked with an icon decorator:
See Icon and Label Decorators in Eclipse | MCU on Eclipse .
(the above shows as well how to restore it it to the defaults)
I hope this helps,
Erich