Fix build issues with recent gcc toolchains#59
Open
larsks wants to merge 3 commits intoMikeBland:masterfrom
Open
Fix build issues with recent gcc toolchains#59larsks wants to merge 3 commits intoMikeBland:masterfrom
larsks wants to merge 3 commits intoMikeBland:masterfrom
Conversation
The Makefile was setting:
OBJDIR = $(OBJROOT)\obj_$(PROJECT)
The use of the backslash, which is an escape character in GNU make, was
causing the build to fail with:
makefile:51: Linux
test -d .\obj_ersky9x ||
/bin/sh: 1: Syntax error: end of file unexpected
makefile:1364: recipe for target '.\obj_ersky9x' failed
make: *** [.\obj_ersky9x] Error 2
With this change, the build now proceeds correctly.
With gcc 14.3.1, this code produces hundreds of warnings of the form:
warning: ISO C++17 does not allow 'register' storage class specifier
[-Wregister]
And many warnings of the form:
warning: taking address of packed member of 't_EEGeneral' may result in
an unaligned pointer value [-Waddress-of-packed-member]
This commit updates `makefile` to suppress these warnings.
Attempting to build this project using gcc 14.3.1 was failing with a number of errors: - "dangerous relocation: unsupported relocation" - "Unknown destination type (ARM/Thumb)" - Undefined reference errors for syscall functions This commit corrects these errors by making two changes: 1. Redefine `__errno`: Previously, `errno` was accessed as a simple global variable. In GCC 14.x with newlib-nano, the libraries expect `errno` to be accessed via the `__errno()` function, not as a direct global symbol. We can avoid the relocation errors by providing the necessary function. 2. Uncomment syscall stubs: These symbols are required by the standard library, even though we're not calling them. By providing stub implementations we avoid the undefined reference errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempting to build this project using gcc 14.3.1 was failing with a number
of errors:
This commit corrects these errors by making two changes:
Redefine
__errno: Previously,errnowas accessed as a simple globalvariable. In GCC 14.x with newlib-nano, the libraries expect
errnotobe accessed via the
__errno()function, not as a direct global symbol.We can avoid the relocation errors by providing the necessary function.
Uncomment syscall stubs: These symbols are required by the standard
library, even though we're not calling them. By providing stub
implementations we avoid the undefined reference errors.
Additionally, this PR also adds some flags to suppress copious compiler warnings and fixes a syntax error in the Makefile that prevented the build from working on Linux systems.