From 8ed49b833de82dd5f8cf4c010a37cf8d2dc0e4ea Mon Sep 17 00:00:00 2001 Message-Id: <8ed49b833de82dd5f8cf4c010a37cf8d2dc0e4ea.1714750436.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 5 Jul 2017 22:09:59 +0100 Subject: [PATCH] configure.ac: Check for some brain damage from Clang's assembler. Organization: Straylight/Edgeware From: Mark Wooding It doesn't understand `.arch' or the `adcd' instruction. I'm damned if I'm writing `dword ptr' everywhere, so Clang users will have to figure out some way to use Gas if they want the assembler code. --- configure.ac | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8c32c92a..bdc94be7 100644 --- a/configure.ac +++ b/configure.ac @@ -98,8 +98,8 @@ case $host_cpu,$host_os in *) CPUFAM=nil ABI=nil ;; esac -dnl Now check the assembler. We may have target-specific requirements here, -dnl so we couldn't do this any earlier. +dnl Now check the assembler. We have target-specific requirements here, so +dnl we couldn't do this any earlier. AC_CACHE_CHECK( [whether the assembler is likely to work], [mdw_cv_gnuish_as], [AC_LANG_PUSH([CPPAS]) @@ -113,6 +113,22 @@ AC_CACHE_CHECK( .extern bar mymac]])], [mdw_cv_gnuish_as=yes], [mdw_cv_gnuish_as=no]) + case $CPUFAM in + x86 | amd64) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + .text + .arch pentium4 + .intel_syntax noprefix + .globl foo +foo: + adcd var, 0 + ret + .data +var: .long 1 + ]])], + [:], [mdw_cv_gnuish_as=no]) + ;; + esac AC_LANG_POP([CPPAS])]) AM_CONDITIONAL([GNUISH_AS], [test $mdw_cv_gnuish_as = yes]) if test $mdw_cv_gnuish_as = no; then CPUFAM=nil ABI=nil; fi -- [mdw]