From c2cba8746a1cb4d622a739e2c1acd769032d4771 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 17 Dec 2024 14:52:30 -0500 Subject: [PATCH] wabt: revision bump for linux bottle Fix relocation error when linking shared libraries on Linux ``` /home/linuxbrew/.linuxbrew/opt/binutils/bin/ld: /home/linuxbrew/.linuxbrew/lib/libwabt.a(binary-reader.cc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC /home/linuxbrew/.linuxbrew/opt/binutils/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status ``` build log re, https://github.com/Homebrew/homebrew-core/actions/runs/12369250671/job/34520913923#step:4:4511 Signed-off-by: Rui Chen --- Formula/h/halide.rb | 5 ++++- Formula/w/wabt.rb | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Formula/h/halide.rb b/Formula/h/halide.rb index db298834574f0b..d36cde2e81b0c2 100644 --- a/Formula/h/halide.rb +++ b/Formula/h/halide.rb @@ -28,10 +28,13 @@ class Halide < Formula depends_on "libpng" depends_on "lld" depends_on "llvm" - depends_on "openssl@3" depends_on "python@3.13" depends_on "wabt" + on_macos do + depends_on "openssl@3" + end + def python3 "python3.13" end diff --git a/Formula/w/wabt.rb b/Formula/w/wabt.rb index 33977762732920..f44f87f429394c 100644 --- a/Formula/w/wabt.rb +++ b/Formula/w/wabt.rb @@ -5,6 +5,7 @@ class Wabt < Formula tag: "1.0.36", revision: "3e826ecde1adfba5f88d10d361131405637e65a3" license "Apache-2.0" + revision 1 livecheck do url :stable @@ -28,11 +29,17 @@ class Wabt < Formula uses_from_macos "python" => :build def install - system "cmake", "-S", ".", "-B", "build", - "-DBUILD_TESTS=OFF", - "-WITH_WASI=ON", - *std_cmake_args, - "-DFETCHCONTENT_FULLY_DISCONNECTED=OFF" # FIXME: Find a way to build without this. + ENV.append_to_cflags "-fPIC" if OS.linux? + + args = %w[ + -DBUILD_TESTS=OFF + -DWITH_WASI=ON + -DFETCHCONTENT_FULLY_DISCONNECTED=OFF + ] + + system "cmake", *args, *std_cmake_args + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build" end