Bug 363242

Summary: make error:"m_syscall.c:708:1: error: unknown type name ‘__private_extern__’"
Product: [Developer tools] valgrind Reporter: zocca.marco
Component: bbvAssignee: Rhys Kidd <rhyskidd>
Status: RESOLVED WORKSFORME    
Severity: major CC: marinus.savoritias, mh8928, rhyskidd
Priority: NOR    
Version: 3.11.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: macOS   
See Also: https://bugs.kde.org/show_bug.cgi?id=326724
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description zocca.marco 2016-05-18 22:55:08 UTC
`Make` fails to compile.
OSX 10.9.5 "Mavericks"


Reproducible: Always

Steps to Reproduce:
1. ./autogen.sh
2. ./configure --prefix=/usr/local
3. make

Actual Results:  
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -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 -std=gnu99 -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wold-style-declaration -fno-stack-protector -fno-strict-aliasing -fno-builtin  -mmacosx-version-min=10.5 -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:708:1: error: unknown type name ‘__private_extern__’
 __private_extern__ UWord 
 ^
m_syscall.c:709:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_syscall_unix_WRK’
 do_syscall_unix_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */
 ^
m_syscall.c:732:1: error: unknown type name ‘__private_extern__’
 __private_extern__ UWord 
 ^
m_syscall.c:733:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_syscall_mach_WRK’
 do_syscall_mach_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */
 ^
m_syscall.c: In function ‘vgPlain_do_syscall’:
m_syscall.c:1017:16: warning: implicit declaration of function ‘do_syscall_unix_WRK’ [-Wimplicit-function-declaration]
          wLO = do_syscall_unix_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
                ^
m_syscall.c:1022:16: warning: implicit declaration of function ‘do_syscall_mach_WRK’ [-Wimplicit-function-declaration]
          wLO = do_syscall_mach_WRK(a1,a2,a3,a4,a5,a6,a7,a8, 
                ^
make[3]: *** [libcoregrind_amd64_darwin_a-m_syscall.o] Error 1


$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Comment 1 Rhys Kidd 2016-05-27 20:30:59 UTC
Hello,
We've had reports of this build error when using old versions of Xcode. Refer https://bugs.kde.org/show_bug.cgi?id=326724

Based on your gcc version, you are likely using Xcode 5.0.1 or 5.0.2. Can you update to the latest version of Xcode supported by you OS X 10.9 system. I believe it will be Xcode Xcode 6.2.x (as Xcode 6.3+ requires OS X 10.10).

Once Xcode is updated, please also ensure that your Command Line Tools package is also updated - as it is packaged as a separate download from Xcode itself.

These steps should resolve the build issue with current Valgrind releases on OS X.

 Please let us know whether it works or does not, to benefit other users that might hit this issue in future.
Comment 2 Mark H 2016-10-20 18:57:05 UTC
I encounter the same error building valgrind-3.12.0.RC2, although in my case I have a newer GCC (GCC 6.2.0 from MacPorts).  That is what Valgrind's configure decided to use, since it was before the XCode version in PATH.

...
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_amd64=1 -DVGO_darwin=1 -DVGP_amd64_darwin=1 -DVGPV_amd64_darwin_vanilla=1 -I../coregrind -DVG_LIBDIR="\"/Users/markh/sw/valgrind-install/lib/valgrind"\" -DVG_PLATFORM="\"amd64-darwin\""   -arch x86_64 -O2 -g -std=gnu99 -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wold-style-declaration -fno-stack-protector -fno-strict-aliasing -fno-builtin  -mmacosx-version-min=10.6 -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:708:1: error: unknown type name '__private_extern__'
 __private_extern__ UWord
 ^~~~~~~~~~~~~~~~~~
m_syscall.c:709:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_unix_WRK'
 do_syscall_unix_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */
 ^~~~~~~~~~~~~~~~~~~
m_syscall.c:732:1: error: unknown type name '__private_extern__'
 __private_extern__ UWord
 ^~~~~~~~~~~~~~~~~~
m_syscall.c:733:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_mach_WRK'
 do_syscall_mach_WRK ( UWord a1, UWord a2, UWord a3, /* rdi, rsi, rdx */
 ^~~~~~~~~~~~~~~~~~~
m_syscall.c: In function 'vgPlain_do_syscall':
m_syscall.c:1017:16: warning: implicit declaration of function 'do_syscall_unix_WRK' [-Wimplicit-function-declaration]
          wLO = do_syscall_unix_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
                ^~~~~~~~~~~~~~~~~~~
m_syscall.c:1022:16: warning: implicit declaration of function 'do_syscall_mach_WRK' [-Wimplicit-function-declaration]
          wLO = do_syscall_mach_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
                ^~~~~~~~~~~~~~~~~~~
make[3]: *** [libcoregrind_amd64_darwin_a-m_syscall.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
valgrind-3.12.0.RC2$
valgrind-3.12.0.RC2$ which gcc
/opt/local/bin/gcc
valgrind-3.12.0.RC2$ gcc --version
gcc (MacPorts gcc6 6.2.0_1) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

valgrind-3.12.0.RC2$


If I explicitly configure with `CC=/usr/bin/gcc ./configure` to use the older GCC version from XCode then it builds successfully.
Comment 3 fbampaloukas 2019-06-16 13:52:37 UTC
Closing as Worksforme due to inactivity for more than 15 days as per:

https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging#Policies

Fanis
Comment 4 fbampaloukas 2019-06-16 13:57:55 UTC
Closing as Worksforme due to inactivity for more than 15 days as per:

https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging#Policies

Fanis