]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a few feature tests to configure.ac because clang does not
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 4 Oct 2013 11:35:50 +0000 (11:35 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 4 Oct 2013 11:35:50 +0000 (11:35 +0000)
understand the following:
- nested functions
- -gstabs option
- loopnel instruction
- addr32 in asm statements
- 'p' constraint in asm statements

Adapt Makefiles accordingly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13615

configure.ac
memcheck/tests/Makefile.am
memcheck/tests/amd64/Makefile.am
none/tests/Makefile.am
none/tests/amd64/Makefile.am

index 0223ee2075adadbe05c9d238e1c4ab525bb95360..6fc3f1d4f6cfbfc2ec32b9364517de4b3f6b9cb7 100644 (file)
@@ -1715,6 +1715,59 @@ AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
 CFLAGS=$safe_CFLAGS
 
 
+# does this compiler support -gstabs ?
+
+AC_MSG_CHECKING([if gcc accepts -gstabs])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-gstabs"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  return 0;
+]])], [
+ac_have_gstabs=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_gstabs=no
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+AM_CONDITIONAL([HAVE_GSTABS], [test x$ac_have_gstabs = xyes])
+
+
+# does this compiler support nested functions ?
+
+AC_MSG_CHECKING([if gcc accepts nested functions])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  int foo() { return 1; }
+  return foo();
+]])], [
+ac_have_nested_functions=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_nested_functions=no
+AC_MSG_RESULT([no])
+])
+AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes])
+
+
+# does this compiler support the 'p' constraint in ASM statements ?
+
+AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+   char *p;
+   __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p));
+]])], [
+ac_have_asm_constraint_p=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_asm_constraint_p=no
+AC_MSG_RESULT([no])
+])
+AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes])
+
+
 # We want to use use the -Ttext-segment option to the linker.
 # GNU (bfd) ld supports this directly. Newer GNU gold linkers
 # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
@@ -1929,6 +1982,46 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
 
 
+# does the x86/amd64 assembler understand the LOOPNEL instruction?
+# Note, this doesn't generate a C-level symbol.  It generates a
+# automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel'])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  do {                  
+      __asm__ __volatile__("1:  loopnel 1b\n");
+  } while (0)
+]])], [
+  ac_have_as_loopnel=yes
+  AC_MSG_RESULT([yes])
+], [
+  ac_have_as_loopnel=no
+  AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes])
+
+
+# does the x86/amd64 assembler understand ADDR32 ?
+# Note, this doesn't generate a C-level symbol.  It generates a
+# automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32'])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  do {                  
+      asm volatile ("addr32 rep movsb");
+  } while (0)
+]])], [
+  ac_have_as_addr32=yes
+  AC_MSG_RESULT([yes])
+], [
+  ac_have_as_addr32=no
+  AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes])
+
+
 # does the x86/amd64 assembler understand SSE 4.2 instructions?
 # Note, this doesn't generate a C-level symbol.  It generates a
 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
index 555f2ac96c3543e771eb6601a6af47a065844ae8..7614e898578fecac54190b283ad05479be748fd5 100644 (file)
@@ -287,7 +287,6 @@ check_PROGRAMS = \
        custom_alloc \
        custom-overlap \
        deep-backtrace \
-       deep_templates \
        describe-block \
        doublefree error_counts errs1 exitprog execve1 execve2 erringfds \
        err_disable1 err_disable2 err_disable3 err_disable4 \
@@ -353,6 +352,10 @@ if HAVE_PTHREAD_SETNAME_NP
 check_PROGRAMS += threadname 
 endif
 
+if HAVE_GSTABS
+check_PROGRAMS += deep_templates
+endif
+
 AM_CFLAGS   += $(AM_FLAG_M3264_PRI)
 AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
 
index 513ce64d46261a8a6e739485c2f7a8582606f121..6b37fe1dc4da8593fc865e96668e12034e51b0d6 100644 (file)
@@ -40,7 +40,6 @@ check_PROGRAMS = \
        bug279698 \
        fxsave-amd64 \
        insn-bsfl \
-       insn-pcmpistri \
        insn-pmovmskb \
        more_x87_fp \
        sh-mem-vec128 \
@@ -49,6 +48,9 @@ check_PROGRAMS = \
 if BUILD_AVX_TESTS
  check_PROGRAMS += sh-mem-vec256
 endif
+if HAVE_ASM_CONSTRAINT_P
+ check_PROGRAMS += insn-pcmpistri
+endif
 
 AM_CFLAGS    += @FLAG_M64@
 AM_CXXFLAGS  += @FLAG_M64@
index e9c4fdb27ab0fbaad3ec9dbe913d95d01afa09c0..65689dc768d0b8015425ead79332ef0dec008d48 100644 (file)
@@ -186,7 +186,6 @@ check_PROGRAMS = \
        floored fork fucomip \
        mmap_fcntl_bug \
        munmap_exe map_unaligned map_unmap mq \
-       nestedfns \
        pending \
        procfs-cmdline-exe \
        pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
@@ -212,6 +211,10 @@ check_PROGRAMS = \
        gxx304 \
        process_vm_readv_writev
 
+if HAVE_NESTED_FUNCTIONS
+   check_PROGRAMS += nestedfns
+endif
+
 # DDD:
 # - manythreads and thread-exits have lots of this:
 # --61831:0:aspacem  sync_check_mapping_callback: segment mismatch:
index cc351b7b06a5c1f700f26e6b37469362c3917cf6..c7d63d46d26b4fe1192dfb25172abaf61d5c98d2 100644 (file)
@@ -85,7 +85,6 @@ EXTRA_DIST = \
 check_PROGRAMS = \
        allexec \
        amd64locked \
-       asorep \
        bug127521-64 bug132813-amd64 bug132918 \
        clc \
        cmpxchg \
@@ -97,6 +96,9 @@ check_PROGRAMS = \
        sbbmisc \
        nibz_bennee_mmap \
        xadd
+if BUILD_ADDR32_TESTS
+ check_PROGRAMS += asorep
+endif
 if BUILD_SSSE3_TESTS
  check_PROGRAMS += ssse3_misaligned
 endif
@@ -138,10 +140,12 @@ if ! VGCONF_OS_IS_DARWIN
        fcmovnu \
        fxtract \
        looper \
-       loopnel \
        jrcxz \
        shrld \
        slahf-amd64
+if BUILD_LOOPNEL_TESTS
+   check_PROGRAMS += loopnel
+endif
 endif
 
 AM_CFLAGS    += @FLAG_M64@