3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support
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
..
agda agda: Remove unused/uneeded abstractions, including postprocess 2015-05-31 01:55:10 +00:00
autonix autonix: JSON manifest format 2015-06-25 09:03:40 -05:00
build-dotnet-package build-dotnet-package: add optional makeWrapperArgs argument 2015-10-29 06:02:18 +03:00
build-fhs-chrootenv chrootenv: add setuid wrappers to path 2015-12-17 14:21:17 +03:00
build-fhs-userenv Merge pull request #12062 from mogorman/platformio 2016-01-13 15:47:25 +01:00
buildenv buildEnv: Skip content check on ignoreCollisions. 2016-01-18 03:56:09 +01:00
builder-defs Don't fail if env-vars cannot be written to 2015-11-04 16:32:59 +01:00
cc-wrapper cc-wrapper: fix on darwin 2016-01-19 17:47:11 -05:00
docker dockerTools: nix functions for manipulating docker images 2016-01-13 10:27:37 +01:00
dotnetbuildhelpers Lay down the foundation for packaging the .NET echosystem 2015-06-06 09:06:22 -04:00
dotnetenv Remove executable bits from non-executable files 2015-01-27 18:54:38 +01:00
emacs elpa2nix: fix packages with DOS line endings 2016-01-18 15:29:19 -06:00
fetchadc Add Apple command-line tools 2014-10-02 06:50:09 +01:00
fetchbower Make fetchBower a bit more like a normal mkDerivation, which is easier to test. 2015-07-16 14:42:16 +00:00
fetchbzr nix-prefetch-bzr: match path name to fetchbzr name 2015-12-19 09:32:22 -06:00
fetchcvs build-support: Fix nix-prefetch-* on OS X. 2014-08-27 11:22:34 +02:00
fetchdarcs fetchbzr, fetchdarcs, fetchhg: use rev attr 2014-06-28 21:06:10 +02:00
fetchegg Infrastructure to build chicken eggs. 2014-10-13 23:29:27 +02:00
fetchfile Update builder.sh 2015-11-25 17:14:03 +08:00
fetchgit Merge pull request #10998 from andrewrynhard/master 2016-01-19 12:01:55 +01:00
fetchgitlocal fetchgitLocal: make it work in submodules 2016-01-04 15:09:00 -08:00
fetchgitrevision Remove semicolon causing evaluation error. 2011-01-02 23:52:39 +00:00
fetchhg fetchhg: fixed nix-prefetch-hg interpreter 2015-10-06 22:41:46 +03:00
fetchmtn Fix a few typos 2013-08-11 10:55:53 +00:00
fetchnuget fetchnuget: run fixupPhase to honor propagatedBuildInputs 2015-06-12 17:13:21 +02:00
fetchpatch fetchpatch: Allow to pass a postFetch attribute. 2015-06-23 03:35:30 +02:00
fetchsvn fetchsvn: correctly handle trailing slashes 2015-12-06 11:49:51 -06:00
fetchsvnrevision
fetchsvnssh
fetchurl fetchurl: support executables 2016-01-19 11:17:49 +01:00
fetchzip fetchFromBitBucket: auto-remove an impure file 2015-12-29 16:54:50 +01:00
gcc-cross-wrapper orig-gcc -> orig-cc 2015-03-04 22:15:46 +01:00
gcc-wrapper-old Fix build of gccgo-wrapper on Illumos. 2015-11-16 17:20:12 +01:00
grsecurity Revert "kernel: Remove unsupported 3.10, 3.12, 3.14" 2015-11-19 14:25:16 +01:00
kdewrapper Another attempt to eradicate ensureDir 2014-06-30 14:56:10 +02:00
kernel make-initrd: store all files with root as owner 2015-12-28 12:07:11 +03:00
libredirect citrix-receiver: init at 13.2.1, fixes #8458 2015-11-11 22:27:15 +01:00
make-desktopitem makeDesktopItem: change name of the derivations 2016-01-15 08:37:02 +01:00
make-startupitem Another attempt to eradicate ensureDir 2014-06-30 14:56:10 +02:00
make-symlinks
mono-dll-fixer
nuke-references nuke-references: support -e option 2015-10-18 18:41:11 +03:00
ocaml add an ocaml specific builder to the system 2015-05-22 10:12:21 -07:00
release clang-analyzer: align attrname with pkgname 2015-02-20 22:30:51 +01:00
rust buildRustPackage: don't hardcode /nix/store, use $NIX_STORE 2016-01-12 13:45:11 -05:00
setup-hooks Merge branch 'master' into staging 2016-01-18 09:48:49 +01:00
src-only
substitute * Set preferLocalBuild on a few more trivial builders. 2012-04-26 15:17:43 +00:00
substitute-files substituteAllFiles: support postInstall 2016-01-10 06:03:26 +03:00
templaterpm Update: new features for nix-template-rpm 2015-02-06 20:12:57 +01:00
upstream-updater update-walker: add a minimal description 2016-01-01 19:07:38 +01:00
vm nixos/vm-tests: Remove msize mount option 2015-12-14 17:26:24 +01:00
vsenv * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless 2012-01-18 20:16:00 +00:00
build-maven.nix build-maven: Add handling for snapshot version resolution 2015-07-20 09:19:12 -04:00
build-pecl.nix fix phpPackages memcache,memcached,xdebug 2015-02-05 20:28:16 +01:00
replace-dependency.nix replace-dependency.nix: Remove unnecessary carriage return. 2015-11-16 17:52:12 -05:00
source-from-head-fun.nix Remove getConfig helper function 2012-09-19 13:56:56 -04:00
trivial-builders.nix requireFile: remove colon from the url for easier copy/paste 2016-01-16 21:58:40 +01:00