Disable an assert in patchelf

This commit is contained in:
Ehmry - 2021-03-19 13:05:09 +01:00
parent 139d056a36
commit 0aec8413c8
3 changed files with 21 additions and 2 deletions

View File

@ -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
];
});
};

View File

@ -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] = %* {

View File

@ -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<ElfFileParamNames>::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);