Description of problem:
On rhel5, the packages are build with -march=i386 by default, but this turns out to be very bad for valgrind. It seems like some gcc buildin is missing there. Rebuild with i486 fixed that for me. Not entirely sure why it works in brew.
Steps to Reproduce:
1. install dts valgrind srpm on rhel5 i386 machine
2. rpmbuild -ba /usr/src/redhat/SPECS/valgrind.spec
../coregrind/libcoregrind-x86-linux.a(libcoregrind_x86_linux_a-ticket-lock-linux.o): In function `release_sched_lock':
/usr/src/redhat/BUILD/valgrind-3.8.1/coregrind/m_scheduler/ticket-lock-linux.c:170: undefined reference to `__sync_fetch_and_add_4'
../coregrind/libcoregrind-x86-linux.a(libcoregrind_x86_linux_a-ticket-lock-linux.o): In function `acquire_sched_lock':
/usr/src/redhat/BUILD/valgrind-3.8.1/coregrind/m_scheduler/ticket-lock-linux.c:123: undefined reference to `__sync_fetch_and_add_4'
packages are build
Could you attach the full build log? Then we can see what configure detected. And we can compare with with the full build log in brew to see what that detected.
In particular it seems in your environment configure seems to think sync and fetch support is available while it really isn't (since it is i386). It should use alternative code that doesn't use sync and fetch.