-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update to GCC 15 #2372
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
Open
mark9064
wants to merge
2
commits into
InfiniTimeOrg:main
Choose a base branch
from
mark9064:update-to-gcc14
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+73
−16
Open
Update to GCC 15 #2372
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
| #include <FreeRTOS.h> | ||
| #include <sys/stat.h> | ||
| #include <unistd.h> | ||
|
|
||
| // Override malloc() and free() to use the memory manager from FreeRTOS. | ||
| // According to the documentation of libc, we also need to override | ||
|
|
@@ -29,7 +31,7 @@ void __wrap_free(void* ptr) { | |
| } | ||
|
|
||
| void* calloc(size_t num, size_t size) { | ||
| void *ptr = malloc(num * size); | ||
| void* ptr = malloc(num * size); | ||
| if (ptr) { | ||
| memset(ptr, 0, num * size); | ||
| } | ||
|
|
@@ -49,3 +51,58 @@ void* realloc(void* ptr, size_t newSize) { | |
| void* __wrap_realloc(void* ptr, size_t newSize) { | ||
| return realloc(ptr, newSize); | ||
| } | ||
|
|
||
| // Implement functions required by libc as stubs | ||
| // These functions aren't linked into the final binary | ||
|
|
||
| __attribute__((error("stub"))) void _close(int fp) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The attributes might be a no-op as these are technically definitions rather than declarations. But they can't hurt I guess... the docs aren't super clear |
||
| __builtin_trap(); | ||
| (void) fp; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) void _fstat(int fildes, struct stat* buf) { | ||
| __builtin_trap(); | ||
| (void) fildes; | ||
| (void) buf; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) pid_t _getpid() { | ||
| __builtin_trap(); | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) int _isatty(int fd) { | ||
| __builtin_trap(); | ||
| (void) fd; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) int _kill(pid_t pid, int sig) { | ||
| __builtin_trap(); | ||
| (void) pid; | ||
| (void) sig; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) off_t _lseek(int fd, off_t offset, int whence) { | ||
| __builtin_trap(); | ||
| (void) fd; | ||
| (void) offset; | ||
| (void) whence; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) ssize_t _read(int fd, void* buf, size_t count) { | ||
| __builtin_trap(); | ||
| (void) fd; | ||
| (void) buf; | ||
| (void) count; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) ssize_t _write(int fd, void* buf, size_t count) { | ||
| __builtin_trap(); | ||
| (void) fd; | ||
| (void) buf; | ||
| (void) count; | ||
| } | ||
|
|
||
| __attribute__((error("stub"))) void _exit(int status) { | ||
| __builtin_trap(); | ||
| (void) status; | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just so I understand correctly. To get down size we exluded the stlib with the nosys.specs linker flag.
Why can we remove it now? I'd like to learn more
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libnosys provides stub implementations for system calls like read, write etc.
Since GCC11 these stubs emit warnings at the end of compilation which are noisy and annoying
From my research it seems like the best solution is to reimplement those calls as stubs ourselves, as we're sure that they're not being used. So since we're implementing those calls ourselves, we don't need libnosys anymore