Bug 316034 - Building valgrind with gcc (4.7, trunk) fails on MacOS X 10.8
Summary: Building valgrind with gcc (4.7, trunk) fails on MacOS X 10.8
Status: RESOLVED UNMAINTAINED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0.SVN
Platform: Compiled Sources macOS
: NOR minor
Target Milestone: ---
Assignee: Rhys Kidd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-02 20:40 UTC by Dara Hazeghi
Modified: 2022-05-25 13:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dara Hazeghi 2013-03-02 20:40:32 UTC
Using FSF versions of gcc, SVN valgrind fails to build on MacOS X due to use of __private_extern__ which is not defined by the C compiler.

The following files are affected:
coregrind/m_syscall.c
coregrind/m_syswrap/syswrap-darwin.c
coregrind/vg_preloaded.c

The fix simple requires adding the appropriate define to the above files:
#define __private_extern__ extern

Reproducible: Always

Steps to Reproduce:
1. export CC=gcc-4.7
2. export CXX=gcc-4.7
3. ./configure
4. make
Actual Results:  
gcc-4.7 -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -DVGA_amd64=1 -DVGO_darwin=1 -DVGP_amd64_darwin=1 -DVGPV_amd64_darwin_vanilla=1 -I../coregrind -DVG_LIBDIR="\"/usr/local/lib/valgrind"\" -DVG_PLATFORM="\"amd64-darwin\""   -arch x86_64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -fno-builtin -mmacosx-version-min=10.5 -fno-stack-protector  -Wno-long-long  -Wwrite-strings -fno-stack-protector -MT libcoregrind_amd64_darwin_a-m_syscall.o -MD -MP -MF .deps/libcoregrind_amd64_darwin_a-m_syscall.Tpo -c -o libcoregrind_amd64_darwin_a-m_syscall.o `test -f 'm_syscall.c' || echo './'`m_syscall.c
m_syscall.c:536:1: error: unknown type name '__private_extern__'
m_syscall.c:537:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_unix_WRK'
m_syscall.c:560:1: error: unknown type name '__private_extern__'
m_syscall.c:561:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_mach_WRK'
Comment 1 Dara Hazeghi 2013-03-02 20:42:07 UTC
Whoops.  Step 2 should read: export CXX=g++4.7.
Comment 2 Julian Seward 2013-09-20 10:33:59 UTC
Yeah, but then doesn't that break compilation with the XCode-supplied
compilers?
Comment 3 Paul Floyd 2022-05-25 13:44:15 UTC
This is too old to fix now.