Detect ARM CPU version in configure
Instead of guessing the ARM CPU version to compile for from tcc.h, we now detect it in configure and output the value in config.h
This commit is contained in:
17
configure
vendored
17
configure
vendored
@ -51,7 +51,21 @@ case "$cpu" in
|
|||||||
x86_64)
|
x86_64)
|
||||||
cpu="x86-64"
|
cpu="x86-64"
|
||||||
;;
|
;;
|
||||||
arm|armv4l|armv5tel|armv5tejl|armv6j|armv6l|armv7a|armv7l)
|
arm*)
|
||||||
|
case "$cpu" in
|
||||||
|
arm|armv4l)
|
||||||
|
cpuver=4
|
||||||
|
;;
|
||||||
|
armv5tel|armv5tejl)
|
||||||
|
cpuver=5
|
||||||
|
;;
|
||||||
|
armv6j|armv6l)
|
||||||
|
cpuver=6
|
||||||
|
;;
|
||||||
|
armv7a|armv7l)
|
||||||
|
cpuver=7
|
||||||
|
;;
|
||||||
|
esac
|
||||||
cpu="armv4l"
|
cpu="armv4l"
|
||||||
;;
|
;;
|
||||||
alpha)
|
alpha)
|
||||||
@ -411,6 +425,7 @@ elif test "$cpu" = "x86-64" ; then
|
|||||||
elif test "$cpu" = "armv4l" ; then
|
elif test "$cpu" = "armv4l" ; then
|
||||||
echo "ARCH=arm" >> config.mak
|
echo "ARCH=arm" >> config.mak
|
||||||
echo "#define HOST_ARM 1" >> $TMPH
|
echo "#define HOST_ARM 1" >> $TMPH
|
||||||
|
echo "#define TCC_ARM_VERSION $cpuver" >> $TMPH
|
||||||
elif test "$cpu" = "powerpc" ; then
|
elif test "$cpu" = "powerpc" ; then
|
||||||
echo "ARCH=ppc" >> config.mak
|
echo "ARCH=ppc" >> config.mak
|
||||||
echo "#define HOST_PPC 1" >> $TMPH
|
echo "#define HOST_PPC 1" >> $TMPH
|
||||||
|
|||||||
8
tcc.h
8
tcc.h
@ -105,14 +105,6 @@
|
|||||||
#define TCC_TARGET_I386
|
#define TCC_TARGET_I386
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (TCC_TARGET_ARM) && !defined(TCC_ARM_VERSION)
|
|
||||||
#ifdef TCC_ARM_HARDFLOAT
|
|
||||||
#define TCC_ARM_VERSION 7
|
|
||||||
#else
|
|
||||||
#define TCC_ARM_VERSION 4
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \
|
#if !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \
|
||||||
!defined(TCC_TARGET_C67) && !defined(TCC_TARGET_X86_64)
|
!defined(TCC_TARGET_C67) && !defined(TCC_TARGET_X86_64)
|
||||||
#define CONFIG_TCC_BCHECK /* enable bound checking code */
|
#define CONFIG_TCC_BCHECK /* enable bound checking code */
|
||||||
|
|||||||
Reference in New Issue
Block a user