Skip to content

Commit 94e19df

Browse files
committed
crosscomp - add support for building bookwork arm cross compiler
Split out header include fix from bullseye.diff into own patch file as it's also needed on gcc 12.x. Apply patch for GCC versions greater than 10.
1 parent 00511fe commit 94e19df

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

scriptmodules/admin/crosscomp.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ function sources_crosscomp() {
6262
[mpc]=1.2.0
6363
)
6464
;;
65+
bookworm)
66+
pkgs=(
67+
[binutils]=2.40
68+
[gcc]=12.2.0
69+
[glibc]=2.36
70+
[gmp]=6.2.1
71+
[kernel]=6.1
72+
[mpfr]=4.2.0
73+
[mpc]=1.3.1
74+
)
75+
;;
6576
*)
6677
md_ret_errors+=("Unsupported distribution $dist")
6778
return 1
@@ -86,10 +97,14 @@ function sources_crosscomp() {
8697

8798
# apply glibc patch required when compiling with GCC 10+
8899
# see https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=49348beafe9ba150c9bd48595b3f372299bddbb0
89-
# as well as a fix for an incorrect header include.
90100
if [[ "$dist" == "bullseye" ]]; then
91101
applyPatch "$md_data/bullseye.diff"
92102
fi
103+
# fix incorrect limits.h include.
104+
if compareVersions "${pkgs[gcc]}" ge 10; then
105+
applyPatch "$md_data/asan_limits.diff"
106+
fi
107+
93108
}
94109

95110
function build_crosscomp() {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# fixes gcc/libsanitizer/asan/asan_linux.cpp:217:21: error: ‘PATH_MAX’ was not declared in this scope
2+
--- a/gcc/libsanitizer/asan/asan_linux.cpp
3+
+++ b/gcc/libsanitizer/asan/asan_linux.cpp
4+
@@ -31,7 +31,7 @@
5+
#include <sys/types.h>
6+
#include <dlfcn.h>
7+
#include <fcntl.h>
8+
-#include <limits.h>
9+
+#include <linux/limits.h>
10+
#include <pthread.h>
11+
#include <stdio.h>
12+
#include <unistd.h>

scriptmodules/admin/crosscomp/bullseye.diff

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,3 @@ index 84a8b94c74..0a5a40430e 100644
134134

135135
# These files quiet sNaNs in a way that is optimized away without
136136

137-
# fixes gcc/libsanitizer/asan/asan_linux.cpp:217:21: error: ‘PATH_MAX’ was not declared in this scope
138-
--- a/gcc/libsanitizer/asan/asan_linux.cpp
139-
+++ b/gcc/libsanitizer/asan/asan_linux.cpp
140-
@@ -31,7 +31,7 @@
141-
#include <sys/types.h>
142-
#include <dlfcn.h>
143-
#include <fcntl.h>
144-
-#include <limits.h>
145-
+#include <linux/limits.h>
146-
#include <pthread.h>
147-
#include <stdio.h>
148-
#include <unistd.h>

0 commit comments

Comments
 (0)