3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/stdenv
Anthony Cowley d96893647d cc-wrapper: fix on darwin
The ld-wrapper.sh script calls `readlink` in some circumstances. We need
to ensure that this is the `readlink` from the `coreutils` package so
that flag support is as expected.

This is accomplished by explicitly setting PATH at the top of each shell
script.

Without doing this, the following happens with a trivial `main.c`:

```
nix-env -f "<nixpkgs>" -iA pkgs.clang
$ clang main.c -L /nix/../nix/store/2ankvagznq062x1gifpxwkk7fp3xwy63-xnu-2422.115.4/Library -o a.out
readlink: illegal option -- f
usage: readlink [-n] [file ...]
```

The key element is the `..` in the path supplied to the linker via a
`-L` flag. With this patch, the above invocation works correctly on
darwin, whose native `/usr/bin/readlink` does not support the `-f` flag.

The explicit path also ensures that the `grep` called by `cc-wrapper.sh`
is the one from Nix.

Fixes #6447
2016-01-19 17:47:11 -05:00
..
cygwin cygwin: stdenv 2015-05-28 10:53:34 +02:00
darwin cc-wrapper: fix on darwin 2016-01-19 17:47:11 -05:00
freebsd FreeBSD: improve bootstrapping, re-enable bdb for heimdal 2016-01-01 17:01:13 +00:00
generic Set SOURCE_DATE_EPOCH to latest source file 2016-01-05 17:21:48 +01:00
linux Add stdenv bootstrap tools generation to release.nix 2015-10-23 13:05:36 +02:00
native FreeBSD: undo removal of Solaris and remove changes to native stdenv now that FreeBSD has its own 2016-01-01 17:01:13 +00:00
nix add is{GNU,Clang} attrs to cc-wrapper. 2015-05-11 14:39:36 -07:00
adapters.nix enableDebugging: use more suitable gcc flags 2015-08-10 09:11:30 +02:00
common-path.nix
default.nix Merge branch 'master' into staging 2016-01-05 10:28:58 +01:00