From 5063468f3d57c9478f338dfa5de97fed5f4ba59b Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sat, 4 Apr 2020 13:41:45 +0530 Subject: [PATCH] Move genodeBase libraries to $out/lib --- overlay/genode/default.nix | 5 +++-- overlay/llvm-10/default.nix | 18 ++++++++++++++---- packages/default.nix | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/overlay/genode/default.nix b/overlay/genode/default.nix index b9f7ea6..feccf55 100644 --- a/overlay/genode/default.nix +++ b/overlay/genode/default.nix @@ -175,8 +175,9 @@ let # The actual ld.lib.so is kernel specific # so ship the stubbed library for linking '' - cp $BUILD_DIR/var/libcache/ld/ld.abi.so $out/ld.lib.so - mkdir -p $out/include + mkdir -p $out/include $out/lib + mv $out/*.lib.so $out/lib/ + cp $BUILD_DIR/var/libcache/ld/ld.abi.so $out/lib/ld.lib.so cp -r --no-preserve=mode \ $GENODE_DIR/repos/base/include/* \ $GENODE_DIR/repos/os/include/* \ diff --git a/overlay/llvm-10/default.nix b/overlay/llvm-10/default.nix index b24ea5d..3cbdd50 100644 --- a/overlay/llvm-10/default.nix +++ b/overlay/llvm-10/default.nix @@ -111,9 +111,9 @@ let echo "-fno-exceptions" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc + stdenv.lib.optionalString stdenv.targetPlatform.isGenode '' - echo "-I${genodeBase}/include" >> $out/nix-support/cc-cflags echo "--sysroot=${genodeBase}" >> $out/nix-support/cc-cflags - echo "-L ${genodeBase}" >> $out/nix-support/cc-cflags + echo "-isystem=${genodeBase}/include" >> $out/nix-support/cc-cflags + echo "-L ${genodeBase}/lib" >> $out/nix-support/cc-cflags ''; }; @@ -134,7 +134,8 @@ let '' + mkExtraBuildCommands cc + stdenv.lib.optionalString stdenv.targetPlatform.isGenode '' echo "--sysroot=${genodeBase}" >> $out/nix-support/cc-cflags - echo "-L ${genodeBase}" >> $out/nix-support/cc-cflags + echo "-isystem=${genodeBase}/include" >> $out/nix-support/cc-cflags + echo "-L ${genodeBase}/lib" >> $out/nix-support/cc-cflags ''; }; @@ -154,6 +155,8 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc + stdenv.lib.optionalString stdenv.targetPlatform.isGenode '' echo "--sysroot=${genodeBase}" >> $out/nix-support/cc-cflags + echo "-isystem=${genodeBase}/include" >> $out/nix-support/cc-cflags + echo "-L ${genodeBase}/lib" >> $out/nix-support/cc-cflags ''; }; @@ -168,6 +171,10 @@ let extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString stdenv.targetPlatform.isGenode '' + echo "--sysroot=${genodeBase}" >> $out/nix-support/cc-cflags + echo "-isystem=${genodeBase}/include" >> $out/nix-support/cc-cflags + echo "-L ${genodeBase}/lib" >> $out/nix-support/cc-cflags ''; }; @@ -205,7 +212,10 @@ let openmp = callPackage ./openmp.nix {}; - libunwind = callPackage ./libunwind.nix ({} // + libunwind = if stdenv.targetPlatform.isGenode then + null + else + callPackage ./libunwind.nix ({} // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); diff --git a/packages/default.nix b/packages/default.nix index b37e8bd..0f24636 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -26,6 +26,7 @@ let in rec { inherit stdenv genodeSources; + inherit (nixpkgs) genodeBase; base-hw-pc = buildUpstream { name = "base-hw-pc";