ICC Compiler. Patch mostly by Gregory Czajkowski <gregczajkowski@yahoo.com>.
Fixes BZ #339542.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14674
# This is very uggerly. Need to sed out both "xyzzyN" and
# "xyzzy$N" since gcc on different targets emits the constants
# differently -- with a leading $ on x86/amd64 but none on ppc32/64.
+# ICC also emits the constants differently with a leading # #define
pub/libvex_guest_offsets.h: auxprogs/genoffsets.c \
pub/libvex_basictypes.h \
pub/libvex_guest_x86.h \
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \
-O -S -o auxprogs/genoffsets.s \
$(srcdir)/auxprogs/genoffsets.c
- grep xyzzy auxprogs/genoffsets.s | grep "^#define" \
+ grep xyzzy auxprogs/genoffsets.s | grep "^[# ]*#define" \
+ | sed "s/# #define/#define/g" \
| sed "s/xyzzy\\$$//g" \
| sed "s/xyzzy#//g" \
| sed "s/xyzzy//g" \
339442 OS X 10.9 testsuite build failure: threadname.c:6:10:
fatal error: 'sys/prctl.h' file not found
-
+339542 Support compilation with Intel's ICC compiler
339688 Mac-specific ASM does not support .version directive (cpuid,
tronical and pushfpopf tests)
is_clang="clang"
# Don't use -dumpversion with clang: it will always produce "4.2.1".
gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
+elif test "x`${CC} --version | $SED -n -e 's/icc.+\(ICC\).*/\1/p'`" = "ICC" ; then
+ is_clang="icc"
+ gcc_version=`${CC} --version | $SED -n -e 's/icc.+\(ICC\).+([0-9.]+).*$/\1/p'`
else
is_clang="notclang"
gcc_version=`${CC} -dumpversion 2>/dev/null`
fi
]
AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm)
+AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc)
if test $is_clang = clang -o $is_clang = applellvm ; then
CFLAGS="$CFLAGS -Wno-tautological-compare -Wno-cast-align -Wno-self-assign"
applellvm-5.1|applellvm-6.0*)
AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})])
;;
+ icc-1[3-9]*)
+ AC_MSG_RESULT([ok (ICC version ${gcc_version})])
+ ;;
notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
AC_MSG_RESULT([ok (${gcc_version})])
;;
;;
*)
AC_MSG_RESULT([no (${gcc_version})])
- AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
+ AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0])
;;
esac
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
do { unsigned int h, l;
+ __asm__ __volatile__( "mulx %rax,%rcx,%r8" );
__asm__ __volatile__(
"andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
__asm__ __volatile__(
#include "config.h"
#include "pub_core_basics.h"
+#include "pub_core_libcbase.h"
#ifndef HAVE_BUILTIN_POPCOUT
}
#endif
+
+#ifdef __INTEL_COMPILER
+
+/* Provide certain functions Intel's ICC compiler expects to be defined. */
+
+void *
+_intel_fast_memcpy(void *dest, const void *src, SizeT sz)
+{
+ return VG_(memcpy)( dest, src, sz );
+}
+
+void *
+_intel_fast_memset(void *dest, int value, SizeT num)
+{
+ return VG_(memset)( dest, value, num );
+}
+#endif
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
dist_noinst_SCRIPTS = filter_stderr
check_PROGRAMS = \
- million rep_prefix ll fldcw_check complex_rep clone_test
+ million rep_prefix fldcw_check complex_rep clone_test
EXTRA_DIST = \
clone_test.stderr.exp \
clone_test_SOURCES = clone_test.S
complex_rep_SOURCES = complex_rep.S
fldcw_check_SOURCES = fldcw_check.S
-ll_SOURCES = ll.S
million_SOURCES = million.S
rep_prefix_SOURCES = rep_prefix.S
+# To compile the ll testcase, the compiler needs to support -Xassembler
+# ICC does not do that
+if !COMPILER_IS_ICC
+AM_CCASFLAGS += -Xassembler -I$(top_srcdir)/exp-bbv/tests
+check_PROGRAMS += ll
+ll_SOURCES = ll.S
+endif
prog: ll
+prereq: test -x ll
vgopts: --interval-size=1000 --bb-out-file=ll.out.bb
post: cat ll.out.bb
cleanup: rm ll.out.bb
endif
endif
if BUILD_AVX2_TESTS
+if !COMPILER_IS_ICC
check_PROGRAMS += avx2-1
endif
+endif
if BUILD_TSX_TESTS
check_PROGRAMS += tm1 xacq_xrel
endif