From 46607257c03a791a016e4460924e6a1e4f0f306b Mon Sep 17 00:00:00 2001 From: yangfl Date: Fri, 9 Nov 2018 15:51:30 +0800 Subject: [PATCH 4/7] Add more architectures for linux --- configure.ac | 11 ++++++++++- os/linux/ccconfig.h | 27 ++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index f2a585be..8c5ab90e 100644 --- a/configure.ac +++ b/configure.ac @@ -115,11 +115,18 @@ case "$target_os" in i?86) targmach=i386 ;; powerpc*) targmach=powerpc endian=big ;; x86_64) targmach=amd64 ;; + hppa) targmach=hppa endian=big ;; + m68k*) targmach=m68k endian=big ;; mips64el) targmach=mips64 ;; mips64) targmach=mips64 endian=big ;; mipseb) targmach=mips endian=big ;; mips*) targmach=mips ;; + riscv64) targmach=riscv64 targmachdir=riscv ;; + sparc64) targmach=sparc64 endian=big ;; esac + if test "X`dpkg-architecture -qDEB_TARGET_ARCH_ENDIAN 2>/dev/null`" = "Xbig"; then + endian=big + fi case "$target_os" in *-musl*) ADD_CPPFLAGS="$ADD_CPPFLAGS -DUSE_MUSL" ;; esac @@ -315,6 +322,9 @@ case "$host_os" in linux*) ADD_CPPFLAGS="$ADD_CPPFLAGS -D_BSD_SOURCE" hostos=linux + if test "X`dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null`" = "Xarmel"; then + nativefp=no + fi ;; litebsd*) hostos=litebsd @@ -522,7 +532,6 @@ fi if test "X$native" = "Xyes" -o "X$target_alias" = "X$host_alias" -o "X$target_alias" = "X"; then BINPREFIX="" else - BINPREFIX="${target_alias}-" test "X$prefix" = XNONE && prefix="$ac_default_prefix" test "X$exec_prefix" = XNONE && exec_prefix="${prefix}" if test -z "$altincdir"; then diff --git a/os/linux/ccconfig.h b/os/linux/ccconfig.h index 206a2af4..6c7b0d60 100644 --- a/os/linux/ccconfig.h +++ b/os/linux/ccconfig.h @@ -44,9 +44,14 @@ #define CPPMDADD { "-D__i386__", NULL, } #define DYNLINKLIB "/lib/ld-linux.so.2" #define MUSL_DYLIB "/lib/ld-musl-i386.so.1" +#elif defined(mach_arm) +#define CPPMDADD { "-D__arm__", NULL, } +#define DYNLINKLIB "/lib/ld-linux-armhf.so.3" +#define MUSL_ROOT "/lib/ld-musl-arm" +#define MUSL_HF "hf" #elif defined(mach_powerpc) #define CPPMDADD { "-D__ppc__", NULL, } -#define DYNLINKLIB "/lib/ld-linux.so.2" +#define DYNLINKLIB "/lib/ld.so.1" #define MUSL_DYLIB "/lib/ld-musl-powerpc.so.1" #elif defined(mach_amd64) #include "../inc/amd64.h" @@ -66,6 +71,26 @@ #elif defined(mach_aarch64) #define CPPMDADD { "-D__aarch64__", NULL, } #define MUSL_DYLIB "/lib/ld-musl-aarch64.so.1" +#elif defined(mach_mips64) +#ifdef TARGET_BIG_ENDIAN +#define CPPMDADD { "-D__MIPSEB__", "-D__mips__", "-D__mips64__", "-D__LP64__", \ + "-D_LP64", NULL } +#else +#define CPPMDADD { "-D__MIPSEL__", "-D__mips__", "-D__mipsel__", \ + "-D__mips64__", "-D__mips64el__", "-D__LP64__", "-D_LP64", \ + NULL } +#endif +#define DYNLINKLIB "/lib64/ld.so.1" +#define MUSL_ROOT "/lib/ld-musl-mips64" +#define MUSL_EL "el" +#elif defined(mach_sparc64) +#define CPPMDADD { "-D__sparc64__", "-D__LP64__", "-D_LP64", NULL } +#define DYNLINKLIB "/lib64/ld-linux.so.2" +#define MUSL_DYLIB "/lib/ld-musl-sparc64.so.1" +#elif defined(mach_m68k) +#define CPPMDADD { "-D__mc68000__", "-D__mc68020__", "-D__m68k__", NULL, } +#define DYNLINKLIB "/lib/ld.so.1" +#define MUSL_DYLIB "/lib/ld-musl-m68k.so.1" #else #error defines for arch missing #endif -- 2.50.1