summary refs log tree commit diff
path: root/pkgs/build-support/cc-wrapper
Commit message (Collapse)AuthorAge
* Merge pull request #74090 from obsidiansystems/ghcjs-cross-without-ccJohn Ericson2019-12-30
|\ | | | | stdenv, haskell: bonafied GHCJS cross compilation without stdenv.cc
| * Merge remote-tracking branch 'upstream/master' into ghcjs-cross-without-ccJohn Ericson2019-11-25
| |\
| * | stdenv: Introduce hasCC attributeJohn Ericson2019-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we'd always use `cc = null`, and check for that. The problem is this breaks for cross compilation to platforms that don't support a C compiler. It's a very subtle issue. One might think there is no problem because we have `stdenvNoCC`, and presumably one would only build derivations that use that. The problem is that one still wants to use tools at build-time that are themselves built with a C compiler, and those are gotten via "splicing". The runtime version of those deps will explode, but the build time / `buildPackages` versions of those deps will be fine, and splicing attempts to work this by using `builtins.tryEval` to filter out any broken "higher priority" packages (runtime is the default and highest priority) so that both `foo` and `foo.nativeDrv` works. However, `tryEval` only catches certain evaluation failures (e.g. exceptions), and not arbitrary failures (such as `cc.attr` when `cc` is null). This means `tryEval` fails to let us use our build time deps, and everything comes apart. The right solution is, as usually, to get rid of splicing. Or, baring that, to make it so `foo` never works and one has to explicitly do `foo.*`. But that is a much larger change, and certaily one unsuitable to be backported to stable. Given that, we instead make an exception-throwing `cc` attribute, and create a `hasCC` attribute for those derivations which wish to condtionally use a C compiler: instead of doing `stdenv.cc or null == null` or something similar, one does `stdenv.hasCC`. This allows quering without "tripping" the exception, while also allowing `tryEval` to work. No platform without a C compiler is yet wired up by default. That will be done in a following commit.
* | | Merge pull request #74226 from bhpdt/fix/idirafter-stdenvMatthew Bauer2019-12-02
|\ \ \ | | | | | | | | stdenv: Fix gcc -idirafter shell glob in cc-wrapper
| * | | stdenv: Fix gcc -idirafter shell glob in cc-wrapperBen Hipple2019-11-26
| | | | | | | | | | | | | | | | | | | | | | | | If an empty string is passed to `-idirafter`, it breaks gcc. This commit makes the stdenv less fragile by expanding out the shell glob and ensuring no empty arguments get passed.
* | | | cc-wrapper: expose wrapper script as overridable attribute (#65813)David Wood2019-11-27
|/ / /
* | | Merge pull request #74065 from Ericson2314/cc-versionsJohn Ericson2019-11-24
|\ \ \ | |_|/ |/| | compilers, binutils: Add version and pname
| * | {cc,bintools}-wrapper: Inherit compiler versionCraig Hall2019-11-24
| |/
* | Merge remote-tracking branch 'upstream/master' into wrapper-pname-supportJohn Ericson2019-11-24
|\ \ | |/ |/|
| * cc-wrapper, bintools-wrapper: Remove now unneeded `set {+,-}u`John Ericson2019-11-04
| |
| * cc-wrapper: add (partial) support for clang -cc1Craig Hall2019-09-01
| | | | | | | | We need this for intel-compute-runtime, see #63705
* | {cc,bintools}-wrapper: use cc pname/version if setCraig Hall2019-11-24
|/
* cc-wrapper: use -iframework instead of -FMatthew Bauer2019-06-28
| | | | | | | | This avoids dumping -Wall warnings when they appear in framework headers. As a result, we are closer to how regular headers are included (via -isystem). Also remove ccIncludeFlag lookup, this was unused & not very useful.
* cc-wrapper: only set -march when platform.gcc.arch is specifiedMatthew Bauer2019-04-26
| | | | | | | | | | We want to make sure this value is explicitly set. Infering it for every arch leads to annoying failures like: https://hydra.nixos.org/build/92583832/ Perhaps we can enable it in the future with some smarter handling of cc-wrapper.sh.
* kernel: fix cross-buildvolth2019-04-25
| | | | | | | Fix for #59225 regression proposed by @matthewbauer https://github.com/NixOS/nixpkgs/pull/59225#issuecomment-486398003 (cherry picked from commit a6ea72a77d1f8e794244b063a7e9780c1b47486d)
* Merge pull request #56555 from matthewbauer/wasmMatthew Bauer2019-04-23
|\ | | | | Initial WebAssembly/WASI cross-compilation support
| * wasilibc: use .imports file for lldMatthew Bauer2019-04-23
| | | | | | | | | | instead of passing in the --allow-undefined-file, we can just let lld find the file.
| * wasm: init cross targetMatthew Bauer2019-04-23
| | | | | | | | | | | | | | | | | | Adds pkgsCross.wasm32 and pkgsCross.wasm64. Use it to build Nixpkgs with a WebAssembly toolchain. stdenv/cross: use static overlay on isWasm isWasm doesn’t make sense dynamically linked.
* | fix bootstrap when platform.gcc.arch=="skylake"volth2019-04-21
| |
* | cc-wrapper: make machine configuration configurableMatthew Bauer2019-04-20
|/ | | | | | | | | | | | | | | | | | | | | | It is useful to make these dynamic and not bake them into gcc. This means we don’t have to rebuild gcc to change these values. Instead, we will pass cflags to gcc based on platform values. This was already done hackily for android gcc (which is multi-target), but not for our own gccs which are single target. To accomplish this, we need to add a few things: - add ‘arch’ to cpu - add NIX_CFLAGS_COMPILE_BEFORE flag (goes before args) - set -march everywhere - set mcpu, mfpu, mmode, and mtune based on targetPlatform.gcc flags cc-wrapper: only set -march when it is in the cpu type Some architectures don’t have a good mapping of -march. For instance POWER architecture doesn’t support the -march flag at all! https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options
* llvm8: support c++ in cross caseMatthew Bauer2019-04-11
| | | | | | | | | | this adds libc++ to the LLVM cross, giving us access to the full Nixpkgs set. This requires 4 stages of wrapped compilers: - Clang with no libraries - Clang with just compiler-rt - Clang with Libc, and compiler-rt - Clang with Libc++, Libc, and compiler-rt
* netbsd: add cross targetMatthew Bauer2019-02-26
|
* Merge branch 'staging-next' into stagingVladimír Čunát2019-02-01
|\
| * cc-wrapper: set priority to 10Matthew Bauer2019-01-31
| |
* | cc-wrapper: add libcxx for libcxxClangMatthew Bauer2019-01-26
|/ | | | | | | | | | | clang needs to find headers + libraries for compiling with libc++. We need to add a libcxx argument to cc-wrapper. This means you do not have to pass in c++ headers directly. This resolves the last case remaining of #30670. Darwin clang++ now works properly. Fixes #30670
* Merge pull request #46115 from oxij/stdenv/bintools-cc-symlinkMichael Raskin2018-11-22
|\ | | | | cc-wrapper, bintools-wrapper: simply symlink man and info outputs
| * cc-wrapper, bintools-wrapper: simply symlink man and info outputsJan Malakhovski2018-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous commit `propagateDoc` is now always given the correct value (i.e. it is never set to `true` when there are no `man` and `info` outputs). Hence, we can simply symlink the original outputs to the wrapper outputs. Pros: - simpler, less indirection compared to `propagated-user-env-packages`, - uses less inodes (1 symlink, which nix then simply automatically resolves and removes, vs. two directories and a file), - makes direct references like "export MANPATH=${stdenv.cc.man}/share/man" simply work. Cons: - I'm not aware of any. This and the previous commit together almost completely revert commits fde7296a4749efadbeb8b608b7b4cc01c3a6e6d7, fa412972091538376d1d4ffd446803b5d9385cbb, and c981787db951afb11c1328461df82d4277ebec07.
* | gcc: support avrMatthew Bauer2018-10-29
|/ | | | | | | | | | | | | | | | | | - respect libc’s incdir and libdir - make non-unix systems single threaded - set LIMITS_H_TEST to false for avr - misc updates to support new libc’s - use multilib with avr For threads we want to use: - posix on unix systems - win32 on windows - single on everything else For avr: - add library directories for avrlibc - to disable relro and bind - avr5 should have precedence over avr3 - otherwise gcc uses the wrong one
* bintools-wrapper, cc-wrapper, stdenv: infer propagateDoc automaticallyJan Malakhovski2018-09-23
| | | | | | | | | | | | | | 02c09e01712ce0b61e5c8f7159047699a434f7fc (NixOS/nixpkgs#44558) was reverted in c981787db951afb11c1328461df82d4277ebec07 but, as it turns out, it fixed an issue I didn't know about at the time: the values of `propagateDoc` options were (and now again are) inconsistent with the underlying things those wrappers wrap (see NixOS/nixpkgs#46119), which was (and now is) likely to produce more instances of NixOS/nixpkgs#43547, if not now, then eventually as stdenv changes. This patch (which is a simplified version of the original reverted patch) is the simplest solution to this whole thing: it forces wrappers to directly inspect the outputs of the things they are wrapping instead of making stdenv guess the correct values.
* treewide: cleanup some references to bashJan Malakhovski2018-09-04
|
* Revert "Merge pull request #44767 from obsidiansystems/wrapper-env-var-path"Matthew Bauer2018-08-22
| | | | | This reverts commit 89efc27f571368b475ce87e71445be10a9d1121a, reversing changes made to d0f11020ca55dfe20ecad05005343e3a3e3cbd90.
* Merge pull request #44767 from obsidiansystems/wrapper-env-var-pathJohn Ericson2018-08-17
|\ | | | | {cc,bintools}-wrapper, ghc, libgcc: Define wrapper env vars as full paths
| * cc-wrapper: Define env vars with full pathJohn Ericson2018-08-06
| |
| * Revert "Merge #44221: default for NIX_CXXSTDLIB_COMPILE"Vladimír Čunát2018-07-31
| | | | | | | | | | | | This reverts commit 034c9816d5236e5c0131b715ee08fed56c89d4ad, reversing changes made to 5afe87ed7a75e99c3b68f255562dc82b3e3c7d4e. Huge rebuild, moving to staging.
| * Use the default for NIX_CXXSTDLIB_COMPILE even if defined (but empty).Eduard-Mihai Burtescu2018-07-30
| |
* | Revert "cc-wrapper: propagate man and info to propagated-build-inputs"Eelco Dolstra2018-08-09
| | | | | | | | This reverts commit 28ad0703f3db92a3cbb8b1249101e0ff4e3616f6.
* | Revert "cc-wrapper, bintools-wrapper: simply symlink man and info outputs"Eelco Dolstra2018-08-09
| | | | | | | | This reverts commit 02c09e01712ce0b61e5c8f7159047699a434f7fc.
* | cc-wrapper, bintools-wrapper: simply symlink man and info outputsJan Malakhovski2018-08-06
| | | | | | | | See discussion in #44516.
* | cc-wrapper: propagate man and info to propagated-build-inputsJan Malakhovski2018-08-05
| |
* | Re-Revert "Merge #44221: default for NIX_CXXSTDLIB_COMPILE"Vladimír Čunát2018-07-31
|/ | | | | This reverts commit fd81a2ecb6b85594dc79ad53566c822849d4e47a. Moved from master to staging.
* {cc,bintools}-wrapper: also replace . in configMatthew Bauer2018-07-28
| | | | | Some configs will have dots for version numbers. To normalize we can just use _ again.
* cc-wrapper: disable stackprotector for mingwMatthew Bauer2018-06-23
| | | | It seems to break things.
* Merge a subset of staging (security)Vladimír Čunát2018-06-15
|\ | | | | | | | | | | In particular, this contains Firefox-related and libgcrypt updates. Other larger rebuilds would apparently need lots of time to catch up on Hydra, due to nontrivial rebuilds in other branches than staging.
| * cc-wrapper, bintools-wrapper: use getHostRoleEnvHook instead of ↵Ben Wolsieffer2018-06-03
| | | | | | | | | | | | getTargetRoleEnvHook Fixes include and link paths when cross compiling.
* | cc-wrapper: fix eval error on macMatthew Bauer2018-06-14
|/ | | | | When doing cross to linux, we will not have a GCC compiler (yet). We can hopefully skip the cxx stdlib stuff for now.
* clang_6: fix sanitizers under libstdc++Benjamin Saunders2018-05-24
|
* Merge remote-tracking branch 'upstream/staging' into compiler-rtJohn Ericson2018-05-24
|\
| * Merge remote-tracking branch 'upstream/staging' into strictDepsJohn Ericson2018-05-14
| |\
| | * Merge pull request #40139 from obsidiansystems/modular-setup-hooksJohn Ericson2018-05-07
| | |\ | | | | | | | | treewide: Modular setup hooks
| | | * {bintools,cc}-wrapper: Factor out role accumulation logicJohn Ericson2018-05-07
| | | |