From: Tom Hughes Date: Fri, 11 Nov 2005 14:33:43 +0000 (+0000) Subject: Allow 32 bit x86 tests to run on amd64 machines. X-Git-Tag: svn/VALGRIND_3_1_0~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cc5ae14dbec552740b70e0abdca3338e3e58bf0;p=thirdparty%2Fvalgrind.git Allow 32 bit x86 tests to run on amd64 machines. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5087 --- diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index 480c0391d5..9ebfe9001c 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -1,4 +1,14 @@ -SUBDIRS = ${VG_ARCH} . +SUBDIRS = . +if VG_X86_LINUX +SUBDIRS += x86 +endif +if VG_AMD64_LINUX +SUBDIRS += amd64 +endif +if VG_PPC32_LINUX +SUBDIRS += ppc32 +endif + DIST_SUBDIRS = ${VG_ARCH_ALL} . noinst_SCRIPTS = filter_stderr filter_cachesim_discards diff --git a/cachegrind/tests/x86/Makefile.am b/cachegrind/tests/x86/Makefile.am index bc0031dc76..bc98f6a5ed 100644 --- a/cachegrind/tests/x86/Makefile.am +++ b/cachegrind/tests/x86/Makefile.am @@ -6,6 +6,6 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ check_PROGRAMS = \ fpu-28-108 -AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g +AM_CFLAGS = $(WERROR) @FLAG_M32@ -Winline -Wall -Wshadow -g fpu_28_108_SOURCES = fpu-28-108.S diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 3adf2523a1..99094ae648 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -1,4 +1,14 @@ -SUBDIRS = ${VG_ARCH} . +SUBDIRS = . +if VG_X86_LINUX +SUBDIRS += x86 +endif +if VG_AMD64_LINUX +SUBDIRS += amd64 +endif +if VG_PPC32_LINUX +SUBDIRS += ppc32 +endif + DIST_SUBDIRS = ${VG_ARCH_ALL} . noinst_SCRIPTS = filter_allocs filter_leak_check_size \ diff --git a/memcheck/tests/x86/Makefile.am b/memcheck/tests/x86/Makefile.am index 6a0e0f9af6..d70885170e 100644 --- a/memcheck/tests/x86/Makefile.am +++ b/memcheck/tests/x86/Makefile.am @@ -18,9 +18,10 @@ check_PROGRAMS = \ scalar_exit_group scalar_fork scalar_supp scalar_vfork \ fpeflags pushfpopf scalar tronical -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -AM_CXXFLAGS = $(AM_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CFLAGS = $(WERROR) @FLAG_M32@ -Winline -Wall -Wshadow -g +AM_CXXFLAGS = $(AM_CFLAGS) +AM_CCASFLAGS = @FLAG_M32@ # must be built with these flags -- bug only occurred with them fpeflags_CFLAGS = $(AM_CFLAGS) -march=i686 diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 4d91f6db16..ae1bb8aa11 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -1,4 +1,14 @@ -SUBDIRS = ${VG_ARCH} . +SUBDIRS = . +if VG_X86_LINUX +SUBDIRS += x86 +endif +if VG_AMD64_LINUX +SUBDIRS += amd64 +endif +if VG_PPC32_LINUX +SUBDIRS += ppc32 +endif + DIST_SUBDIRS = ${VG_ARCH_ALL} . noinst_SCRIPTS = \ diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am index 1af97badbf..cde65a2444 100644 --- a/none/tests/x86/Makefile.am +++ b/none/tests/x86/Makefile.am @@ -35,16 +35,16 @@ check_PROGRAMS = \ lahf looper int pushpopseg sbbmisc \ seg_override sigcontext smc1 yield -AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow \ - -g -I$(top_srcdir)/include \ +AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow \ + @FLAG_M32@ -g -I$(top_srcdir)/include \ $(FLAG_MMMX) $(FLAG_MSSE) - -AM_CXXFLAGS = $(AM_CFLAGS) +AM_CXXFLAGS = $(AM_CFLAGS) +AM_CCASFLAGS = @FLAG_M32@ # generic C ones cpuid_SOURCES = cpuid_c.c cpuid_s.s # fpu_lazy_eflags must use these flags -- the bug only occurred with them -fpu_lazy_eflags_CFLAGS = -O2 -march=pentiumpro +fpu_lazy_eflags_CFLAGS = @FLAG_M32@ -O2 -march=pentiumpro fxtract_LDADD = -lm insn_basic_SOURCES = insn_basic.def insn_basic_LDADD = -lm diff --git a/tests/cputest.c b/tests/cputest.c index 5db6b9d829..c724b3c945 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -21,16 +21,6 @@ char* all_archs[] = { NULL }; -#ifdef __x86_64__ -static Bool go(char* cpu) -{ - if ( strcmp( cpu, "amd64" ) == 0 ) - return True; - else - return False; -} -#endif // __x86_64__ - #ifdef __powerpc__ static Bool go(char* cpu) { @@ -41,7 +31,7 @@ static Bool go(char* cpu) } #endif // __powerpc__ -#ifdef __i386__ +#if defined(__i386__) || defined(__x86_64__) static void cpuid ( unsigned int n, unsigned int* a, unsigned int* b, unsigned int* c, unsigned int* d ) @@ -77,6 +67,10 @@ static Bool go(char* cpu) } else if ( strcmp( cpu, "x86-sse2" ) == 0 ) { level = 1; mask = 1 << 26; +#if defined(__x86_64__) + } else if ( strcmp( cpu, "amd64" ) == 0 ) { + return True; +#endif } else { return False; } @@ -90,7 +84,7 @@ static Bool go(char* cpu) } return False; } -#endif // __i386__ +#endif // __i386__ || __x86_64__ int main(int argc, char **argv)