#346
Failed to patch ELF
I'm running into a lot of "Failed to patch ELF" while trying to use zerobrew. I'm on x86 Fedora 44 and can reproduce this issue in a Podman container as follows.
Dockerfile:
FROM docker.io/fedora:latest
# Install brew's deps
RUN dnf update -y && dnf install -y @development-tools curl file procps-ng which && dnf clean all && rm -rf /var/cache/dnf
# Add non-root user
ARG REMOTE_USER=dev
# These 2 need to match output of `id` on host
ARG HOST_UID=1000
ARG HOST_GID=1000
RUN groupadd --gid ${HOST_GID} ${REMOTE_USER} && useradd -ms $(which bash) --uid ${HOST_UID} --gid ${HOST_GID} ${REMOTE_USER}
USER ${REMOTE_USER}
# Get brew binary
ENV HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
COPY --from=docker.io/homebrew/brew:latest --chown=${REMOTE_USER} ${HOMEBREW_PREFIX} ${HOMEBREW_PREFIX}Build and run:
podman build . -t zb-test
podman run --rm -it zb-test /bin/bashIn the container, install zb and attempt to use it:
eval $(${HOMEBREW_PREFIX}/bin/brew shellenv)
brew install lucasgelfond/zerobrew/zerobrew
zb install rust
==> Installing rust...
==> Resolving dependencies (16 packages)...
ca-certificates 2026-03-19
llhttp 9.4.1
lz4 1.10.0
mpdecimal 4.0.1
openssl@3 3.6.2
libssh2 1.11.1
libgit2 1.9.3
pkgconf 2.5.1
readline 8.3.3
sqlite 3.53.0
xz 5.8.3
z3 4.15.4
zstd 1.5.7
python@3.14 3.14.4
llvm 22.1.4
rust 1.95.0
==> Downloading and installing...
llhttp ⠙ unpacking...
pkgconf ⠋ unpacking...
libgit2 ⠋ unpacking...
libssh2 ⠦ unpacking...
rust ━━━━━━━╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸ 29.86 MiB/118.79 MiB 5s Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/BuiltinAttributes.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/BuiltinTypes.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/Diagnostics.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/IR.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/IntegerSet.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/Pass.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIRDL/IRDL.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIndex/Index.cpp.o: A parse error occurred while reading the file
llhttp ⠹ unpacking...
pkgconf ⠋ unpacking...
libgit2 ⠙ unpacking...
libssh2 ⠦ unpacking...
rust ━━━━━━━╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸ 32.53 MiB/118.79 MiB 4s Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPILLVM/LLVMPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPILinalg/Linalg.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPILinalg/LinalgPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMLProgram/MLProgram.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMLProgram/MLProgramPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMPI/MPI.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMath/Math.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMath/MathPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMemRef/MemRef.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIMemRef/MemRefPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPINVGPU/NVGPU.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPINVGPU/NVGPUPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPINVVM/NVVM.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIOpenACC/OpenACC.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIOpenACC/OpenACCPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIOpenMP/OpenMP.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIPDL/PDL.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIPDLInterp/PDLInterp.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIPtr/Ptr.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIQuant/Quant.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIROCDL/ROCDL.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISCF/SCF.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISCF/SCFPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISMT/SMT.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISPIRV/SPIRV.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISPIRV/SPIRVPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIShape/Shape.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIShape/ShapePasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIShard/Shard.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIShard/ShardPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISparseTensor/SparseTensor.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPISparseTensor/SparseTensorPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITensor/Tensor.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITensor/TensorPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITosa/Tosa.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITosa/TosaPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITransformDialect/Transform.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITransformDialect/TransformPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITransformDialectTransforms/TransformInterpreter.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITransforms/Passes.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPITransforms/Rewrite.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIUB/UB.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIVCIX/VCIX.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIVector/Vector.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIVector/VectorPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIWasmSSA/WasmSSA.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIX86Vector/X86Vector.cpp.o: A parse error occurred while reading the file
llhttp ⠸ unpacking...
pkgconf ⠹ unpacking...
libgit2 ⠹ unpacking...
libssh2 ⠇ unpacking...
rust ━━━━━━━━╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸╸ 36.40 MiB/118.79 MiB 4s Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAMDGPU/AMDGPU.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAMDGPU/AMDGPUPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAMX/AMX.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAffine/Affine.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAffine/AffinePasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArith/Arith.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArith/ArithPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArmNeon/ArmNeon.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArmSME/ArmSME.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArmSME/ArmSMEPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArmSVE/ArmSVE.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIArmSVE/ArmSVEPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAsync/Async.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIAsync/AsyncPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIBufferization/Bufferization.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIBufferization/BufferizationPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIComplex/Complex.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIControlFlow/ControlFlow.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIConversion/Passes.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIDLTI/DLTI.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIEmitC/EmitC.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIEmitC/EmitCPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIExecutionEngine/ExecutionEngine.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIExportSMTLIB/ExportSMTLIB.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIFunc/Func.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIFunc/FuncPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIGPU/GPU.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIGPU/GPUPasses.cpp.o: A parse error occurred while reading the file
Warning: Failed to patch ELF at /home/dev/.local/share/zerobrew/prefix/Cellar/llvm/22.1.4/lib/objects-Release/obj.MLIRCAPIIR/AffineExpr.cpp.o: A parse error occurred while reading the file
llhttp ⠦ unpacking...
pkgconf ⠴ unpacking...
libgit2 ⠴ unpacking...
llhttp ⠇ unpacking...
pkgconf ⠧ unpacking...
llhttp ✓ installed
pkgconf ✓ installed
libgit2 ✓ installed
libssh2 ✓ installed
rust ✓ installed
==> Installed 16 packages in 10.44sActivity
0No activity yet.