fix build error “std::function has not been declared”#1
Open
dougmencken wants to merge 1 commit intoiains:darwin-xtools-1-1-0from
Open
fix build error “std::function has not been declared”#1dougmencken wants to merge 1 commit intoiains:darwin-xtools-1-1-0from
dougmencken wants to merge 1 commit intoiains:darwin-xtools-1-1-0from
Conversation
Owner
|
out of curiosity - what was the build compiler in this case? |
Author
The same as in #2 GCC 8.2 patched with yours https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=265568 |
iains
pushed a commit
that referenced
this pull request
Oct 3, 2023
In ar(1), strcmp() checks are used to determine the value of argument argv[1], even when no argument is given. In the past, they were possibly harmless out-of-bound reads and comparison with garbage, without consequences. However, running it on macOS 13 w/ Apple Silicon immediately crashes it with Segmentation Fault, because argv[1] is now NULL and generates EXC_BAD_ACCESS in strcmp(). This commit checks whether argc is equal or greater than 2 before doing strcmp(). $ ./bin/ar Segmentation fault: 11 * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000193181460 libsystem_platform.dylib`_platform_strcmp + 144 libsystem_platform.dylib`: -> 0x193181460 <+144>: ldr q0, [x0], #0x10 0x193181464 <+148>: ldr q1, [x1], #0x10 0x193181468 <+152>: cmeq.16b v1, v0, v1 0x19318146c <+156>: and.16b v0, v0, v1 Target 0: (ar) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) * frame #0: 0x0000000193181460 libsystem_platform.dylib`_platform_strcmp + 144 frame #1: 0x0000000100006440 ar`main(argc=1, argv=0x000000016fdfef58) at ar.c:126:8 frame #2: 0x0000000192e2be50 dyld`start + 2544 Signed-off-by: Yifeng Li <tomli@tomli.me>
cooljeanius
referenced
this pull request
in cooljeanius/darwin-xtools
Feb 26, 2026
Fix build on macOS 13
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.
No description provided.