Skip to content

Update LLVM libraries to 20.1.8 #24757

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 7 commits into from
Jul 24, 2025
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
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works.

4.0.12 (in development)
-----------------------
- libcxx, libcxxabi, libunwind, and compiler-rt were updated to LLVM 20.1.8.
(#24757)
- The `fsblkcnt_t` and `fsfilcnt_t` types used by `statfs`/`statvfs` were
changed from 32-bit to 64-bit. (#24769)
- Support for `-sTEXT_DECODER=0` was removed, due to widespread support for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,17 +338,9 @@ static void ioctl_table_fill() {
_(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
_(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
_(TCFLSH, NONE, 0);
#if SANITIZER_GLIBC
_(TCGETA, WRITE, struct_termio_sz);
#endif
_(TCGETS, WRITE, struct_termios_sz);
_(TCSBRK, NONE, 0);
_(TCSBRKP, NONE, 0);
#if SANITIZER_GLIBC
_(TCSETA, READ, struct_termio_sz);
_(TCSETAF, READ, struct_termio_sz);
_(TCSETAW, READ, struct_termio_sz);
#endif
_(TCSETS, READ, struct_termios_sz);
_(TCSETSF, READ, struct_termios_sz);
_(TCSETSW, READ, struct_termios_sz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
# include <sys/sysmacros.h>
# endif

# if SANITIZER_LINUX && defined(__powerpc64__)
# include <asm/ptrace.h>
# endif

# if SANITIZER_FREEBSD
# include <machine/atomic.h>
# include <sys/exec.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) {
*addr = tp - RoundUpTo(*size, align);
*size = tp - *addr + ThreadDescriptorSize();
# else
if (SANITIZER_GLIBC)
*size += 1664;
else if (SANITIZER_FREEBSD)
*size += 128; // RTLD_STATIC_TLS_EXTRA
# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
# if SANITIZER_GLIBC
*size += 1664;
# elif SANITIZER_FREEBSD
*size += 128; // RTLD_STATIC_TLS_EXTRA
# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
const uptr pre_tcb_size = TlsPreTcbSize();
*addr -= pre_tcb_size;
*size += pre_tcb_size;
# else
# else
// arm and aarch64 reserve two words at TP, so this underestimates the range.
// However, this is sufficient for the purpose of finding the pointers to
// thread-specific data keys.
const uptr tcb_size = ThreadDescriptorSize();
*addr -= tcb_size;
*size += tcb_size;
# endif
# endif
# endif
# elif SANITIZER_NETBSD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
# include <sys/ptrace.h>
# if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 || \
defined(__sparc__)
defined(__sparc__) || defined(__powerpc64__)
# include <asm/ptrace.h>
# ifdef __arm__
typedef struct user_fpregs elf_fpregset_t;
Expand Down Expand Up @@ -488,9 +488,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned struct_input_id_sz = sizeof(struct input_id);
unsigned struct_mtpos_sz = sizeof(struct mtpos);
unsigned struct_rtentry_sz = sizeof(struct rtentry);
#if SANITIZER_GLIBC || SANITIZER_ANDROID
unsigned struct_termio_sz = sizeof(struct termio);
#endif
unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
unsigned struct_vt_stat_sz = sizeof(struct vt_stat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,6 @@ extern unsigned struct_hd_geometry_sz;
extern unsigned struct_input_absinfo_sz;
extern unsigned struct_input_id_sz;
extern unsigned struct_mtpos_sz;
extern unsigned struct_termio_sz;
extern unsigned struct_vt_consize_sz;
extern unsigned struct_vt_sizes_sz;
extern unsigned struct_vt_stat_sz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#include <sys/types.h> // for pid_t
#include <sys/uio.h> // for iovec
#include <elf.h> // for NT_PRSTATUS
#if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
#if (defined(__aarch64__) || defined(__powerpc64__) || \
SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
!SANITIZER_ANDROID
// GLIBC 2.20+ sys/user does not include asm/ptrace.h
# include <asm/ptrace.h>
Expand Down
4 changes: 2 additions & 2 deletions system/lib/compiler-rt/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
llvm's compiler-rt
------------------

These files are from the llvm-project based on release 20.1.4.
These files are from the llvm-project based on release 20.1.8.

We maintain a local fork of llvm-project that contains any emscripten
specific patches:
Expand All @@ -20,4 +20,4 @@ Modifications

For a list of changes from upstream see the compiler-rt files that are part of:

https://github.com/llvm/llvm-project/compare/llvmorg-20.1.4...emscripten-core:emscripten-libs-20
https://github.com/llvm/llvm-project/compare/llvmorg-20.1.8...emscripten-core:emscripten-libs-20
8 changes: 7 additions & 1 deletion system/lib/libcxx/include/__configuration/availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@

// Availability markup is disabled when building the library, or when a non-Clang
// compiler is used because only Clang supports the necessary attributes.
#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || !defined(_LIBCPP_COMPILER_CLANG_BASED)
//
// We also allow users to force-disable availability markup via the `_LIBCPP_DISABLE_AVAILABILITY`
// macro because that is the only way to work around a Clang bug related to availability
// attributes: https://github.com/llvm/llvm-project/issues/134151.
// Once that bug has been fixed, we should remove the macro.
#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || \
!defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_DISABLE_AVAILABILITY)
# undef _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
# define _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS 0
#endif
Expand Down
2 changes: 1 addition & 1 deletion system/lib/libcxx/include/__flat_map/flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class flat_map {

class value_compare {
private:
key_compare __comp_;
_LIBCPP_NO_UNIQUE_ADDRESS key_compare __comp_;
_LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : __comp_(__c) {}
friend flat_map;

Expand Down
2 changes: 1 addition & 1 deletion system/lib/libcxx/include/__flat_map/flat_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class flat_multimap {

class value_compare {
private:
key_compare __comp_;
_LIBCPP_NO_UNIQUE_ADDRESS key_compare __comp_;
_LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : __comp_(__c) {}
friend flat_multimap;

Expand Down
4 changes: 2 additions & 2 deletions system/lib/libcxx/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
llvm's libcxx
-------------

These files are from the llvm-project based on release 20.1.4.
These files are from the llvm-project based on release 20.1.8.

We maintain a local fork of llvm-project that contains any emscripten
specific patches:
Expand All @@ -20,4 +20,4 @@ Modifications

For a list of changes from upstream see the libcxx files that are part of:

https://github.com/llvm/llvm-project/compare/llvmorg-20.1.4...emscripten-core:emscripten-libs-20
https://github.com/llvm/llvm-project/compare/llvmorg-20.1.8...emscripten-core:emscripten-libs-20
4 changes: 2 additions & 2 deletions system/lib/libcxxabi/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
llvm's libcxxabi
----------------

These files are from the llvm-project based on release 20.1.4.
These files are from the llvm-project based on release 20.1.8.

We maintain a local fork of llvm-project that contains any emscripten
specific patches:
Expand All @@ -20,4 +20,4 @@ Modifications

For a list of changes from upstream see the libcxxabi files that are part of:

https://github.com/llvm/llvm-project/compare/llvmorg-20.1.4...emscripten-core:emscripten-libs-20
https://github.com/llvm/llvm-project/compare/llvmorg-20.1.8...emscripten-core:emscripten-libs-20
4 changes: 2 additions & 2 deletions system/lib/libunwind/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
llvm's libunwind
----------------

These files are from the llvm-project based on release 20.1.4.
These files are from the llvm-project based on release 20.1.8.

We maintain a local fork of llvm-project that contains any emscripten
specific patches:
Expand All @@ -20,4 +20,4 @@ Modifications

For a list of changes from upstream see the libunwind files that are part of:

https://github.com/llvm/llvm-project/compare/llvmorg-20.1.4...emscripten-core:emscripten-libs-20
https://github.com/llvm/llvm-project/compare/llvmorg-20.1.8...emscripten-core:emscripten-libs-20