Merge pull request #94637 from antifuchs/gccemacs-on-darwin

emacs: Make gccemacs build on darwin
This commit is contained in:
adisbladis
2020-09-02 18:30:58 +02:00
committed by GitHub
4 changed files with 26 additions and 17 deletions

View File

@@ -184,7 +184,7 @@ stdenv.mkDerivation ({
preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib;
inherit version hostPlatform gnatboot langAda langGo;
inherit version hostPlatform gnatboot langAda langGo langJit;
};
dontDisableStatic = true;

View File

@@ -261,7 +261,7 @@ postInstall() {
fi
if type "install_name_tool"; then
for i in "${!outputLib}"/lib/*.*.dylib; do
for i in "${!outputLib}"/lib/*.*.dylib "${!outputLib}"/lib/*.so.[0-9]; do
install_name_tool -id "$i" "$i" || true
for old_path in $(otool -L "$i" | grep "$out" | awk '{print $1}'); do
new_path=`echo "$old_path" | sed "s,$out,${!outputLib},"`

View File

@@ -2,6 +2,7 @@
, gnatboot ? null
, langAda ? false
, langJava ? false
, langJit ? false
, langGo }:
assert langJava -> lib.versionOlder version "7";
@@ -49,3 +50,11 @@ lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
+ lib.optionalString (hostPlatform.isDarwin) ''
export ac_cv_func_aligned_alloc=no
''
# In order to properly install libgccjit 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 && langJit) ''
export STRIP='strip -x'
''