Clang support#102
Open
remexre wants to merge 35 commits into
Open
Conversation
arbormoss
reviewed
Apr 16, 2026
| tar \ | ||
| zstd | ||
| zstd \ | ||
| clang |
| cd build | ||
| ../configure --target ${{ matrix.target }} | ||
| export target=${{ matrix.target }} | ||
| [[ ${{ matrix.target }} == *"clang" ]] && ../configure --target ${target::-6} --clang || ../configure --target ${{ matrix.target }} |
Contributor
There was a problem hiding this comment.
Suggested change
| [[ ${{ matrix.target }} == *"clang" ]] && ../configure --target ${target::-6} --clang || ../configure --target ${{ matrix.target }} | |
| if [[ ${{ matrix.target }} == *"clang" ]]; then | |
| ../configure --target ${target::-6} --clang | |
| else | |
| ../configure --target ${{ matrix.target }} | |
| fi |
| #include <types.h> | ||
|
|
||
| [[gnu::access(write_only, 1), gnu::nonnull(1)]] | ||
| [[gnu::nonnull(1)]] |
Contributor
There was a problem hiding this comment.
should access write only be removed?
| /** | ||
| * Like `alloc`, but only for allocations with `0 < size && size <= 1024`. | ||
| */ | ||
| [[gnu::alloc_size(1), gnu::malloc, gnu::malloc(free, 1), nodiscard]] void * |
Contributor
There was a problem hiding this comment.
should this have been removed
| printf >&2 'Defaults for the options are specified in brackets.\n' | ||
| printf >&2 '\nSystem:\n' | ||
| printf >&2 ' --arch=ARCH build for the given architecture [%s]\n' "$arch" | ||
| printf >&2 ' --clang build with clang instead of gcc\n' |
Contributor
There was a problem hiding this comment.
Suggested change
| printf >&2 ' --clang build with clang instead of gcc\n' | |
| printf >&2 ' --clang build with Clang instead of GCC\n' |
|
|
||
| # Add default CFLAGS and LDFLAGS. | ||
| if [[ "$default_cflags" = 1 ]]; then | ||
| CFLAGS="-g -O3 -Wall -Werror ${CFLAGS:-}" |
| if [[ "$clang" == 1 ]]; then | ||
| CC="clang" | ||
| find_tool_with_prefix CC clang | ||
| CFLAGS="-target riscv64-none-elf -std=c23 $CFLAGS" |
2972a07 to
f023525
Compare
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: junefish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: june-fish <git@june.fish>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Honestly, I could kinda feel moving these out to a separate .c file, so we could then more easily test that they match the GCC builtins (at least on u8, u16, and u32)... We could probably rely on LTO for performance with Clang, in that case. Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
This gets a warning on GCC; if the function gets inlined anyway, we inherit that attribute from alloc(), I suppose. Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
Signed-off-by: Amy Ringo <me@remexre.com>
The latter is for functions that're always incorrect when discarded; the former is a lot easier to silence. Signed-off-by: Amy Ringo <me@remexre.com>
f023525 to
aadac28
Compare
Open
Signed-off-by: Amy Ringo <me@remexre.com>
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.
Resolves #79.
Supersedes #84.