Skip to content

[libc] fix build on aarch64 #73739

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

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions libc/config/linux/aarch64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,6 @@ set(TARGET_LIBC_ENTRYPOINTS
#libc.src.stdio.scanf
#libc.src.stdio.fscanf

# search.h entrypoints
libc.src.search.hcreate
libc.src.search.hcreate_r
libc.src.search.hsearch
libc.src.search.hsearch_r
libc.src.search.hdestroy
libc.src.search.hdestroy_r

# sys/mman.h entrypoints
libc.src.sys.mman.madvise
libc.src.sys.mman.mmap
Expand Down Expand Up @@ -459,6 +451,14 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.signal.sigfillset
libc.src.signal.signal

# search.h entrypoints
libc.src.search.hcreate
libc.src.search.hcreate_r
libc.src.search.hsearch
libc.src.search.hsearch_r
libc.src.search.hdestroy
libc.src.search.hdestroy_r

# threads.h entrypoints
libc.src.threads.call_once
libc.src.threads.cnd_broadcast
Expand Down
10 changes: 1 addition & 9 deletions libc/config/linux/arm/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.stdlib.strtoll
libc.src.stdlib.strtoul
libc.src.stdlib.strtoull

# search.h entrypoints
libc.src.search.hcreate
libc.src.search.hcreate_r
libc.src.search.hsearch
libc.src.search.hsearch_r
libc.src.search.hdestroy
libc.src.search.hdestroy_r


# sys/mman.h entrypoints
libc.src.sys.mman.mmap
libc.src.sys.mman.munmap
Expand Down
16 changes: 8 additions & 8 deletions libc/config/linux/riscv/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.stdio.scanf
libc.src.stdio.fscanf

# search.h entrypoints
libc.src.search.hcreate
libc.src.search.hcreate_r
libc.src.search.hsearch
libc.src.search.hsearch_r
libc.src.search.hdestroy
libc.src.search.hdestroy_r

# sys/mman.h entrypoints
libc.src.sys.mman.madvise
libc.src.sys.mman.mmap
Expand Down Expand Up @@ -492,6 +484,14 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.spawn.posix_spawn_file_actions_destroy
libc.src.spawn.posix_spawn_file_actions_init

# search.h entrypoints
libc.src.search.hcreate
libc.src.search.hcreate_r
libc.src.search.hsearch
libc.src.search.hsearch_r
libc.src.search.hdestroy
libc.src.search.hdestroy_r

# threads.h entrypoints
libc.src.threads.call_once
libc.src.threads.cnd_broadcast
Expand Down
4 changes: 2 additions & 2 deletions libc/src/__support/bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ template <typename T> LIBC_INLINE int constexpr correct_zero(T val, int bits) {
template <typename T> LIBC_INLINE constexpr int clz(T val);
template <> LIBC_INLINE int clz<unsigned char>(unsigned char val) {
return __builtin_clz(static_cast<unsigned int>(val)) -
8 * (sizeof(unsigned int) - sizeof(unsigned char));
8 * static_cast<int>(sizeof(unsigned int) - sizeof(unsigned char));
}
template <> LIBC_INLINE int clz<unsigned short>(unsigned short val) {
return __builtin_clz(static_cast<unsigned int>(val)) -
8 * (sizeof(unsigned int) - sizeof(unsigned short));
8 * static_cast<int>(sizeof(unsigned int) - sizeof(unsigned short));
}
template <> LIBC_INLINE int clz<unsigned int>(unsigned int val) {
return __builtin_clz(val);
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/__support/hash_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ template <class T> struct AlignedMemory {
};

size_t sizes[] = {0, 1, 23, 59, 1024, 5261};
char values[] = {0, 1, 23, 59, 102, -1};
uint8_t values[] = {0, 1, 23, 59, 102, 255};

// Hash value should not change with different alignments.
TEST(LlvmLibcHashTest, SanityCheck) {
Expand Down