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

A recent update is causing a compile error: #17

Closed
circuitcreature opened this issue Nov 18, 2023 · 12 comments
Closed

A recent update is causing a compile error: #17

circuitcreature opened this issue Nov 18, 2023 · 12 comments

Comments

@circuitcreature
Copy link
Collaborator

circuitcreature commented Nov 18, 2023

There was a recent update in sample.c that is causing a compile error:

sample/sample.o: in function `.L22':
sample.c:(.text.allocate_block+0x176): relocation truncated to fit: R_AVR_7_PCREL against `.L9'
collect2: error: ld returned 1 exit status

This line

@Jaffe-
Copy link
Owner

Jaffe- commented Nov 18, 2023

I don't get the same error on my end, which version of gcc are you using?

@Jaffe-
Copy link
Owner

Jaffe- commented Nov 18, 2023

I wonder if this could be related to the change from -O3 to -O2 which was needed to fit in the new sample code and leave room for more features. The total size will be less now, but it requires that all the source files are recompiled before linking, otherwise the total size will be too large. Does it help if you force recompilation of all the sources?

@beau-seidon
Copy link
Collaborator

I also don't get a compile error, in @Jaffe- latest commit, or @circuitcreature new commit with midi cc.

@circuitcreature
Copy link
Collaborator Author

Im running gcc 13.2 on Mac.

@Jaffe-
Copy link
Owner

Jaffe- commented Jan 25, 2024

Did you manage to resolve this by compiling all sources again? (delete all .o files)

@circuitcreature
Copy link
Collaborator Author

I have not been able to get it to compile without changing it back to -O3.
I thought it was fixed last night, but it's showing up again. I've run make clean and also
find ./ -type f \( -iname \*.o -o -iname \*.ilk -iname \*.map -o -iname \*.exp -iname \*.bin -o -iname \*.elf -o -iname \*.hex \) -delete just to make sure all comile files are gone.

@beau-seidon
Copy link
Collaborator

@circuitcreature do you still get compile errors when you build with make and -O2 opt. without PlatformIO?
The current version compiles fine for me on Linux (RasPI OS - Buster [v10]) with no warnings or errors.

@circuitcreature
Copy link
Collaborator Author

@beau-seidon I do. I can dig into this later. I might be able to dig up an older Mac to test on as well. Same error as before
sample/sample.o: in function .L22':
sample.c:(.text.allocate_block+0x176): relocation truncated to fit: R_AVR_7_PCREL against .L9' collect2: error: ld returned 1 exit status make: *** [nesizer_fw.elf] Error 1

@beau-seidon
Copy link
Collaborator

Ok, I'll dig into that as well to see what that function specifically does. Like, way down in there.
It may be related to the issues I'm having on my pitched-sample-playback branch! (I doubt it. I'm probably just doing something wrong)

My brother has a Mac now, I'll ask him to try and compile it on his lappy too to see if he gets the same error.
I have never been able to get make to work on Windows, but I'll fiddle around with it.

@beau-seidon
Copy link
Collaborator

@circuitcreature
Copy link
Collaborator Author

Going to close this issue.
After digging in the code and trying umpteen things with Makefile, I purged avr-gcc and reinstalled it using a different version(14) than the default 9, and It's compiling just fine now.

@circuitcreature
Copy link
Collaborator Author

circuitcreature commented Oct 8, 2024

Closed. avr-gcc was out of date.
For anyone else that ends up here, MacOS terminal:

brew remove avr-gcc
brew install avr-gcc@14

https://github.com/osx-cross/homebrew-avr

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

3 participants