tyrael9 / valgrind-ios

Valgrind on ARM/Darwin (a.k.a iOS)
GNU General Public License v2.0
20 stars 5 forks source link

Compile error: No rule to make target `/usr/include/mach/mach_vm.defs' #3

Open goodpaperman opened 3 months ago

goodpaperman commented 3 months ago

build on MacOS 14.5:

5k@5kdeMac-mini valgrind-ios % make
echo "# This is a generated file, composed of the following suppression rules:" > default.supp
echo "# " exp-sgcheck.supp xfree-3.supp xfree-4.supp  >> default.supp
cat exp-sgcheck.supp xfree-3.supp xfree-4.supp >> default.supp
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in include
make[2]: Nothing to be done for `all'.
Making all in VEX
rm -f auxprogs/genoffsets.s
/opt/homebrew/bin/gmkdir -p auxprogs pub
gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk  -no-integrated-as \
          -Wbad-function-cast -fstrict-aliasing \
           -arch armv7 -O2 -g -std=gnu99 -Wall -Wcast-align -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wcast-qual -Wwrite-strings -Wformat -Wformat-security -Wignored-qualifiers -Wmissing-parameter-type -Wold-style-declaration -fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align -Wno-self-assign -Wno-tautological-compare -mno-thumb -ffixed-r9 -mios-version-min=7.0 -fno-stack-protector \
                -O -S -o auxprogs/genoffsets.s \
                     ./auxprogs/genoffsets.c
warning: unknown warning option '-Wmissing-parameter-type' [-Wunknown-warning-option]
warning: unknown warning option '-Wold-style-declaration'; did you mean '-Wout-of-line-declaration'? [-Wunknown-warning-option]
2 warnings generated.
grep xyzzy auxprogs/genoffsets.s | grep "^[# ]*#define" \
       | sed "s/# #define/#define/g" \
       | sed "s/xyzzy\\$//g" \
       | sed "s/xyzzy#//g" \
       | sed "s/xyzzy//g" \
       > pub/libvex_guest_offsets.h
rm -f auxprogs/genoffsets.s
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_arm=1 -DVGO_darwin=1 -DVGP_arm_darwin=1 -DVGPV_arm_darwin_vanilla=1 -Ipriv -isysroot 
...
Making all in coregrind
make[2]: *** No rule to make target `/usr/include/mach/mach_vm.defs', needed by `m_mach/mach_vmUser.c'.  Stop.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
goodpaperman commented 3 months ago

I find that file under following paths:

5k@5kdeMac-mini valgrind-ios % find / -type f -name mach_vm.defs 2>/dev/null
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/mach/mach_vm.defs
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/mach_vm.defs
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/mach/mach_vm.defs
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/mach_vm.defs
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/mach/mach_vm.defs
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/mach_vm.defs
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/mach/mach_vm.defs
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/mach_vm.defs

I tried to do a soft link to that path, but failed with operation not permitted even with sudo

5k@5kdeMac-mini valgrind-ios % sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include /usr/include
Password:
ln: /usr/include: Operation not permitted