-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexandre Rulleau <[email protected]>
- Loading branch information
Showing
9 changed files
with
102 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
9591360672ba6192c606404caf70101538728a1cd5d548efcbb952f663f182bd1954d63743ffc9dd18f5c649a62a042c5e36d1ff423634dfd074f672dd1f4af9 cmake-3.28.0-linux-x86_64.tar.gz | ||
48a20095711870b23bd5db342de0e058a7c6876bafad4c6ce9ff9bce672ca1e95ed9ac890d519b0884cd277d091575eda7e60a97cad377ee57c1e20dee25feb1 cmake-3.28.0-linux-aarch64.tar.gz | ||
89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 llvm-project-16.0.6.src.tar.xz |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,52 @@ | ||
FROM debian@sha256:e11072c1614c08bf88b543fcfe09d75a0426d90896408e926454e88078274fcb AS toolchain | ||
FROM debian:latest AS toolchain | ||
|
||
ARG LLVM_VERSION=16 | ||
ARG LLVM_VERSION=16.0.6 | ||
ARG ARCH | ||
|
||
COPY . /build | ||
COPY Toolchain.cmake /build/Toolchain.cmake | ||
COPY CHECKSUMS /CHECKSUMS | ||
|
||
RUN echo "Building LLVM ${LLVM_VERSION} on ${ARCH}" | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y git wget lsb-release software-properties-common gnupg curl xz-utils make file lld patchelf gcc libgcc-s1 sed autoconf libssl-dev libxml2 | ||
|
||
RUN wget "https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-linux-$(arch | sed s/arm/aarch/).tar.gz" && \ | ||
grep -F "cmake-3.28.0-linux-$(arch | sed s/arm/aarch/).tar.gz" ./build/CHECKSUMS | sha512sum --check && \ | ||
tar --strip-components=1 -C /usr/local -xvzf "cmake-3.28.0-linux-$(arch | sed s/arm/aarch/).tar.gz" && \ | ||
rm "cmake-3.28.0-linux-$(arch | sed s/arm/aarch/).tar.gz" | ||
RUN apt-get update && apt-get install -y \ | ||
wget cmake binutils lld libncurses5-dev git patchelf xz-utils curl lsb-release wget software-properties-common gnupg | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && \ | ||
chmod +x llvm.sh && \ | ||
./llvm.sh ${LLVM_VERSION} all | ||
./llvm.sh 16 all | ||
|
||
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz && \ | ||
grep -F llvm-project-${LLVM_VERSION}.src.tar.xz /CHECKSUMS | sha512sum --check && \ | ||
tar -xvf llvm-project-${LLVM_VERSION}.src.tar.xz | ||
|
||
COPY wchar.h.diff /wchar.h.diff | ||
RUN patch /usr/include/wchar.h < /wchar.h.diff | ||
|
||
RUN cd llvm-project-${LLVM_VERSION}.src && mkdir -p build && cd build && \ | ||
cmake \ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DCMAKE_C_COMPILER=clang-16 \ | ||
-DCMAKE_C_FLAGS="-fno-omit-frame-pointer -D_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC=1" \ | ||
-DCMAKE_CXX_COMPILER=clang++-16 \ | ||
-DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -D_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC=1" \ | ||
-DLIBUNWIND_ENABLE_SHARED=OFF \ | ||
-DLIBUNWIND_ENABLE_STATIC=ON \ | ||
-DLIBUNWIND_USE_COMPILER_RT=ON \ | ||
-DLIBCXXABI_ENABLE_SHARED=ON \ | ||
-DLIBCXXABI_USE_LLVM_UNWINDER=ON \ | ||
-DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ | ||
-DLIBCXXABI_USE_COMPILER_RT=ON \ | ||
-DLIBCXX_ENABLE_SHARED=OFF \ | ||
-DLIBCXX_HAS_MUSL_LIBC=ON \ | ||
-DLIBCXX_USE_COMPILER_RT=ON \ | ||
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ | ||
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ | ||
-DLLVM_EXTERNAL_LIT=/usr/bin/lit ../runtimes && \ | ||
make -j$(nproc) install-unwind install | ||
|
||
RUN cd /usr/lib && ln -s gcc/*/*/ resource_dir | ||
RUN cd /usr/lib && ln -s clang/${LLVM_VERSION%%.*}/lib/linux/libclang_rt.builtins-*.a libclang_rt.builtins.a | ||
|
||
RUN rm -rf /llvm-project-${LLVM_VERSION}.src | ||
RUN rm -f llvm-project-${LLVM_VERSION}.src.tar.xz |
15 changes: 15 additions & 0 deletions
15
appsec/tests/integration/src/docker/toolchain/Dockerfile.bak
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM debian@sha256:e11072c1614c08bf88b543fcfe09d75a0426d90896408e926454e88078274fcb AS toolchain | ||
|
||
ARG LLVM_VERSION=16 | ||
ARG ARCH | ||
|
||
COPY . /build | ||
|
||
RUN echo "Building LLVM ${LLVM_VERSION} on ${ARCH}" | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y git wget lsb-release software-properties-common gnupg curl xz-utils make file lld patchelf gcc libgcc-s1 sed autoconf libssl-dev libxml2 cmake | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && \ | ||
chmod +x llvm.sh && \ | ||
./llvm.sh ${LLVM_VERSION} all |
This file contains 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
This file was deleted.
Oops, something went wrong.
32 changes: 22 additions & 10 deletions
32
appsec/tests/integration/src/docker/toolchain/locale.h.diff
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
-- locale.h | ||
+++ locale.h | ||
@@ -71,7 +71,7 @@ | ||
#define LC_COLLATE_MASK (1<<LC_COLLATE) | ||
#define LC_MONETARY_MASK (1<<LC_MONETARY) | ||
#define LC_MESSAGES_MASK (1<<LC_MESSAGES) | ||
-#define LC_ALL_MASK 0x7fffffff | ||
+#define LC_ALL_MASK 0x1fbf | ||
--- /usr/include/locale.h | ||
+++ /usr/include/locale.h | ||
@@ -157,19 +157,7 @@ | ||
# define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) | ||
# define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) | ||
# define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) | ||
-# define LC_ALL_MASK (LC_CTYPE_MASK \ | ||
- | LC_NUMERIC_MASK \ | ||
- | LC_TIME_MASK \ | ||
- | LC_COLLATE_MASK \ | ||
- | LC_MONETARY_MASK \ | ||
- | LC_MESSAGES_MASK \ | ||
- | LC_PAPER_MASK \ | ||
- | LC_NAME_MASK \ | ||
- | LC_ADDRESS_MASK \ | ||
- | LC_TELEPHONE_MASK \ | ||
- | LC_MEASUREMENT_MASK \ | ||
- | LC_IDENTIFICATION_MASK \ | ||
- ) | ||
+# define LC_ALL_MASK 0x1fbf | ||
|
||
locale_t duplocale(locale_t); | ||
void freelocale(locale_t); | ||
/* Return a duplicate of the set of locale in DATASET. All usage | ||
counters are increased if necessary. */ |
11 changes: 11 additions & 0 deletions
11
appsec/tests/integration/src/docker/toolchain/wchar.h.diff
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- /usr/include/wchar.h 2024-10-31 15:25:55.995768004 +0000 | ||
+++ /usr/include/wchar.h.fix 2024-10-31 15:25:35.478137009 +0000 | ||
@@ -485,7 +485,7 @@ | ||
int __base, locale_t __loc) __THROW; | ||
|
||
__extension__ | ||
-extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, | ||
+extern long long wcstoull_l (const wchar_t *__restrict __nptr, | ||
wchar_t **__restrict __endptr, | ||
int __base, locale_t __loc) | ||
__THROW; |