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

Template fails to build with linker errors on newest nightly when using fat LTO #521

Closed
yodaldevoid opened this issue Dec 3, 2023 · 2 comments

Comments

@yodaldevoid
Copy link

As the title says. Based on CI and my testing, nightlies past 2023-12-01 cause the issue.

Looking at the commits between nightly-2023-12-01 and nightly-2023-12-02, there are a few changes around compiler-builtins, which is to be expected.

Commits of note:

Ill admit that I don't know enough about LTO to debug this further.

This may instead be an issue with the gba crate, but I was able to build an empty gba project without throwing errors. That said, I'm not entirely sure that empty project even did any memory access so it may not have hit this.

Linker errors

warning: memset changed binding to STB_WEAK

error: symbol 'memset' is already defined

warning: __aeabi_memclr4 changed binding to STB_WEAK

error: symbol '__aeabi_memclr4' is already defined

warning: __aeabi_memclr8 changed binding to STB_WEAK

error: symbol '__aeabi_memclr8' is already defined

warning: memcpy changed binding to STB_WEAK

error: symbol 'memcpy' is already defined

warning: __aeabi_memcpy changed binding to STB_WEAK

error: symbol '__aeabi_memcpy' is already defined

warning: __aeabi_memcpy8 changed binding to STB_WEAK

error: symbol '__aeabi_memcpy8' is already defined

warning: __aeabi_memset changed binding to STB_WEAK

error: symbol '__aeabi_memset' is already defined

warning: __aeabi_memset8 changed binding to STB_WEAK

error: symbol '__aeabi_memset8' is already defined

warning: __aeabi_memclr changed binding to STB_WEAK

error: symbol '__aeabi_memclr' is already defined

warning: __aeabi_memcpy4 changed binding to STB_WEAK

warning: __aeabi_memset4 changed binding to STB_WEAK
@gwilymk
Copy link
Contributor

gwilymk commented Dec 5, 2023

Sadly we've had this happen before and it's annoying to reproduce because from what I can tell, you need to have some non-trivial example which causes enough LTO to happen to make it actually break...

rust-lang/rust#108853 (comment) is the commit that broke it last time which is doubly strange. I haven't created an issue in the rust repo yet, but will probably do so tonight unless you have already

@gwilymk
Copy link
Contributor

gwilymk commented Jan 13, 2024

Latest nightly has fixed this now 🎉

@gwilymk gwilymk closed this as completed Jan 13, 2024
@corwinkuiper corwinkuiper unpinned this issue Jan 15, 2024
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