From b4526040a21303a1822fcad348e9b9e39a3876b9 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 25 Sep 2018 04:48:12 +0200 Subject: [PATCH] autoPatchelfHook: Silence errors in isExecutable The "maxx" package recursively runs isExecutable on a bunch of files and since the change to use "readelf" instead of "file" a lot of errors like this one are printed during build: readelf: Error: Not an ELF file - it has the wrong magic bytes at the start While the isExecutable was never meant to be used outside of the autoPatchelfHook, it's still a good idea to silence the errors because whenever readelf fails, it clearly indicates that the file in question is not a valid ELF file. Signed-off-by: aszlig --- pkgs/build-support/setup-hooks/auto-patchelf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index f808cd9f78d7..7c165627f72e 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -7,7 +7,7 @@ gatherLibraries() { addEnvHooks "$targetOffset" gatherLibraries isExecutable() { - readelf -h "$1" | grep -q '^ *Type: *EXEC\>' + readelf -h "$1" 2> /dev/null | grep -q '^ *Type: *EXEC\>' } # We cache dependencies so that we don't need to search through all of them on