diff --git a/overlay/default.nix b/overlay/default.nix index 0b31505..2353f6a 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -86,8 +86,11 @@ in nullPkgs // { erisPatchHook = final.callPackage ./eris-patch-hook { patchelf = prev.patchelf.overrideAttrs (attrs: { - patches = attrs.patched or [ ] - ++ [ ./patchelf/dynstr.patch ./patchelf/shiftFile.patch ]; + patches = attrs.patched or [ ] ++ [ + ./patchelf/dynstr.patch + ./patchelf/shiftFile.patch + ./patchelf/disable-assert.patch + ]; }); }; diff --git a/overlay/eris-patch-hook/eris_patch.nim b/overlay/eris-patch-hook/eris_patch.nim index 0dff3ab..10def8b 100644 --- a/overlay/eris-patch-hook/eris_patch.nim +++ b/overlay/eris-patch-hook/eris_patch.nim @@ -164,8 +164,11 @@ while pendingFiles.len != 0: for path, urn in fileClosure(replacementPath).pairs: closure[path] = %urn if pendingFile.replacements.len != 0: + replaceCmd.add(" 2>&1") let (msg, exitCode) = execCmdEx(replaceCmd, options = {poUsePath}) if exitCode != 0: + echo "Patchelf failed" + echo replaceCmd echo msg quit exitCode outputManifests[pendingFile.outputRoot][filePath] = %* { diff --git a/overlay/patchelf/disable-assert.patch b/overlay/patchelf/disable-assert.patch new file mode 100644 index 0000000..90d92be --- /dev/null +++ b/overlay/patchelf/disable-assert.patch @@ -0,0 +1,13 @@ +diff --git a/src/patchelf.cc b/src/patchelf.cc +index 0c672e1..d9c2efb 100644 +--- a/src/patchelf.cc ++++ b/src/patchelf.cc +@@ -894,7 +894,7 @@ void ElfFile::rewriteSectionsExecutable() + debug("first reserved offset/addr is 0x%x/0x%llx\n", + startOffset, (unsigned long long) startAddr); + +- assert(startAddr % getPageSize() == startOffset % getPageSize()); ++ //assert(startAddr % getPageSize() == startOffset % getPageSize()); + Elf_Addr firstPage = startAddr - startOffset; + debug("first page is 0x%llx\n", (unsigned long long) firstPage); +