Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building cheribsd-morello-purecap on macOS (Aarch64) #339

Closed
graymalkin opened this issue Jan 13, 2023 · 6 comments
Closed

Building cheribsd-morello-purecap on macOS (Aarch64) #339

graymalkin opened this issue Jan 13, 2023 · 6 comments

Comments

@graymalkin
Copy link
Contributor

Hello, I'm trying to build Morello for purecap on my M1 Mac and I'm having some difficulty with the install step:

./cheribuild.py -d cheribsd-morello-purecap
# ...
Running /Users/simon/cheri/cheribsd/tools/build/make.py buildkernel took 4.170472145080566 seconds
Installing cheribsd-morello-purecap (-morello-purecap) ... 
rm -rf /Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world
cd /Users/simon/cheri/cheribsd && env MAKEOBJDIRPREFIX=/Users/simon/cheri/build/cheribsd-morello-purecap-build CC=/usr/bin/clang CXX=/usr/bin/clang++ CPP=/usr/bin/cpp STRIPBIN=/usr/bin/strip XCC=/Users/simon/cheri/output/morello-sdk/bin/clang XCXX=/Users/simon/cheri/output/morello-sdk/bin/clang++ XCPP=/Users/simon/cheri/output/morello-sdk/bin/clang-cpp X_COMPILER_TYPE=clang XLD=/Users/simon/cheri/output/morello-sdk/bin/ld.lld DESTDIR=/Users/simon/cheri/output/rootfs-morello-purecap METALOG=/Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world nice /Users/simon/cheri/cheribsd/tools/build/make.py -j20 _build-metadata TARGET=arm64 TARGET_ARCH=aarch64c TARGET_CPUTYPE=morello -DWITH_CHERI -DDB_FROM_SRC -DI_REALLY_MEAN_NO_CLEAN -DNO_ROOT -DBUILD_WITH_STRICT_TMPPATH 'LOCAL_XTOOL_DIRS=lib/libnetbsd usr.sbin/makefs usr.bin/mkimg' XAR=/Users/simon/cheri/output/morello-sdk/bin/llvm-ar XNM=/Users/simon/cheri/output/morello-sdk/bin/llvm-nm XSIZE=/Users/simon/cheri/output/morello-sdk/bin/llvm-size XSTRIPBIN=/Users/simon/cheri/output/morello-sdk/bin/llvm-strip XSTRINGS=/Users/simon/cheri/output/morello-sdk/bin/llvm-strings XOBJCOPY=/Users/simon/cheri/output/morello-sdk/bin/llvm-objcopy XRANLIB=/Users/simon/cheri/output/morello-sdk/bin/llvm-ranlib -DNO_SAFE_LIBINSTALL -DWITHOUT_CLEAN -DWITH_TESTS -DWITH_CHERI -DWITHOUT_INIT_ALL_ZERO -DWITHOUT_INIT_ALL_PATTERN -DWITHOUT_MAN -DWITHOUT_MAIL -DWITHOUT_PROFILE -DWITHOUT_OFED -DWITH_MALLOC_PRODUCTION -DWITHOUT_GCC -DWITHOUT_CLANG -DWITHOUT_LLD -DWITHOUT_LLDB -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_LLD_BOOTSTRAP -DWITHOUT_LIB32 -DWITH_ELFTOOLCHAIN_BOOTSTRAP -DWITH_TOOLCHAIN -DWITHOUT_BINUTILS_BOOTSTRAP -s -de
bmake[1]: "/Users/simon/cheri/cheribsd/share/mk/bsd.linker.mk" line 84: warning: /Users/simon/cheri/cheribsd: Rerunning ld -v to compute LINKER_TYPE/LINKER_VERSION. This value should be cached!
bmake[1]: "/Users/simon/cheri/cheribsd/share/mk/bsd.linker.mk" line 84: warning: /Users/simon/cheri/cheribsd: Rerunning /Users/simon/cheri/output/morello-sdk/bin/ld.lld -v to compute X_LINKER_TYPE/X_LINKER_VERSION. This value should be cached!
>>> stage 3.1: recording build metadata
bmake[2]: "/Users/simon/cheri/cheribsd/share/mk/bsd.linker.mk" line 84: warning: /Users/simon/cheri/cheribsd: Rerunning /Users/simon/cheri/output/morello-sdk/bin/ld.lld -v to compute LINKER_TYPE/LINKER_VERSION. This value should be cached!
real	0m0.140s
user	0m0.048s
sys	0m0.064s
bmake[2]: "/Users/simon/cheri/cheribsd/share/mk/bsd.linker.mk" line 84: warning: /Users/simon/cheri/cheribsd: Rerunning /Users/simon/cheri/output/morello-sdk/bin/ld.lld -v to compute LINKER_TYPE/LINKER_VERSION. This value should be cached!
real	0m0.122s
user	0m0.045s
sys	0m0.050s
Running /Users/simon/cheri/cheribsd/tools/build/make.py _build-metadata took 0.5310451984405518 seconds
rm -f /Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world
cd /Users/simon/cheri/cheribsd && env MAKEOBJDIRPREFIX=/Users/simon/cheri/build/cheribsd-morello-purecap-build CC=/usr/bin/clang CXX=/usr/bin/clang++ CPP=/usr/bin/cpp STRIPBIN=/usr/bin/strip XCC=/Users/simon/cheri/output/morello-sdk/bin/clang XCXX=/Users/simon/cheri/output/morello-sdk/bin/clang++ XCPP=/Users/simon/cheri/output/morello-sdk/bin/clang-cpp X_COMPILER_TYPE=clang XLD=/Users/simon/cheri/output/morello-sdk/bin/ld.lld DESTDIR=/Users/simon/cheri/output/rootfs-morello-purecap METALOG=/Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world nice /Users/simon/cheri/cheribsd/tools/build/make.py -j20 installworld TARGET=arm64 TARGET_ARCH=aarch64c TARGET_CPUTYPE=morello -DWITH_CHERI -DDB_FROM_SRC -DI_REALLY_MEAN_NO_CLEAN -DNO_ROOT -DBUILD_WITH_STRICT_TMPPATH 'LOCAL_XTOOL_DIRS=lib/libnetbsd usr.sbin/makefs usr.bin/mkimg' XAR=/Users/simon/cheri/output/morello-sdk/bin/llvm-ar XNM=/Users/simon/cheri/output/morello-sdk/bin/llvm-nm XSIZE=/Users/simon/cheri/output/morello-sdk/bin/llvm-size XSTRIPBIN=/Users/simon/cheri/output/morello-sdk/bin/llvm-strip XSTRINGS=/Users/simon/cheri/output/morello-sdk/bin/llvm-strings XOBJCOPY=/Users/simon/cheri/output/morello-sdk/bin/llvm-objcopy XRANLIB=/Users/simon/cheri/output/morello-sdk/bin/llvm-ranlib -DNO_SAFE_LIBINSTALL -DWITHOUT_CLEAN -DWITH_TESTS -DWITH_CHERI -DWITHOUT_INIT_ALL_ZERO -DWITHOUT_INIT_ALL_PATTERN -DWITHOUT_MAN -DWITHOUT_MAIL -DWITHOUT_PROFILE -DWITHOUT_OFED -DWITH_MALLOC_PRODUCTION -DWITHOUT_GCC -DWITHOUT_CLANG -DWITHOUT_LLD -DWITHOUT_LLDB -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_LLD_BOOTSTRAP -DWITHOUT_LIB32 -DWITH_ELFTOOLCHAIN_BOOTSTRAP -DWITH_TOOLCHAIN -DWITHOUT_BINUTILS_BOOTSTRAP -s -de
bmake[1]: "/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at dhcp2976.kent.ac.uk on Fri 13 Jan 2023 15:51:31 GMT
Temporary directory /Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c is executable.
>>> Install check world
bmake[2]: "/Users/simon/cheri/cheribsd/Makefile.inc1" line 636: warning: "MAKEFLAGS= CPUTYPE=morello /Users/simon/cheri/build/cheribsd-morello-purecap-build/bmake-install/bin/bmake -f /dev/null  -m /Users/simon/cheri/cheribsd/share/mk MK_AUTO_OBJ=no -V CPUTYPE" exited on a signal
bmake[2]: "/Users/simon/cheri/cheribsd/Makefile.inc1" line 639: CPUTYPE global should be set with ?=. ( != morello)
bmake[2]: stopped in /Users/simon/cheri/cheribsd
--- installworld ---
*** Failed target: installworld
*** Failed commands:
	mkdir -p ${INSTALLTMP}
	=> mkdir -p /var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB
	progs=$$(for prog in ${ITOOLS}; do  if progpath=`env PATH=${TMPPATH} which $$prog`; then  echo $$progpath;  else  echo "Required tool $$prog not found in PATH ($$PATH)." >&2;  exit 1;  fi;  done);  if [ -z "${CROSSBUILD_HOST}" ] ; then  libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | grep -Ev '\[.*]' |  while read line; do  set -- $$line;  if [ "$$2 $$3" != "not found" ]; then  echo $$2;  else  echo "Required library $$1 not found." >&2;  exit 1;  fi;  done);  fi;  cp $$libs $$progs ${INSTALLTMP}
	=> progs=$(for prog in [ awk cap_mkdb cat chflags chmod chown cmp cp  date echo egrep find grep id install   ln make mkdir mtree mv pwd_mkdb  rm sed services_mkdb sh sort strip  test time true uname wc  zic tzsetup ; do  if progpath=`env PATH=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/libexec: which $prog`; then  echo $progpath;  else  echo "Required tool $prog not found in PATH ($PATH)." >&2;  exit 1;  fi;  done);  if [ -z "Darwin" ] ; then  libs=$(ldd -f "%o %p\n" -f "%o %p\n" $progs 2>/dev/null | sort -u | grep -Ev '\[.*]' |  while read line; do  set -- $line;  if [ "$2 $3" != "not found" ]; then  echo $2;  else  echo "Required library $1 not found." >&2;  exit 1;  fi;  done);  fi;  cp $libs $progs /var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB
	cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
	=> cp -R ${PATH_LOCALE:-"/usr/share/locale"} /var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB/locale
	-mkdir -p ${METALOG:H}
	=> -mkdir -p /Users/simon/cheri/output/rootfs-morello-purecap
	echo "#${MTREE_MAGIC}" > ${METALOG}
	=> echo "#mtree 2.0" > /Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world
	${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//};  ${IMAKEENV} rm -rf ${INSTALLTMP}
	=> +cd /Users/simon/cheri/cheribsd; time env MACHINE_ARCH=aarch64c  MACHINE=arm64  CPUTYPE=morello CC="/Users/simon/cheri/output/morello-sdk/bin/clang -target aarch64-unknown-freebsd14.0 --sysroot=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp -B/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin" CXX="/Users/simon/cheri/output/morello-sdk/bin/clang++  -target aarch64-unknown-freebsd14.0 --sysroot=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp -B/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin"  CPP="/Users/simon/cheri/output/morello-sdk/bin/clang-cpp -target aarch64-unknown-freebsd14.0 --sysroot=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp -B/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin"  AS="as" AR="/Users/simon/cheri/output/morello-sdk/bin/llvm-ar" ELFCTL="elfctl" LD="/Users/simon/cheri/output/morello-sdk/bin/ld.lld"  LLVM_LINK="" NM=/Users/simon/cheri/output/morello-sdk/bin/llvm-nm OBJCOPY="/Users/simon/cheri/output/morello-sdk/bin/llvm-objcopy"  RANLIB=/Users/simon/cheri/output/morello-sdk/bin/llvm-ranlib STRINGS=/Users/simon/cheri/output/morello-sdk/bin/llvm-strings  SIZE="/Users/simon/cheri/output/morello-sdk/bin/llvm-size" STRIPBIN="/Users/simon/cheri/output/morello-sdk/bin/llvm-strip" PATH=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/libexec::/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB  LD_LIBRARY_PATH=/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB  PATH_LOCALE=/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB/locale /Users/simon/cheri/build/cheribsd-morello-purecap-build/bmake-install/bin/bmake -f Makefile.inc1  INSTALL="install -N /Users/simon/cheri/cheribsd/etc -U -M /Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world -D /Users/simon/cheri/output/rootfs-morello-purecap" MTREE_CMD="mtree -N /Users/simon/cheri/cheribsd/etc -W" __MAKE_SHELL=/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB/sh -DNO_ROOT METALOG=/Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world reinstall;  MACHINE_ARCH=aarch64c  MACHINE=arm64  CPUTYPE=morello CC="/Users/simon/cheri/output/morello-sdk/bin/clang -target aarch64-unknown-freebsd14.0 --sysroot=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp -B/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin" CXX="/Users/simon/cheri/output/morello-sdk/bin/clang++  -target aarch64-unknown-freebsd14.0 --sysroot=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp -B/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin"  CPP="/Users/simon/cheri/output/morello-sdk/bin/clang-cpp -target aarch64-unknown-freebsd14.0 --sysroot=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp -B/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin"  AS="as" AR="/Users/simon/cheri/output/morello-sdk/bin/llvm-ar" ELFCTL="elfctl" LD="/Users/simon/cheri/output/morello-sdk/bin/ld.lld"  LLVM_LINK="" NM=/Users/simon/cheri/output/morello-sdk/bin/llvm-nm OBJCOPY="/Users/simon/cheri/output/morello-sdk/bin/llvm-objcopy"  RANLIB=/Users/simon/cheri/output/morello-sdk/bin/llvm-ranlib STRINGS=/Users/simon/cheri/output/morello-sdk/bin/llvm-strings  SIZE="/Users/simon/cheri/output/morello-sdk/bin/llvm-size" STRIPBIN="/Users/simon/cheri/output/morello-sdk/bin/llvm-strip" PATH=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/libexec::/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB  LD_LIBRARY_PATH=/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB  PATH_LOCALE=/var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB/locale rm -rf /var/folders/8t/rgz4zmyx3vl_1m1c1lwx40bc0000gn/T//install.FQOdEDHCIB
	@if which openssl>/dev/null; then  PATH=${TMPPATH}:${PATH}  sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} rehash  else  echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated.";  fi
	=> @if which openssl>/dev/null; then  PATH=/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/sbin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/bin:/Users/simon/cheri/build/cheribsd-morello-purecap-build/Users/simon/cheri/cheribsd/arm64.aarch64c/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin  sh /Users/simon/cheri/cheribsd/usr.sbin/certctl/certctl.sh -U -M /Users/simon/cheri/output/rootfs-morello-purecap/METALOG.world -D /Users/simon/cheri/output/rootfs-morello-purecap -D "/Users/simon/cheri/output/rootfs-morello-purecap" rehash  else  echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated.";  fi
*** [installworld] Error code 1
bmake[1]: stopped in /Users/simon/cheri/cheribsd
1 error
bmake[1]: stopped in /Users/simon/cheri/cheribsd
--- installworld ---
bmake: stopped in /Users/simon/cheri/cheribsd
Fatal error (in target cheribsd-morello-purecap): Command `nice /Users/simon/cheri/cheribsd/tools/build/make.py -j20 installworld TARGET=arm64 TARGET_ARCH=aarch64c TARGET_CPUTYPE=morello -DWITH_CHERI -DDB_FROM_SRC -DI_REALLY_MEAN_NO_CLEAN -DNO_ROOT -DBUILD_WITH_STRICT_TMPPATH 'LOCAL_XTOOL_DIRS=lib/libnetbsd usr.sbin/makefs usr.bin/mkimg' XAR=/Users/simon/cheri/output/morello-sdk/bin/llvm-ar XNM=/Users/simon/cheri/output/morello-sdk/bin/llvm-nm XSIZE=/Users/simon/cheri/output/morello-sdk/bin/llvm-size XSTRIPBIN=/Users/simon/cheri/output/morello-sdk/bin/llvm-strip XSTRINGS=/Users/simon/cheri/output/morello-sdk/bin/llvm-strings XOBJCOPY=/Users/simon/cheri/output/morello-sdk/bin/llvm-objcopy XRANLIB=/Users/simon/cheri/output/morello-sdk/bin/llvm-ranlib -DNO_SAFE_LIBINSTALL -DWITHOUT_CLEAN -DWITH_TESTS -DWITH_CHERI -DWITHOUT_INIT_ALL_ZERO -DWITHOUT_INIT_ALL_PATTERN -DWITHOUT_MAN -DWITHOUT_MAIL -DWITHOUT_PROFILE -DWITHOUT_OFED -DWITH_MALLOC_PRODUCTION -DWITHOUT_GCC -DWITHOUT_CLANG -DWITHOUT_LLD -DWITHOUT_LLDB -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_LLD_BOOTSTRAP -DWITHOUT_LIB32 -DWITH_ELFTOOLCHAIN_BOOTSTRAP -DWITH_TOOLCHAIN -DWITHOUT_BINUTILS_BOOTSTRAP -s -de` failed with non-zero exit code 2

I think this is the pertinent part of the log, let me know if you need more details.

@gcjenkinson
Copy link

Are you on Ventura (macOS 13) by any chance? This looks very similar to a problem I encountered, it's the result of a new launch constraints security feature preventing the copied binaries from running in the new locations. My recollection was that @arichardson had pushed a fixed for this. Otherwise disabling SIP should also work.

@jrtc27
Copy link
Member

jrtc27 commented Jan 13, 2023

I'm going to guess you've upgraded to Ventura. Supposedly https://theevilbit.github.io/posts/amfi_launch_constraints/ is breaking things and I have no idea what the right way to fix it is.

@graymalkin
Copy link
Contributor Author

graymalkin commented Jan 13, 2023

Edit: Yes I am on macOS Ventura.

Seems to still be broken, but I've disabled SIP following the Apple instructions here and now the build completes successfully 🥳 . Thanks for the pointer, I would not have found this workaround without help!

FWIW at the end of running this script I have the following output:

>>> Install check kernel
>>> Installing kernel GENERIC-MORELLO on Fri Jan 13 16:15:35 GMT 2023
/bin/sh: sysctl: command not found
WARNING: Ignoring chflags -R noschg /Users/simon/cheri/output/rootfs-morello-purecap/boot/kernel
>>> Installing kernel GENERIC-MORELLO completed on Fri Jan 13 16:15:46 GMT 2023
>>> Installing kernel GENERIC-MORELLO-PURECAP Fri Jan 13 16:15:46 GMT 2023
>>> Installing kernel GENERIC-MORELLO-PURECAP completed on Fri Jan 13 16:15:57 GMT 2023
Running /Users/simon/cheri/cheribsd/tools/build/make.py installkernel took 21.9645938873291 seconds
Built for target 'cheribsd-morello-purecap' in 98.22019672393799 seconds

sysctl: command not found is a little suspicious. Does this relate to @arichardson's fix?

@jrtc27
Copy link
Member

jrtc27 commented Jan 13, 2023

No

@Akilan1999
Copy link

I have a similar issue as well with the M2

Fatal error (in target cheribsd-morello-purecap): Command `nice /Users/akilan/cheri/cheribsd/tools/build/make.py -j8 buildworld TARGET=arm64 TARGET_ARCH=aarch64c TARGET_CPUTYPE=morello -DWITH_CHERI -DDB_FROM_SRC -DI_REALLY_MEAN_NO_CLEAN -DNO_ROOT -DBUILD_WITH_STRICT_TMPPATH 'LOCAL_XTOOL_DIRS=lib/libnetbsd usr.sbin/makefs usr.bin/mkimg' XAR=/Users/akilan/cheri/output/morello-sdk/bin/llvm-ar XNM=/Users/akilan/cheri/output/morello-sdk/bin/llvm-nm XSIZE=/Users/akilan/cheri/output/morello-sdk/bin/llvm-size XSTRIPBIN=/Users/akilan/cheri/output/morello-sdk/bin/llvm-strip XSTRINGS=/Users/akilan/cheri/output/morello-sdk/bin/llvm-strings XOBJCOPY=/Users/akilan/cheri/output/morello-sdk/bin/llvm-objcopy XRANLIB=/Users/akilan/cheri/output/morello-sdk/bin/llvm-ranlib -DWITHOUT_CLEAN -DWITH_TESTS -DWITH_CHERI -DWITHOUT_INIT_ALL_ZERO -DWITHOUT_INIT_ALL_PATTERN -DWITHOUT_MAN -DWITHOUT_MAIL -DWITHOUT_PROFILE -DWITHOUT_OFED -DWITH_MALLOC_PRODUCTION -DWITHOUT_GCC -DWITHOUT_CLANG -DWITHOUT_LLD -DWITHOUT_LLDB -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_LLD_BOOTSTRAP -DWITHOUT_LIB32 -DWITH_ELFTOOLCHAIN_BOOTSTRAP -DWITH_TOOLCHAIN -DWITHOUT_BINUTILS_BOOTSTRAP -s -de` failed with non-zero exit code 2

When I ran the command independently I got the following error

MAKEOBJDIRPREFIX is not set, cannot continue!

@jrtc27
Copy link
Member

jrtc27 commented Mar 3, 2023

Resolved by CTSRD-CHERI/cheribsd#1663 (you will need to make sure you build dev rather than main for now until the latter is updated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants