Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.97k stars 11.35k forks source link

valgrind failed to build on 10.8.2 #16599

Closed florianfunke closed 11 years ago

florianfunke commented 11 years ago
mercury:x foo$ brew install valgrind
==> Downloading http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/valgrind-3.8.1.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/valgrind/3.8.1 --enable-only64bit --build=amd64-darwin
==> make
make[3]: *** [valgrind-launcher-darwin.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

When running with --verbose, I get:

...
cc -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/Cellar/valgrind/3.8.1/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  -Wno-pointer-sign -fno-stack-protector -c -o valgrind-launcher-darwin.o `test -f 'launcher-darwin.c' || echo './'`launcher-darwin.c
brew: superenv removed: -I../coregrind -arch x86_64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -O -g -Wno-long-long -Wno-pointer-sign
brew: superenv removed: -I../coregrind -arch x86_64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -Wno-long-long -Wno-pointer-sign
launcher-darwin.c:62:6: error: use of undeclared identifier 'CPU_TYPE_X86'
   { CPU_TYPE_X86,       "i386",   "x86" }, 
     ^
launcher-darwin.c:68:38: error: invalid application of 'sizeof' to an incomplete type 'struct <anonymous struct at launcher-darwin.c:57:8> []'
static int valid_archs_count = sizeof(valid_archs)/sizeof(valid_archs[0]);
                                     ^~~~~~~~~~~~~
2 errors generated.
make[3]: *** [valgrind-launcher-darwin.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
==> Configuration
HOMEBREW_VERSION: 0.9.3
HEAD: 4085c0b476fdf10b33fe368eb263b74e4ff57b43
CPU: quad-core 64-bit arrandale
OS X: 10.8.2-x86_64
Xcode: 4.5.2
CLT: 4.5.0.0.1.1249367152
X11: 2.7.4 => /opt/X11
==> ENV
CC: cc
CXX: c++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/mountain_lion
ACLOCAL_PATH: /usr/local/share/aclocal
OBJC: cc
PATH: /usr/local/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin

Error: valgrind did not build
Logs:       /Users/foo/Library/Logs/Homebrew/valgrind/config.log

Full output: https://gist.github.com/4307949

The Doc just tells me that my "[...] system is raring to brew."

config.log: https://gist.github.com/4307917

samueljohn commented 11 years ago

Sorry, I can't reproduce on 8-core intel sandybridge. For me it builds. Perhaps someone with CPU: quad-core 64-bit arrandale, too, can try?

Looks like some CPU flags thing. Does it build when you brew install --verbose valgrind --env=std?

florianfunke commented 11 years ago

Thanks for getting back. I tried it again as you suggested, but the outcome is the same.

samueljohn commented 11 years ago

Can anybody reproduce this? I find it strange that the are some AMD defines in the posted excerpt. I don't have the time to check my build log.

sbeamer commented 11 years ago

I get a similar error and somehow mine is also seems to be going for AMD.

config & output https://gist.github.com/4615445

samueljohn commented 11 years ago

Does it help if you add --use-llvm to the build flags?

sbeamer commented 11 years ago

Yes. Thanks!

It built just fine on my core2 mbp.

adamv commented 11 years ago

Do we add fails_with :clang for 10.8 here?

samueljohn commented 11 years ago

No. I can successfully build valgrind on my system with clang:

brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 2fd984f7f503673acae9c7b37e030532e5e458dd
HOMEBREW_PREFIX: /homebrew
HOMEBREW_CELLAR: /homebrew/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.8.2-x86_64
Xcode: 4.6
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
adamv commented 11 years ago

The original bug report has 0.9.3 and is on Xcode 4.5. I'd suggest doing brew update and updating to Xcode 4.6 + newer CLT at least; not much we can do in the meanwhile I think.