http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602
Paulo César Pereira de Andrade <pcpa at mandriva dot com.br> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pcpa at mandriva dot com.br
--- Comment #14 from Paulo César Pereira de Andrade <pcpa at mandriva dot
com.br> 2011-11-25 19:22:09 UTC ---
In a first try on updating to valgrind 3.7.0 I run into this:
make[3]: Entering directory `/home/pcpa/rpm/BUILD/valgrind-3.7.0/coregrind'
x86_64-mandriva-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include
-I../VEX/pub -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1
-DVGPV_x86_linux_vanilla=1 -I../coregrind -DVG_LIBDIR="\"/usr/lib64/valgrind"\"
-DVG_PLATFORM="\"x86-linux\"" -m32 -O2 -g -Wall -Wmissing-prototypes -Wshadow
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
-Wno-format-zero-length -fno-strict-aliasing -fno-builtin -Wno-long-long -O2 -g
-frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fPIC -Wno-pointer-sign -fno-stack-protector -MT
libcoregrind_x86_linux_a-syswrap-linux.o -MD -MP -MF
.deps/libcoregrind_x86_linux_a-syswrap-linux.Tpo -c -o
libcoregrind_x86_linux_a-syswrap-linux.o `test -f 'm_syswrap/syswrap-linux.c'
|| echo './'`m_syswrap/syswrap-linux.c
m_syswrap/syswrap-linux.c: In function 'run_a_thread_NORETURN':
m_syswrap/syswrap-linux.c:202:7: error: PIC register clobbered by 'ebx' in
'asm'
make[3]: *** [libcoregrind_x86_linux_a-syswrap-linux.o] Error 1
The code is like this:
static void run_a_thread_NORETURN ( Word tidW )
[...]
/* We have to use this sequence to terminate the thread to
prevent a subtle race. If VG_(exit_thread)() had left the
ThreadState as Empty, then it could have been reallocated,
reusing the stack while we're doing these last cleanups.
Instead, VG_(exit_thread) leaves it as Zombie to prevent
reallocation. We need to make sure we don't touch the stack
between marking it Empty and exiting. Hence the
assembler. */
#if defined(VGP_x86_linux)
asm volatile (
"movl %1, %0\n" /* set tst->status = VgTs_Empty */
"movl %2, %%eax\n" /* set %eax = __NR_exit */
"movl %3, %%ebx\n" /* set %ebx = tst->os_state.exitcode */
"int $0x80\n" /* exit(tst->os_state.exitcode) */
: "=m" (tst->status)
: "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
: "eax", "ebx"
);
#elif defined(VGP_amd64_linux)
In valgrind 3.6.1 it works because it does not tell about the clobbered
registers.