Skip to content

zig: re-enable static llvm #210107

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Formula/z/zig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# https://github.com/Homebrew/homebrew-core/issues/209483
skip_clean "lib/zig/libc/darwin/libSystem.tbd"

def install

Check failure on line 36 in Formula/z/zig.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --formula --build-bottle zig` failed on Linux!

make[2]: Leaving directory '/tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build' /usr/bin/make -f CMakeFiles/stage3.dir/build.make CMakeFiles/stage3.dir/build make[2]: Entering directory '/tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build' [100%] Building stage3 cd /tmp/zig-20250307-4837-4auqwn/zig-0.14.0 && /tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build/zig2 build --prefix /tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build/stage3 --zig-lib-dir /tmp/zig-20250307-4837-4auqwn/zig-0.14.0/lib -Dversion-string=0.14.0 -Dtarget=native -Dcpu=core2 -Denable-llvm -Dconfig_h=/tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build/config.h -Dno-langref -Doptimize=ReleaseFast -Dstrip error: /tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build/zig2 terminated with stderr: ld.lld: error: -mllvm: ld.lld: Unknown command line argument '-float-abi=hard'. Try: 'ld.lld --help' ld.lld: Did you mean '--ffast-math=hard'? free(): double free detected in tcache 2 free(): invalid pointer Aborted (core dumped) make[2]: *** [CMakeFiles/stage3.dir/build.make:76: stage3/bin/zig] Error 134 make[2]: Leaving directory '/tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build' make[1]: *** [CMakeFiles/Makefile2:231: CMakeFiles/stage3.dir/all] Error 2 make[1]: Leaving directory '/tmp/zig-20250307-4837-4auqwn/zig-0.14.0/build' make: *** [Makefile:139: all] Error 2 ==> Formula Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/z/zig.rb ==> Configuration HOMEBREW_VERSION: 4.4.23-75-gdac4c0c ORIGIN: https://github.com/Homebrew/brew HEAD: dac4c0cc6c31e8d28bcb7612a6c81c8a038102ea Last commit: 11 hours ago Branch: master Core tap HEAD: 5d6817f78e4cdcd1eb6d36c9097e0cc9ef5baa1f Core tap last commit: 16 minutes ago Core tap JSON: 07 Mar 05:28 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_BOOTSNAP: set HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /github/home/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.3.7 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby CPU: quad-core 64-bit zen3 Clang: 19.1.7 Git: 2.48.1 => /usr/bin/git Curl: 7.81.0 => /usr/bin/curl Kernel: Linux 6.8.0-1021-azure x86_64 GNU/Linux OS: Ubuntu 22.04.5 LTS Host glibc: 2.35 /usr/bin/gcc: 11.4.0 /usr/bin/ruby: N/A glibc: N/A gcc@11: N/A gcc: N/A xorg: N/A ==> ENV HOMEBREW_CC: gcc-11 HOMEBREW_CXX: g++-11 MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew/opt/berkeley-db@5:/home/linuxbrew/.linuxbrew/opt/binutils:/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/opt/mpdecimal/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/openssl@3/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/ncurses/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/readline/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/zlib/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/sqlite/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/xz/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/bzip2/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/expat/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libedit/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libffi/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/z3/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/lz4/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/zstd/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/elfutils/lib/pkgconfig PKG_CONFIG_LIBDIR: HOMEBREW_MAKE_JOBS: 4 HOMEBREW_GIT: /usr/bin/git ACLOCAL_PATH: /home/linuxbrew/.linuxbrew/share/aclocal PATH: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super:/home/linuxbrew/.linuxbrew/opt/cmake/bin:/home/linuxbrew/.linuxbrew/opt/openssl@3/bin:/home/linuxbrew/.linuxbrew/opt/ncu
llvm = deps.find { |dep| dep.name.match?(/^llvm(@\d+)?$/) }
.to_formula
if llvm.versioned_formula? && deps.any? { |dep| dep.name == "z3" }
Expand All @@ -55,7 +55,7 @@
else Hardware.oldest_cpu
end

args = ["-DZIG_SHARED_LLVM=ON"]
args = ["-DZIG_STATIC_LLVM=ON"]
args << "-DZIG_TARGET_MCPU=#{cpu}" if build.bottle?

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
Expand All @@ -64,6 +64,9 @@
end

test do
version_output = shell_output("#{bin}/zig version").strip
assert_equal 1, version_output.lines.length

(testpath/"hello.zig").write <<~ZIG
const std = @import("std");
pub fn main() !void {
Expand Down
Loading