Skip to content

Instantly share code, notes, and snippets.

@matu3ba
Created November 24, 2022 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matu3ba/c329387f5a8e8b66a73513020707642a to your computer and use it in GitHub Desktop.
Save matu3ba/c329387f5a8e8b66a73513020707642a to your computer and use it in GitHub Desktop.
zig-bootstrap + zig (for too old cmake version)
#!/usr/bin/env sh
# faster, but no stage1
/usr/bin/time -v "${HOME}/dev/git/bootstrap/zig-bootstrap/musl/out/zig-x86_64-linux-musl-native/bin/zig" build -p stage3 --search-prefix "${HOME}/dev/git/bootstrap/zig-bootstrap/musl/out/x86_64-linux-musl-native" --zig-lib-dir lib -Dstatic-llvm
# slower, but has stage1
mkdir -p build/ && cd build/ && cmake .. -DCMAKE_PREFIX_PATH="$HOME/dev/git/bootstrap/zig-bootstrap/musl/out/host/" -GNinja && /usr/bin/time -v ${HOME}/dev/git/cpp/mold/build/mold -run ninja install && cd ..
#!/usr/bin/env sh
set -e
# too old cmake version:
# install cmake:
# git clone https://github.com/Kitware/CMake
# git tag
# git checkout TAG
# cmake . -GNinja
# ninja
# checkout as bare repo:
cd project
mkdir worktreesfolder
cd worktreesfolder
git clone --bare gitrepo .bare
# make sure git knows where the gitdir is
echo "gitdir: ./.bare" > .git
git worktree add musl
cd musl
PATH="${HOME}/dev/git/cpp/CMake/bin:${PATH}"
CMAKE_GENERATOR=Ninja ./build x86_64-linux-musl native
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment