Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-flto -g fails #15

Closed
Trass3r opened this issue May 6, 2019 · 6 comments
Closed

-flto -g fails #15

Trass3r opened this issue May 6, 2019 · 6 comments

Comments

@Trass3r
Copy link

Trass3r commented May 6, 2019

I tested the toolchain, thanks for it!
It even saves 2-3KB compared to my older 8.2 toolchain.
LTO works too but not when adding debug info (worked with the older toolchain). Can you reproduce this?
arm-none-eabi/bin/ld.exe: error: could not unlink output file

@Trass3r
Copy link
Author

Trass3r commented May 6, 2019

Ok seems to go away when removing -save-temps.

@Trass3r Trass3r closed this as completed May 6, 2019
@Trass3r Trass3r reopened this May 6, 2019
@Trass3r
Copy link
Author

Trass3r commented May 7, 2019

Looks like it is a legit bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90369

@Trass3r Trass3r closed this as completed May 7, 2019
@FreddieChopin
Copy link
Owner

You sorted that out even before I could try it (; After the gcc team publishes a new snapshot (10.x.x snapshot or 9.x.x snapshot if the bug report will have info about fixing this in gcc-9-branch too) you can build the new toolchain using the script - just replace gccVersion="9.1.0" with gccVersion="10-YYYYMMDD" (depending on the snapshot name) and run it again.

@Trass3r
Copy link
Author

Trass3r commented May 7, 2019

Yeah I guess they won't backport it to v9. -save-temps is not used that often. I also just use it to see the produced assembly in the case of LTO.

@FreddieChopin
Copy link
Owner

Yeah I guess they won't backport it to v9.

You never know (; Maybe they will, try to nag them a bit if you care about that. But if you can also try the 10.x.x snapshot, then it doesn't matter that much.

-save-temps is not used that often. I also just use it to see the produced assembly in the case of LTO.

You can inspect assembler in a different way. I just dump the assembly straight from the produced executable like this:
https://github.com/DISTORTEC/distortos/blob/master/cmake/distortos-utilities.cmake#L90
$ arm-none-eabi-objdump --demangle -S output.elf > output.lss

If you compile with debugging symbols, then the assembly usually is nicely mixed with the sourcecode (it gets worse with higher optimization levels).

@Trass3r
Copy link
Author

Trass3r commented May 7, 2019

Yeah I know but gcc's output is way better than objdump's iirc. Would need to re-check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants