mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-04 06:30:10 +08:00
Several multiarch/biarch fixes
* Add multiarch directories for arm and i386 * Fix detection of biarch: /lib64/ld-linux-x86-64.so.2 is mandated by ABI and is thus always present, even if there is no biarch * Define CONFIG_LDDIR directly with the right value in case of multiarch instead of defining it to /lib and then redifining it.
This commit is contained in:
parent
a2c71af1ea
commit
b56edc7b90
6
Makefile
6
Makefile
@ -37,13 +37,14 @@ endif
|
|||||||
|
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
NATIVE_DEFINES=-DTCC_TARGET_I386
|
NATIVE_DEFINES=-DTCC_TARGET_I386
|
||||||
|
NATIVE_DEFINES+=$(if $(wildcard /lib/i386-linux-gnu),-DCONFIG_MULTIARCHDIR=\"i386-linux-gnu\")
|
||||||
CFLAGS+=-m32
|
CFLAGS+=-m32
|
||||||
else
|
else
|
||||||
ifeq ($(ARCH),x86-64)
|
ifeq ($(ARCH),x86-64)
|
||||||
NATIVE_DEFINES=-DTCC_TARGET_X86_64
|
NATIVE_DEFINES=-DTCC_TARGET_X86_64
|
||||||
CFLAGS+=-m64
|
CFLAGS+=-m64
|
||||||
NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DCONFIG_LDDIR=\"lib64\")
|
NATIVE_DEFINES+=$(if $(wildcard /usr/lib64),-DCONFIG_LDDIR=\"lib64\")
|
||||||
NATIVE_DEFINES+=$(if $(wildcard /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2),-DCONFIG_MULTIARCHDIR=\"x86_64-linux-gnu\")
|
NATIVE_DEFINES+=$(if $(wildcard /lib/x86_64-linux-gnu),-DCONFIG_MULTIARCHDIR=\"x86_64-linux-gnu\")
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ ifeq ($(ARCH),arm)
|
|||||||
NATIVE_DEFINES=-DTCC_TARGET_ARM
|
NATIVE_DEFINES=-DTCC_TARGET_ARM
|
||||||
NATIVE_DEFINES+=-DWITHOUT_LIBTCC
|
NATIVE_DEFINES+=-DWITHOUT_LIBTCC
|
||||||
NATIVE_DEFINES+=$(if $(wildcard /lib/ld-linux.so.3),-DTCC_ARM_EABI)
|
NATIVE_DEFINES+=$(if $(wildcard /lib/ld-linux.so.3),-DTCC_ARM_EABI)
|
||||||
|
NATIVE_DEFINES+=$(if $(wildcard /lib/arm-linux-gnueabi),-DCONFIG_MULTIARCHDIR=\"arm-linux-gnueabi\")
|
||||||
NATIVE_DEFINES+=$(if $(shell grep -l "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo),-DTCC_ARM_VFP)
|
NATIVE_DEFINES+=$(if $(shell grep -l "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo),-DTCC_ARM_VFP)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
9
tcc.h
9
tcc.h
@ -152,13 +152,12 @@
|
|||||||
# define CONFIG_SYSROOT ""
|
# define CONFIG_SYSROOT ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_LDDIR
|
#ifdef CONFIG_MULTIARCHDIR
|
||||||
# define CONFIG_LDDIR "lib"
|
# define CONFIG_LDDIR "lib/" CONFIG_MULTIARCHDIR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MULTIARCHDIR
|
#ifndef CONFIG_LDDIR
|
||||||
# undef CONFIG_LDDIR
|
# define CONFIG_LDDIR "lib"
|
||||||
# define CONFIG_LDDIR "lib/" CONFIG_MULTIARCHDIR
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* path to find crt1.o, crti.o and crtn.o */
|
/* path to find crt1.o, crti.o and crtn.o */
|
||||||
|
Loading…
Reference in New Issue
Block a user