LouisBrunner / valgrind-macos

A valgrind mirror with latest macOS support
GNU General Public License v2.0
1.14k stars 58 forks source link

Unable to compile on 10.14.6 #68

Closed Conobi closed 1 year ago

Conobi commented 1 year ago

Context

What went wrong?

I tried to compile on Mojave 10.14.6, but I wasn't able to, the compilation at step 03. Here is the log:

clang -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -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/conobi/homebrew/Cellar/valgrind/HEAD-51562f9/libexec/valgrind"\" -DVG_PLATFORM="\"amd64-darwin\""    -arch x86_64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wenum-conversion -finline-functions -fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align -Wno-self-assign -Wno-tautological-compare  -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -mmacosx-version-min=10.6   -c -o m_syswrap/libcoregrind_amd64_darwin_a-syswrap-mips64-linux.o `test -f 'm_syswrap/syswrap-mips64-linux.c' || echo './'`m_syswrap/syswrap-mips64-linux.c
m_syswrap/syswrap-darwin.c:11575:4: error: use of undeclared identifier 'vgSysWrap_darwin_mkdirat_before'; did you mean 'vgSysWrap_darwin_mkfifo_before'?
   MACX_(__NR_mkdirat,             mkdirat),            // 475
   ^
m_syswrap/syswrap-darwin.c:11023:12: note: expanded from macro 'MACX_'
           WRAPPER_ENTRY_X_(darwin, VG_DARWIN_SYSNO_INDEX(sysno), name)
           ^
m_syswrap/priv_types_n_macros.h:315:16: note: expanded from macro 'WRAPPER_ENTRY_X_'
   [sysno] = { vgSysWrap_##auxstr##_##name##_before, NULL }
               ^
<scratch space>:96:1: note: expanded from here
vgSysWrap_darwin_mkdirat_before
^
m_syswrap/syswrap-darwin.c:3824:1: note: 'vgSysWrap_darwin_mkfifo_before' declared here
PRE(mkfifo)
^
m_syswrap/syswrap-darwin.c:1084:25: note: expanded from macro 'PRE'
#define PRE(name)       DEFN_PRE_TEMPLATE(darwin, name)
                        ^
m_syswrap/priv_types_n_macros.h:273:9: note: expanded from macro 'DEFN_PRE_TEMPLATE'
   void vgSysWrap_##auxstr##_##name##_before                     \
        ^
<scratch space>:183:1: note: expanded from here
vgSysWrap_darwin_mkfifo_before
^
clang -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -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/conobi/homebrew/Cellar/valgrind/HEAD-51562f9/libexec/valgrind"\" -DVG_PLATFORM="\"amd64-darwin\""    -arch x86_64 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers -Wenum-conversion -finline-functions -fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align -Wno-self-assign -Wno-tautological-compare  -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -mmacosx-version-min=10.6   -c -o m_syswrap/libcoregrind_amd64_darwin_a-syswrap-nanomips-linux.o `test -f 'm_syswrap/syswrap-nanomips-linux.c' || echo './'`m_syswrap/syswrap-nanomips-linux.c
1 error generated.
make[3]: *** [m_syswrap/libcoregrind_amd64_darwin_a-syswrap-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

HOMEBREW_VERSION: 3.6.18
ORIGIN: https://github.com/Homebrew/brew
HEAD: 106af035578d5f8716ae9510c1f9ad8c19f73a79
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 87ffaf4937410aa0af8de7c967583ed05e13a2d4
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /Users/conobi/homebrew
HOMEBREW_REPOSITORY: /Users/conobi/homebrew
HOMEBREW_CELLAR: /Users/conobi/homebrew/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.OjO5GjMCv8/org.xquartz:0
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_BOOTSNAP: set
Homebrew Ruby: 2.6.8 => /Users/conobi/homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: quad-core 64-bit kabylake
Clang: 11.0.0 build 1100
Git: 2.21.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.14.6-x86_64
CLT: 11.3.1.0.1.1576735732
Xcode: 11.3.1

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /Users/conobi/homebrew
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libxml2:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/Users/conobi/homebrew/Library/Homebrew/os/mac/pkgconfig/10.14
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
ACLOCAL_PATH: /Users/conobi/homebrew/share/aclocal
PATH: /Users/conobi/homebrew/Library/Homebrew/shims/mac/super:/Users/conobi/homebrew/opt/autoconf/bin:/Users/conobi/homebrew/opt/automake/bin:/Users/conobi/homebrew/opt/libtool/bin:/usr/bin:/bin:/usr/sbin:/sbin

Information

I know it is an old version of MacOS, but the iMac is (not) updated by my school. That also explains why my brew_prefix is in my home directory. By the way, it was working for months on this setup, it is broken now that I updated with homebrew!

LouisBrunner commented 1 year ago

Hello @Donokami,

Sorry about that, I just pushed a fix to main, hopefully it should clear up this issue!

Feel free to reopen this if you have any other problem.

Conobi commented 1 year ago

Thanks a lot for the fast fix, it now compiles like a charm!

Conobi commented 1 year ago

My bad. Even if valgrind compiled, now it is broken:

❯ valgrind /bin/ls
==84633== Memcheck, a memory error detector
==84633== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==84633== Using Valgrind-3.21.0.GIT-lbmacos and LibVEX; rerun with -h for copyright info
==84633== Command: /bin/ls
==84633==

valgrind: m_main.c:1881 (Int valgrind_main(Int, HChar **, HChar **)): Assertion 'change_ownership_v_c_OK' failed.
[1]    84633 segmentation fault  valgrind /bin/ls

I have this same message for any program I try to debug with valgrind!

LouisBrunner commented 1 year ago

Arf, the CI has been failing with this for a few commits and I was hoping it was some kind of GitHub Actions intricacy.

As it happened with #44, I will be looking at those together. It's tricky for me to test as it doesn't happen on macOS 13, only 10.15-11 (with a different error on 12).

I will keep you updated.

LouisBrunner commented 1 year ago

The CI is passing again so the issue should be fixed for you as well.