From 038e86ffbb76bd54b922e68f5514102e36bec96b Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Sun, 2 Aug 2020 16:11:55 -0400 Subject: [PATCH] gcc: Fix building libgccjit on darwin, using strip -x The default `strip` invocation tries to strip global symbols from the library, and refuses because those are indirect symbol table references. --- pkgs/development/compilers/gcc/common/pre-configure.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/compilers/gcc/common/pre-configure.nix b/pkgs/development/compilers/gcc/common/pre-configure.nix index fff490148007..e4a7cfb4287c 100644 --- a/pkgs/development/compilers/gcc/common/pre-configure.nix +++ b/pkgs/development/compilers/gcc/common/pre-configure.nix @@ -49,3 +49,11 @@ lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) '' + lib.optionalString (hostPlatform.isDarwin) '' export ac_cv_func_aligned_alloc=no '' + +# In order to properly install on macOS Catalina, strip(1) upon +# installation must not remove external symbols, otherwise the install +# step errors with "symbols referenced by indirect symbol table +# entries that can't be stripped". ++ lib.optionalString (hostPlatform.isDarwin) '' + export STRIP='strip -x' +''