From 09ff7707ae0b275f18e151cc8bd70448bafa6f46 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 6 Jan 2019 22:11:38 -0600 Subject: [PATCH 1/4] llvm3.{8,9}: use old CMAKE_INSTALL_NAME_DIR value adcf4aa5241f8dc37195d9bcbce27a80b913a512 broke these two. The old way seems to work and might still avoid the original lldb issues. --- pkgs/development/compilers/llvm/3.8/llvm.nix | 2 +- pkgs/development/compilers/llvm/3.9/llvm.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.8/llvm.nix b/pkgs/development/compilers/llvm/3.8/llvm.nix index fcb4214a1de..ca6723172d7 100644 --- a/pkgs/development/compilers/llvm/3.8/llvm.nix +++ b/pkgs/development/compilers/llvm/3.8/llvm.nix @@ -49,7 +49,7 @@ in stdenv.mkDerivation rec { sed -i 's/os_trace(\(.*\)");$/printf(\1\\n");/g' ./projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc substituteInPlace CMakeLists.txt \ - --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ + --replace 'set(CMAKE_INSTALL_NAME_DIR "@rpath")' "set(CMAKE_INSTALL_NAME_DIR "$out/lib")" \ --replace 'set(CMAKE_INSTALL_RPATH "@executable_path/../lib")' "" '' + '' diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 00c56e49e37..678ec759425 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -82,7 +82,7 @@ in stdenv.mkDerivation rec { --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' substituteInPlace CMakeLists.txt \ - --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ + --replace 'set(CMAKE_INSTALL_NAME_DIR "@rpath")' "set(CMAKE_INSTALL_NAME_DIR "$lib/lib")" \ --replace 'set(CMAKE_INSTALL_RPATH "@executable_path/../lib")' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. From 2bbec30c2e8a639da4a93038e002dff5d3a421c7 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 6 Jan 2019 22:13:11 -0600 Subject: [PATCH 2/4] darwin.diskdev_cmds: fix build with dsymutil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xcbuild doesn’t handle dsymutil correctly. fuser.pl does not contain debug symbols, but xcbuild doesn’t handle this like xcodebuild does. So, just disable the debug information. We probably should do this in more places using xcbuild, but it requires some arbitrary patching. --- .../darwin/apple-source-releases/diskdev_cmds/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix index 0f46e50de3a..08c7a883502 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix @@ -18,14 +18,16 @@ appleDerivation { cp xnu-*/bsd/i386/disklabel.h i386 cp -r xnu-*/bsd/sys System cp -r Libc-*/uuid System + substituteInPlace diskdev_cmds.xcodeproj/project.pbxproj \ + --replace 'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";' "" ''; installPhase = '' install -D Products/Release/libdisk.a $out/lib/libdisk.a rm Products/Release/libdisk.a for f in Products/Release/*; do if [ -f $f ]; then - install -D $file $out/bin/$(basename $f) - done + install -D $f $out/bin/$(basename $f) + fi done ''; From d02bb3c1978f96259a98efcb0f280b973c756cd0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 6 Jan 2019 22:15:43 -0600 Subject: [PATCH 3/4] darwin.make-bootstrap-tools: remove dsymutil This hopefully is not needed for the bootstrap tools. Needs more testing. --- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index eee3b1ce075..670215a735d 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -98,7 +98,7 @@ in rec { cp -d ${xz.out}/lib/liblzma*.* $out/lib # Copy binutils. - for i in as ld ar ranlib nm strip otool install_name_tool dsymutil lipo; do + for i in as ld ar ranlib nm strip otool install_name_tool lipo; do cp ${cctools_}/bin/$i $out/bin done From ed6148726b9e9b2f6edf38e889dc39c28648dda4 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 6 Jan 2019 22:31:21 -0600 Subject: [PATCH 4/4] darwin: fix more *_cmds derivation Doh --- .../darwin/apple-source-releases/adv_cmds/xcode.nix | 3 ++- .../darwin/apple-source-releases/file_cmds/default.nix | 4 ++-- .../darwin/apple-source-releases/network_cmds/default.nix | 2 +- pkgs/os-specific/darwin/insert_dylib/default.nix | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix index 7b1492799dd..45912041a24 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix @@ -16,7 +16,8 @@ appleDerivation { substituteInPlace adv_cmds.xcodeproj/project.pbxproj \ --replace "FD201DC214369B4200906237 /* pkill.c in Sources */," "" \ --replace "FDF278D60FC6204E00D7A3C6 /* locale.cc in Sources */," "" \ - --replace '/usr/lib/libtermcap.dylib' 'libncurses.dylib' + --replace '/usr/lib/libtermcap.dylib' 'libncurses.dylib' \ + --replace 'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";' "" ''; buildPhase = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix index c2320525322..2f5e4f542d7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix @@ -21,8 +21,8 @@ appleDerivation rec { installPhase = '' for f in Products/Release/*; do if [ -f $f ]; then - install -D $file $out/bin/$(basename $f) - done + install -D $f $out/bin/$(basename $f) + fi done for n in 1; do diff --git a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix index 8e69cb4bfa7..feee054c2ac 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix @@ -22,7 +22,7 @@ appleDerivation rec { installPhase = '' for f in Products/Release/*; do if [ -f $f ]; then - install -D $file $out/bin/$(basename $f) + install -D $f $out/bin/$(basename $f) fi done diff --git a/pkgs/os-specific/darwin/insert_dylib/default.nix b/pkgs/os-specific/darwin/insert_dylib/default.nix index 510c7154f2b..0ab6a415707 100644 --- a/pkgs/os-specific/darwin/insert_dylib/default.nix +++ b/pkgs/os-specific/darwin/insert_dylib/default.nix @@ -11,9 +11,8 @@ stdenv.mkDerivation nativeBuildInputs = [ xcbuildHook ]; installPhase = '' - prog=$(find . -type f -name insert_dylib) mkdir -p $out/bin - install -m755 $prog $out/bin + install -m755 Products/Release/insert_dylib $out/bin ''; meta.platforms = stdenv.lib.platforms.darwin; }