Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 66488f38b9c3
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c10098322acb
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 4, 2019

  1. Copy the full SHA
    e494de2 View commit details
  2. Copy the full SHA
    fadd37b View commit details

Commits on Nov 7, 2019

  1. Merge pull request #70244 from nmattia/nm-fix-libcxx

    libcxx: fix build on linux musl
    matthewbauer authored Nov 7, 2019
    Copy the full SHA
    c100983 View commit details
Showing with 13 additions and 7 deletions.
  1. +4 −2 pkgs/development/compilers/llvm/7/libc++/default.nix
  2. +9 −5 pkgs/development/compilers/llvm/7/libc++abi.nix
6 changes: 4 additions & 2 deletions pkgs/development/compilers/llvm/7/libc++/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version }:
{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version
, enableShared ? ! stdenv.hostPlatform.isMusl }:

stdenv.mkDerivation {
pname = "libc++";
@@ -31,7 +32,8 @@ stdenv.mkDerivation {
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"
++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ;

enableParallelBuilding = true;

14 changes: 9 additions & 5 deletions pkgs/development/compilers/llvm/7/libc++abi.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, cmake, fetch, libcxx, llvm, version }:
{ stdenv, cmake, fetch, libcxx, llvm, version
# on musl the shared objects don't build
, enableShared ? ! stdenv.hostPlatform.isMusl }:

stdenv.mkDerivation {
pname = "libc++abi";
@@ -11,13 +13,15 @@ stdenv.mkDerivation {
postUnpack = ''
unpackFile ${libcxx.src}
unpackFile ${llvm.src}
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*) )
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
'';

cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";

installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
@@ -34,10 +38,10 @@ stdenv.mkDerivation {
else ''
install -d -m 755 $out/include $out/lib
install -m 644 lib/libc++abi.a $out/lib
install -m 644 lib/libc++abi.so.1.0 $out/lib
${stdenv.lib.optionalString enableShared "install -m 644 lib/libc++abi.so.1.0 $out/lib"}
install -m 644 ../include/cxxabi.h $out/include
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
${stdenv.lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so"}
${stdenv.lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1"}
'';

meta = {