Skip to content

haiku: get cmake bootstrap working#19572

Merged
andrewrk merged 11 commits intoziglang:masterfrom
jacobly0:haiku-bootstrap
Apr 9, 2024
Merged

haiku: get cmake bootstrap working#19572
andrewrk merged 11 commits intoziglang:masterfrom
jacobly0:haiku-bootstrap

Conversation

@jacobly0
Copy link
Member

@jacobly0 jacobly0 commented Apr 7, 2024

~> pkgman install zlib_devel cmake ninja mimalloc
~/llvm> cmake -GNinja -Sllvm -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/llvm/install -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_BUILD_LLVM_DYLIB=ON
~/llvm> cmake --build build
~/llvm> cmake --install build
~/zig> cmake -GNinja -S. -Bbuild -DCMAKE_PREFIX_PATH=$HOME/llvm/install -DZIG_NO_LIB=ON
~/zig> LD_PRELOAD=/system/lib/libmimalloc.so.2 cmake --build build
~/zig> cmake --install build
  • The llvm dylib option is to work around there not being a static stdc++ installed.
  • The mimalloc preload is to work around bugs in the system malloc impl.
  • Unfortunately, this still produces a final executable with 3 invalid relocations, for which I'm currently blaming lld (both because lld is emitting the incorrect relocation and because the source code being linked to use the wrong relocation is also the lld source code). fixed
  • -fno-lld does not work, probably the same issue as the previous fixed one. Partially fixed, hello world works, but still a linking issues with tests.
  • Zig threadlocal variables do not work, defaulting to single threaded for now.

Closes #19485

@jacobly0 jacobly0 marked this pull request as draft April 8, 2024 02:05
@jacobly0 jacobly0 marked this pull request as ready for review April 8, 2024 03:18
@jacobly0 jacobly0 changed the title haiku: get cmake bootstrap to produce an executable haiku: get cmake bootstrap working Apr 8, 2024
@jacobly0 jacobly0 requested a review from Snektron as a code owner April 8, 2024 17:10
@andrewrk andrewrk merged commit ac21ade into ziglang:master Apr 9, 2024
@jacobly0 jacobly0 deleted the haiku-bootstrap branch April 9, 2024 11:04
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

Successfully merging this pull request may close these issues.

use after free in Value.toIpString

4 participants