From: Julian Seward Date: Tue, 27 Nov 2007 11:23:55 +0000 (+0000) Subject: Don't break the build on AIX5.3. X-Git-Tag: svn/VALGRIND_3_3_0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc96d0a97aeee73a46306fbaef04f76a936ecc37;p=thirdparty%2Fvalgrind.git Don't break the build on AIX5.3. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7240 --- diff --git a/helgrind/tests/tc07_hbl1.c b/helgrind/tests/tc07_hbl1.c index 58e6564cd7..12253aa21a 100644 --- a/helgrind/tests/tc07_hbl1.c +++ b/helgrind/tests/tc07_hbl1.c @@ -27,19 +27,19 @@ # define PLAT_ppc32_aix5 1 #endif - #if defined(PLAT_amd64_linux) || defined(PLAT_x86_linux) -# define INC(_lval) \ +# define INC(_lval,_lqual) \ __asm__ __volatile__ ( \ "lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" ) -#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) -# define INC(_lval) \ +#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \ + || defined(PLAT_ppc32_aix5) || defined(PLAT_ppc64_aix5) +# define INC(_lval,_lqual) \ __asm__ __volatile__( \ - "1:\n" \ + "L1xyzzy1" _lqual ":\n" \ " lwarx 15,0,%0\n" \ " addi 15,15,1\n" \ " stwcx. 15,0,%0\n" \ - " bne- 1b" \ + " bne- L1xyzzy1" _lqual \ : /*out*/ : /*in*/ "b"(&(_lval)) \ : /*trash*/ "r15", "cr0", "memory" \ ) @@ -52,7 +52,7 @@ int x = 0; void* child_fn ( void* arg ) { - INC(x); + INC(x, "childfn"); return NULL; } @@ -65,7 +65,7 @@ int main ( void ) exit(1); } - INC(x); + INC(x, "main"); if (pthread_join(child, NULL)) { perror("pthread join"); diff --git a/helgrind/tests/tc08_hbl2.c b/helgrind/tests/tc08_hbl2.c index 5362faae41..d67435ab5f 100644 --- a/helgrind/tests/tc08_hbl2.c +++ b/helgrind/tests/tc08_hbl2.c @@ -44,19 +44,19 @@ # define PLAT_ppc32_aix5 1 #endif - #if defined(PLAT_amd64_linux) || defined(PLAT_x86_linux) -# define INC(_lval) \ +# define INC(_lval,_lqual) \ __asm__ __volatile__ ( \ "lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" ) -#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) -# define INC(_lval) \ +#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \ + || defined(PLAT_ppc32_aix5) || defined(PLAT_ppc64_aix5) +# define INC(_lval,_lqual) \ __asm__ __volatile__( \ - "1:\n" \ + "L1xyzzy1" _lqual ":\n" \ " lwarx 15,0,%0\n" \ " addi 15,15,1\n" \ " stwcx. 15,0,%0\n" \ - " bne- 1b" \ + " bne- L1xyzzy1" _lqual \ : /*out*/ : /*in*/ "b"(&(_lval)) \ : /*trash*/ "r15", "cr0", "memory" \ ) @@ -102,7 +102,7 @@ int main ( void ) } for (i = 0; i < LIMIT; i++) { - INC(x); + INC(x, "main"); if (i == 5) sleep(1); /* make sure child doesn't starve */ } diff --git a/helgrind/tests/tc19_shadowmem.c b/helgrind/tests/tc19_shadowmem.c index d652fa928e..a56cec3bbf 100644 --- a/helgrind/tests/tc19_shadowmem.c +++ b/helgrind/tests/tc19_shadowmem.c @@ -2286,6 +2286,6 @@ void* steer ( void* infoV ) __asm__ __volatile__(""); if (wot == 999) return fn(info); __asm__ __volatile__(""); - assert(0); + return 0; /* keep gcc happy on AIX */ } diff --git a/helgrind/tests/tc20_verifywrap.c b/helgrind/tests/tc20_verifywrap.c index 81ea512bcf..0a1f7d6122 100644 --- a/helgrind/tests/tc20_verifywrap.c +++ b/helgrind/tests/tc20_verifywrap.c @@ -1,4 +1,3 @@ - /* This program attempts to verify that all functions that are supposed to be wrapped by tc_intercepts.c really are wrapped. The main way it does this is to cause failures in those functions, so @@ -12,7 +11,6 @@ otherwise "know" about some more exotic pthread stuff, in this case PTHREAD_MUTEX_ERRORCHECK. */ #define _GNU_SOURCE 1 - #include #include #include @@ -20,6 +18,8 @@ #include #include +#if !defined(_AIX) + #if !defined(__GLIBC_PREREQ) # error "This program needs __GLIBC_PREREQ (in /usr/include/features.h)" #endif @@ -260,3 +260,11 @@ int main ( void ) return 0; } + +#else /* defined(_AIX) */ +int main ( void ) +{ + fprintf(stderr, "This program does not work on AIX.\n"); + return 0; +} +#endif