mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 12:59:21 +08:00
72be1dead4
This patch cleans up the auto configury mechanism used to select different implementations of memcpy for various architecture versions. The approach here is to remove the selection of memcpy within automake and instead use complimentary logic in memcpy-stub.c and memcpy.S to choose between the generic memcpy.c implemenation or one of the architecture specific memcpy*.S implemenations. Regressed for armv7-a armv5 armv8-a, correct selection of memcpy implementation by manual inspection of a test program built for these three architectures. This revised patch flips the remaining preprocessor logic in memcpy-stub.c to use ACLE defines as requested in the previous review and removes the now disused HAVE_ARMV7A and HAVE_ARMV8A configure.in support.
93 lines
2.2 KiB
Plaintext
93 lines
2.2 KiB
Plaintext
dnl This is the newlib/libc/machine/arm configure.in file.
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ(2.59)
|
|
AC_INIT([newlib],[NEWLIB_VERSION])
|
|
AC_CONFIG_SRCDIR([Makefile.am])
|
|
|
|
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
|
|
AC_CONFIG_AUX_DIR(../../../..)
|
|
|
|
NEWLIB_CONFIGURE(../../..)
|
|
|
|
dnl Check for Thumb1 supported.
|
|
AC_CACHE_CHECK(whether we are using thumb1,
|
|
acnewlib_cv_thumb1_processor, [dnl
|
|
cat > conftest.c <<EOF
|
|
|
|
#if defined (__thumb__) && !defined (__thumb2__)
|
|
#define _THUMB1
|
|
#else
|
|
#error "not thumb1"
|
|
#endif
|
|
int main () {
|
|
return 0;
|
|
}
|
|
EOF
|
|
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
|
|
1>&AS_MESSAGE_LOG_FD])
|
|
then
|
|
acnewlib_cv_thumb1_processor=yes;
|
|
else
|
|
acnewlib_cv_thumb1_processor=no;
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
AM_CONDITIONAL(HAVE_THUMB1, test x"$acnewlib_cv_thumb1_processor" = x"yes")
|
|
|
|
dnl Check for whether the size is preferred.
|
|
AC_CACHE_CHECK(whether the size is preferred,
|
|
acnewlib_cv_opt_size, [dnl
|
|
cat > conftest.c <<EOF
|
|
|
|
#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)
|
|
#define OPT_SIZE
|
|
#else
|
|
#error "not need for size optimization."
|
|
#endif
|
|
int main () {
|
|
return 0;
|
|
}
|
|
EOF
|
|
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
|
|
1>&AS_MESSAGE_LOG_FD])
|
|
then
|
|
acnewlib_cv_opt_size=yes;
|
|
else
|
|
acnewlib_cv_opt_size=no;
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
AM_CONDITIONAL(OPT_SIZE, test x"$acnewlib_cv_opt_size" = x"yes")
|
|
|
|
dnl Check for whether ARM_7 or ARM_ARCH_6T2 is defined.
|
|
dnl This macro is used to support memchr() for old CPU.
|
|
AC_CACHE_CHECK(whether armv7 processor is supported,
|
|
acnewlib_cv_armv7_processor, [dnl
|
|
cat > conftest.c <<EOF
|
|
|
|
#if defined (_ISA_ARM_7) || defined (__ARM_ARCH_6T2__)
|
|
#define HAVE_ARMV7
|
|
#else
|
|
#error "ARMV7 is not supported."
|
|
#endif
|
|
int main () {
|
|
return 0;
|
|
}
|
|
EOF
|
|
if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c
|
|
1>&AS_MESSAGE_LOG_FD])
|
|
then
|
|
acnewlib_cv_armv7_processor=yes;
|
|
else
|
|
acnewlib_cv_armv7_processor=no;
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
AM_CONDITIONAL(HAVE_ARMV7, test x"$acnewlib_cv_armv7_processor" = x"yes")
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
AC_OUTPUT
|