Converting project to use LTO, running into several issues
I'm converting a project that compiles nicely under 4.9 2015q1 to 5.4 2016q3. Before attempting to use LTO, I've confirmed it compiles and runs.
The first issue is that I had to add -fno-builtins, or I had unresolved references to printf, vfprintf, memcmp, alloc, and several others. I'm somewhat indifferent to whether I use builtins or not, but I'm curious why those would be unresolved references.
The stopping issue for me is that now __clear_cache is unresolved in every .o file in the project. I was going to disassemble the .o file with objdump, but it seems when the -flto is used, that's no longer possible.
I was hoping if there was any insight from someone who has hit this before I try to cook down a minimal test case, etc. The project itself has about 286 .c files, and a couple .S files, although I imagine it shouldn't be take too long to get a minimal test case should I need to.
I'm using 5.4 2016q3 under Windows 7. The target is an STM32L151ZD. -flto is enabled when compiling .c and .S files. I had to add '--plugin liblto_
Any ideas what I'm missing/doing wrong/etc?
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
C:\cygwin\
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:731: output/
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask JC Wren for more information if necessary.