diff options
author | Lana Black <lana@amok.cc> | 2022-08-13 01:27:18 +0000 |
---|---|---|
committer | ehmry <ehmry@posteo.net> | 2022-08-13 07:45:54 -0500 |
commit | 9d97ed0d5747ec0957a55920f1716823724b7ff1 (patch) | |
tree | 2832b37db84ee623db10666d2a68284da9830bd8 /pkgs/os-specific/solo5 | |
parent | f39e1962c003a404953faf0040782b41e3d16a02 (diff) | |
download | nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.tar nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.tar.gz nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.tar.bz2 nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.tar.lz nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.tar.xz nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.tar.zst nixpkgs-9d97ed0d5747ec0957a55920f1716823724b7ff1.zip |
solo5: fix paths detection in compiler and linker wrappers.
Diffstat (limited to 'pkgs/os-specific/solo5')
-rw-r--r-- | pkgs/os-specific/solo5/default.nix | 2 | ||||
-rw-r--r-- | pkgs/os-specific/solo5/fix_paths.patch | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/pkgs/os-specific/solo5/default.nix b/pkgs/os-specific/solo5/default.nix index d781f1c503a..c50cea7b385 100644 --- a/pkgs/os-specific/solo5/default.nix +++ b/pkgs/os-specific/solo5/default.nix @@ -24,7 +24,7 @@ in stdenv.mkDerivation { sha256 = "sha256-8LftT22XzmmWxgYez+BAHDX4HOyl5DrwrpuO2+bqqcY="; }; - patches = [ ./test_sleep.patch ]; + patches = [ ./fix_paths.patch ./test_sleep.patch ]; hardeningEnable = [ "pie" ]; diff --git a/pkgs/os-specific/solo5/fix_paths.patch b/pkgs/os-specific/solo5/fix_paths.patch new file mode 100644 index 00000000000..8895de311da --- /dev/null +++ b/pkgs/os-specific/solo5/fix_paths.patch @@ -0,0 +1,29 @@ +diff --git a/toolchain/cc.in b/toolchain/cc.in +index 337562a..0ec9315 100644 +--- a/toolchain/cc.in ++++ b/toolchain/cc.in +@@ -30,9 +30,9 @@ + # symbols. + + prog="$(basename $0)" +-I="$(dirname $0)/../include" ++I="$(realpath $0 | xargs dirname)/../include" + [ ! -d "${I}" ] && echo "$prog: Could not determine include path" 1>&2 && exit 1 +-L="$(dirname $0)/../lib/@@CONFIG_TARGET_TRIPLE@@" ++L="$(realpath $0 | xargs dirname)/../lib/@@CONFIG_TARGET_TRIPLE@@" + [ ! -d "${L}" ] && echo "$prog: Could not determine library path" 1>&2 && exit 1 + # we can't really tell if 'cc' is called with no input, but work around the + # most obvious cases and stop them from "succeeding" and producing an "a.out" +diff --git a/toolchain/ld.in b/toolchain/ld.in +index 01dffa8..13dca2c 100644 +--- a/toolchain/ld.in ++++ b/toolchain/ld.in +@@ -28,7 +28,7 @@ + # linking a unikernel. No default for ABI is provided, as it is expected that a + # caller directly using 'ld' knows what they are doing. + +-L="$(dirname $0)/../lib/@@CONFIG_TARGET_TRIPLE@@" ++L="$(realpath $0 | xargs dirname)/../lib/@@CONFIG_TARGET_TRIPLE@@" + [ ! -d "${L}" ] && echo "$0: Could not determine library path" 1>&2 && exit 1 + # ld accepts -z solo5-abi=ABI, but does not provide a default ABI + # this is intentional |