Skip to content
Draft
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
20 changes: 20 additions & 0 deletions gcc-14-asan-thread-allocator-race.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/libsanitizer/asan/asan_thread.cpp b/libsanitizer/asan/asan_thread.cpp
--- a/libsanitizer/asan/asan_thread.cpp
+++ b/libsanitizer/asan/asan_thread.cpp
@@ -44,10 +44,15 @@
static ThreadArgRetval *thread_data;

static Mutex mu_for_thread_context;
+// TODO(leonardchan@): It should be possible to make LowLevelAllocator
+// threadsafe and consolidate this one into the GlobalLoweLevelAllocator.
+// We should be able to do something similar to what's in
+// sanitizer_stack_store.cpp.
+static LowLevelAllocator allocator_for_thread_context;

static ThreadContextBase *GetAsanThreadContext(u32 tid) {
Lock lock(&mu_for_thread_context);
- return new (GetGlobalLowLevelAllocator()) AsanThreadContext(tid);
+ return new (allocator_for_thread_context) AsanThreadContext(tid);
}

static void InitThreads() {
6 changes: 4 additions & 2 deletions gcc.spec
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
### RPM external gcc 14.3.1
### RPM external gcc 14.4.1
## USE_COMPILER_VERSION
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64
# Use the git repository for fetching the sources. This gives us more control while developing
# a new platform so that we can compile yet to be released versions of the compiler.
# See: https://gcc.gnu.org/viewcvs/gcc/branches/gcc-8-branch/?view=log

BuildRequires: gcc-prerequisites
%define gccTag e02b12e7248f8209ebad35d6df214d3421ed8020
%define gccTag 4bd83628104c199199915e44b5d13c96a79b149b
%define gccBranch releases/gcc-14

%define moduleName %{n}-%{realversion}
Source0: git+https://github.com/gcc-mirror/%{n}.git?obj=%{gccBranch}/%{gccTag}&export=%{moduleName}&output=/%{n}-%{realversion}-%{gccTag}.tgz
Source1: https://github.com/gcc-mirror/gcc/commit/0a1d2ea57722c248777e1130de076e28c443ff8b.diff
Source2: https://github.com/gcc-mirror/gcc/commit/77d01927bd7c989d431035251a5c196fe39bcec9.diff
Patch0: gcc-14-asan-thread-allocator-race

%define keep_archives true

Expand All @@ -21,6 +22,7 @@ Source2: https://github.com/gcc-mirror/gcc/commit/77d01927bd7c989d431035251a5c19
%setup -T -b 0 -n %{moduleName}
patch -p1 <%{_sourcedir}/0a1d2ea57722c248777e1130de076e28c443ff8b.diff
patch -p1 <%{_sourcedir}/77d01927bd7c989d431035251a5c196fe39bcec9.diff
%patch0 -p1

# Filter out private stuff from RPM requires headers.
cat << \EOF > %{name}-req
Expand Down