Debian Codegraph @

debian/patches/0004-Add-more-architectures-for-linux.patch

raw
1 From 46607257c03a791a016e4460924e6a1e4f0f306b Mon Sep 17 00:00:00 2001
2 From: yangfl <[email protected]>
3 Date: Fri, 9 Nov 2018 15:51:30 +0800
4 Subject: [PATCH 4/7] Add more architectures for linux
5
6 ---
7 configure.ac | 11 ++++++++++-
8 os/linux/ccconfig.h | 27 ++++++++++++++++++++++++++-
9 2 files changed, 36 insertions(+), 2 deletions(-)
10
11 diff --git a/configure.ac b/configure.ac
12 index f2a585be..8c5ab90e 100644
13 --- a/configure.ac
14 +++ b/configure.ac
15 @@ -115,11 +115,18 @@ case "$target_os" in
16 i?86) targmach=i386 ;;
17 powerpc*) targmach=powerpc endian=big ;;
18 x86_64) targmach=amd64 ;;
19 + hppa) targmach=hppa endian=big ;;
20 + m68k*) targmach=m68k endian=big ;;
21 mips64el) targmach=mips64 ;;
22 mips64) targmach=mips64 endian=big ;;
23 mipseb) targmach=mips endian=big ;;
24 mips*) targmach=mips ;;
25 + riscv64) targmach=riscv64 targmachdir=riscv ;;
26 + sparc64) targmach=sparc64 endian=big ;;
27 esac
28 + if test "X`dpkg-architecture -qDEB_TARGET_ARCH_ENDIAN 2>/dev/null`" = "Xbig"; then
29 + endian=big
30 + fi
31 case "$target_os" in
32 *-musl*) ADD_CPPFLAGS="$ADD_CPPFLAGS -DUSE_MUSL" ;;
33 esac
34 @@ -315,6 +322,9 @@ case "$host_os" in
35 linux*)
36 ADD_CPPFLAGS="$ADD_CPPFLAGS -D_BSD_SOURCE"
37 hostos=linux
38 + if test "X`dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null`" = "Xarmel"; then
39 + nativefp=no
40 + fi
41 ;;
42 litebsd*)
43 hostos=litebsd
44 @@ -522,7 +532,6 @@ fi
45 if test "X$native" = "Xyes" -o "X$target_alias" = "X$host_alias" -o "X$target_alias" = "X"; then
46 BINPREFIX=""
47 else
48 - BINPREFIX="${target_alias}-"
49 test "X$prefix" = XNONE && prefix="$ac_default_prefix"
50 test "X$exec_prefix" = XNONE && exec_prefix="${prefix}"
51 if test -z "$altincdir"; then
52 diff --git a/os/linux/ccconfig.h b/os/linux/ccconfig.h
53 index 206a2af4..6c7b0d60 100644
54 --- a/os/linux/ccconfig.h
55 +++ b/os/linux/ccconfig.h
56 @@ -44,9 +44,14 @@
57 #define CPPMDADD { "-D__i386__", NULL, }
58 #define DYNLINKLIB "/lib/ld-linux.so.2"
59 #define MUSL_DYLIB "/lib/ld-musl-i386.so.1"
60 +#elif defined(mach_arm)
61 +#define CPPMDADD { "-D__arm__", NULL, }
62 +#define DYNLINKLIB "/lib/ld-linux-armhf.so.3"
63 +#define MUSL_ROOT "/lib/ld-musl-arm"
64 +#define MUSL_HF "hf"
65 #elif defined(mach_powerpc)
66 #define CPPMDADD { "-D__ppc__", NULL, }
67 -#define DYNLINKLIB "/lib/ld-linux.so.2"
68 +#define DYNLINKLIB "/lib/ld.so.1"
69 #define MUSL_DYLIB "/lib/ld-musl-powerpc.so.1"
70 #elif defined(mach_amd64)
71 #include "../inc/amd64.h"
72 @@ -66,6 +71,26 @@
73 #elif defined(mach_aarch64)
74 #define CPPMDADD { "-D__aarch64__", NULL, }
75 #define MUSL_DYLIB "/lib/ld-musl-aarch64.so.1"
76 +#elif defined(mach_mips64)
77 +#ifdef TARGET_BIG_ENDIAN
78 +#define CPPMDADD { "-D__MIPSEB__", "-D__mips__", "-D__mips64__", "-D__LP64__", \
79 + "-D_LP64", NULL }
80 +#else
81 +#define CPPMDADD { "-D__MIPSEL__", "-D__mips__", "-D__mipsel__", \
82 + "-D__mips64__", "-D__mips64el__", "-D__LP64__", "-D_LP64", \
83 + NULL }
84 +#endif
85 +#define DYNLINKLIB "/lib64/ld.so.1"
86 +#define MUSL_ROOT "/lib/ld-musl-mips64"
87 +#define MUSL_EL "el"
88 +#elif defined(mach_sparc64)
89 +#define CPPMDADD { "-D__sparc64__", "-D__LP64__", "-D_LP64", NULL }
90 +#define DYNLINKLIB "/lib64/ld-linux.so.2"
91 +#define MUSL_DYLIB "/lib/ld-musl-sparc64.so.1"
92 +#elif defined(mach_m68k)
93 +#define CPPMDADD { "-D__mc68000__", "-D__mc68020__", "-D__m68k__", NULL, }
94 +#define DYNLINKLIB "/lib/ld.so.1"
95 +#define MUSL_DYLIB "/lib/ld-musl-m68k.so.1"
96 #else
97 #error defines for arch missing
98 #endif
99 --
100 2.50.1
101