Skip to content

Commit

Permalink
override target
Browse files Browse the repository at this point in the history
The "-target native" argument causes Zig to call
detectAbiAndDynamicLinker() and determine the dynamic-linker from the
ELF data of `/usr/bin/env`. Problem is, `env` is a 32-bit executable,
and the zig binary is 64-bit.

One other person hit this same issue but in this case their
`/usr/bin/env` was a link to a statically built busybox, meaning there
was no interpreter to find.

ziglang#14577

The real fix is probably to just have detectAbiAndDynamicLinker() use
hard-coded defaults on the `solaris` tag. But for now I'm going to try
to make progress by setting the target explicitly.
  • Loading branch information
rzezeski committed Sep 1, 2023
1 parent b1d3a5e commit 1a5c1c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ else()
set(ZIG_USE_LLVM_CONFIG OFF CACHE BOOL "use llvm-config to find LLVM libraries")
endif()

set(ZIG_TARGET_TRIPLE "x86_64-solaris")
set(ZIG_USE_LLVM_CONFIG ON)


if(ZIG_AR_WORKAROUND)
string(REPLACE "<CMAKE_AR>" "<CMAKE_AR> ar" CMAKE_C_ARCHIVE_CREATE ${CMAKE_C_ARCHIVE_CREATE})
string(REPLACE "<CMAKE_AR>" "<CMAKE_AR> ar" CMAKE_CXX_ARCHIVE_CREATE ${CMAKE_CXX_ARCHIVE_CREATE})
Expand Down

0 comments on commit 1a5c1c9

Please sign in to comment.