Merge pull request #203278 from klntsky/klntsky/fix-hotpatch

Fix hotpatch: skip tests that assume .so files presence at hardcoded paths

authored by Alexander Bantyev and committed by GitHub f56d74c1 22bb8269

+27
+2
pkgs/development/libraries/hotpatch/default.nix
··· 27 27 LD_LIBRARY_PATH=$(pwd)/src make test 28 28 ''; 29 29 30 + patches = [ ./no-loader-test.patch ]; 31 + 30 32 meta = with lib; { 31 33 description = "Hot patching executables on Linux using .so file injection"; 32 34 homepage = src.meta.homepage;
+25
pkgs/development/libraries/hotpatch/no-loader-test.patch
··· 1 + diff --git a/test/loader.c b/test/loader.c 2 + index 4e3dfdc..7f98d94 100644 3 + --- a/test/loader.c 4 + +++ b/test/loader.c 5 + @@ -54,20 +54,6 @@ int main(int argc, char **argv) 6 + assert(ret < 0); 7 + ret = ld_find_library(maps, mapnum, "libc", false, NULL, 6); 8 + assert(ret >= 0); 9 + -#if __WORDSIZE == 64 10 + - ret = ld_find_library(maps, mapnum, "/lib64/ld-linux-x86-64.so.2", 11 + - true, NULL, 6); 12 + - assert(ret >= 0); 13 + - ret = ld_find_library(maps, mapnum, "/lib/ld-linux-x86-64.so.2", 14 + - false, NULL, 6); 15 + -#else 16 + - ret = ld_find_library(maps, mapnum, "/lib/ld-linux.so.2", 17 + - true, NULL, 6); 18 + - assert(ret >= 0); 19 + - ret = ld_find_library(maps, mapnum, "/lib32/ld-linux.so.2", 20 + - false, NULL, 6); 21 + -#endif 22 + - assert(ret < 0); 23 + ld_free_maps(maps, mapnum); 24 + return 0; 25 + }