Commit Graph

198 Commits

Author SHA1 Message Date
Alyssa Ross
ad10899abf llvm_5: backport patch for musl 1.2.4 2023-05-03 09:37:13 +00:00
Alyssa Ross
2839c94f1e pkgsLLVM.stdenv: use clangNoLibc when libc is null
clangNoLibc always uses LLVM bintools, so it still has the useLLVM
semantics.
2023-04-28 10:01:22 +00:00
github-actions[bot]
590fb73d67
Merge staging-next into staging 2023-03-11 00:03:08 +00:00
Alyssa Ross
8c70bfb9f2
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/libraries/librsvg/default.nix
	pkgs/development/python-modules/r2pipe/default.nix
2023-03-10 18:46:21 +00:00
Alyssa Ross
0fd04a5918 llvmPackages.compiler-rt: enable libclang_rt.profile-....a build
Port of 94cad6ec1a ("llvm 14 compiler-rt: enable
libclang_rt.profile-....a build").
2023-03-10 12:57:55 +00:00
Alyssa Ross
a10d676199
llvm: tighten platforms
LLVM can't be built for all architectures supported by Nixpkgs (s390,
and for some versions m68k and RISC-V).
2023-03-03 13:45:14 +00:00
Rahul Butani
b06ac37f38 llvmPackages*.clang_manpages: drop the sphinx find_package patch
This is a backport of f8cbbdd05b.

LLVM versions >= 5.0.0 already look for sphinx when `LLVM_ENABLE_SPHINX`
is enabled: ea139eccc1
2023-03-02 12:34:33 +00:00
Alyssa Ross
1db7f30d1f lld: explain why we change the stack size on Musl
Suggested-by: Rahul Butani <rrbutani@users.noreply.github.com>
2023-02-28 10:56:53 +00:00
Alyssa Ross
6cc523ca28 lld: build with 2M stack size
Port of 6485a02fb3 ("llvm 14 lld: build with 2M stack size to fix
firefox lto").
2023-02-28 10:56:53 +00:00
github-actions[bot]
51c18e4be1
Merge staging-next into staging 2023-02-28 06:01:38 +00:00
Robert Hensing
359a46e751 llvm*: Remove outputSpecified workaround where possible
The effect of `.out // { outputSpecified = false; }` in these cases
is to select the default output explicitly, but then make the
selection implicit until `overrideAttrs` is called. Previously
`overrideAttrs` would not preserve output selection, masking the
apparently unnecessary behavior of this workaround.

For `libllvm-polly`, this logic does not apply, as it does not
select the default output.

The `outputSpecified` workaround was introduced in
https://github.com/NixOS/nixpkgs/pull/122554

and was perhaps rushed because of a release deadline, and expected
delays from mass rebuilds.

The change in `overrideAttrs` behavior was added in
5b2f597b11 / https://github.com/NixOS/nixpkgs/pull/211685

and the problem was discovered in https://github.com/NixOS/nixpkgs/pull/218537,
which may contain further information.
2023-02-28 00:34:00 +00:00
github-actions[bot]
3cdd771820
Merge staging-next into staging 2023-02-23 18:01:49 +00:00
Artturin
f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00
Artturin
6f6cc4a22d treewide: use toString on list NIX_CFLAGS_COMPILE
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper
2023-02-22 21:23:04 +02:00
Robert Scott
0eedcfc3f4
Merge pull request #212498 from risicle/ris-fortify3
hardening flags: add `FORTIFY_SOURCE=3` support
2023-02-16 21:19:30 +00:00
Sergei Trofimovich
b9a9dfc3d4 binutils: consolidate plugin-api.h support in a single
I got the plugin API support at least once incorrect. Instead of
copying the deifnition let's consolidate it within binutils itself.

While at it forward-ported changes to llvm_{13,14,15}.
The change is a no-op from rebuild perspective.
2023-01-30 22:23:36 +00:00
Sergei Trofimovich
0ba9da441d
Merge pull request #211126 from trofi/binutils-update
binutils: 2.39 -> 2.40
2023-01-29 09:50:57 +00:00
Robert Scott
74ea4fe24f llvm*Packages.clang: mark hardeningUnsupportedFlags fortify3
it's very unclear what the status of FORTIFY_SOURCE=3 support
in clang is
2023-01-24 21:52:11 +00:00
Alyssa Ross
2ae30c9f45 llvmPackages: use libcxxrt on FreeBSD
FreeBSD doesn't use LLVM's cxxabi implementation, for backwards
compatibility reasons.  Software expects the libcxxrt API when
building on FreeBSD.  This fixes the build of
pkgsCross.x86_64-freebsd.boost.
2023-01-24 21:18:39 +00:00
sternenseemann
eb4d3bc796 lib.teams.llvm: create
As a first stop towards getting a bit more organized for #171047, add a
maintainer team and add myself and John Ericson as new members. Michael
Raskin asked to be removed.

A second step could be creating a github team additionally.
2023-01-22 01:28:16 +01:00
Sergei Trofimovich
8f947e417f pkgsCross.wasi32.pkgsBuildTarget.llvm_{{5,12},git}: disable gold plugin on wasi
In https://github.com/NixOS/nixpkgs/pull/211126 I simplified `binutils`
and `libbfd` derivations to follow upstream binutils build system
closer. As a result of `./configure --target=wasm32-unknown-wasi`
`binutils` does not install plugin headers by default.

This causes `pkgsCross.wasi32.llvm_12` (used by `firefox`) to fail the
build as:

    [ 81%] Building CXX object tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o
    /build/llvm/tools/gold/gold-plugin.cpp:38:10: fatal error:
        plugin-api.h: No such file or directory
       38 | #include <plugin-api.h>
          |          ^~~~~~~~~~~~~~

The change accomodates this constraint to disable plugin support for
`wasi` targets.
2023-01-18 22:04:41 +00:00
Rick van Schijndel
9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00
Martin Weinelt
fe8eef1ae4 Merge remote-tracking branch 'origin/master' into staging-next 2022-12-04 22:06:42 +01:00
Sandro
cb170c2cfc
Merge pull request #193004 from ShamrockLee/clang-mainprogram 2022-12-04 20:01:46 +01:00
Vladimír Čunát
9ab35fe3ad
Merge #201268: libcxx: link correct libcxxabi version
...into staging
2022-11-28 10:00:21 +01:00
github-actions[bot]
e31b8a36d7
Merge staging-next into staging 2022-11-23 00:02:46 +00:00
Josh Channings
2252245f92 llvm: Find otool bin from targetPrefix
This is to fix the stdenvBootstrapTools issue where otool & others are
not available in PATH, but only under the targetPrefix.
2022-11-22 21:37:47 +00:00
Artturi
006c56abc4
Merge pull request #197674 from squalus/openmp-cross
openmp: fix cross compile
2022-11-22 23:29:54 +02:00
Josh Channings
252ea6511d libcxxabi: Skip dylib fixups for version symlinks
Apart from being a no-op, this seems to cause the install to make a
copy, rather than keeping the symlinks intact.
2022-11-22 19:22:18 +00:00
Josh Channings
67f11a2185 libcxx: Link libc++.dylib to matching libc++abi.dylib
Same adjustment as made for libc++abi in #185766, for the same reason:
the unamended dylib links to the libc++abi in the build stdenv, which
is the wrong version.

Tested on Darwin with LLVM 14 stdenv, but the phase is added to all
versions, including 11 - so this will cause a mass rebuild.

See: https://github.com/NixOS/nixpkgs/pull/185766
2022-11-22 19:22:18 +00:00
7c6f434c
5559f2b772
Merge pull request #199844 from vincentbernat/fix/git-clang-format
llvmpackages: patch shebangs for python subpackages
2022-11-15 21:41:58 +00:00
Vincent Bernat
ad5aecbb6b llvmpackages: patch shebangs for python subpackages
Notably, "git-clang-format" fails with:

    /usr/bin/env: ‘python’: No such file or directory
2022-11-06 12:56:47 +01:00
John Ericson
0afe9d1f70 freebsd packages: Init at 13.1
Always set `SRCTOP`, set it with abs path

llvmPackages: Bump minimum version for FreeBSD

llvmPackages_*, libgcc, compiler_rt: Hack in enough libs that one can compiler C

freebsd.compat: Rename some things to work around cc-wrapper change

0bea4a194f / #191724 in particular
2022-11-04 16:50:26 -04:00
squalus
4b07aeae16 openmp: fix cross compile 2022-10-24 23:47:27 -07:00
toonn
6a132cf2f3
Merge pull request #185766 from stephank/fix/libcxxabi
libcxxabi: remove link with build libcxxabi
2022-10-05 12:58:32 +02:00
Shamrock Lee
8afdfd9e64 clang: specify meta.mainProgram 2022-09-23 01:55:21 +08:00
Bernardo Meurer
ee33222938
Merge pull request #188540 from OPNA2608/fix/llvm-parallel-tests
llvm*: Fix core usage & remove progress bar in tests
2022-09-07 12:29:53 -03:00
OPNA2608
bd332c848c llvm*: Don't show progress bar on tests
Since the progress bar results in large output that is broken due to the use of
ncurses and we already use the flag that gives verbose output on test failures,
let's just disable the progress bar.
2022-09-03 18:38:44 +02:00
OPNA2608
6c6f4a9724 llvm*: Fix core usage in tests
lit (LLVM Integrated Tester) [0] by default uses as many threads as the build host
has cores, ignoring the user's core settings for the build.
This passes the configured core count on to lit, along with LLVM's default
settings for it which we otherwise override in the process [1].

[0]: https://www.llvm.org/docs/CommandGuide/lit.html
[1]: 329fda39c5/llvm/CMakeLists.txt (L559-L565)
2022-09-03 17:20:46 +02:00
Stéphan Kochen
96e4a0f05c libcxxabi: remove link with build libcxxabi 2022-08-26 17:02:11 +02:00
John Ericson
dbc5a792a2 llvmPackages*.libunwind: Don't redo install phase from scratch
I can't think of any good reason it was the way it was before. I think
CMake can be made to install the headers too, but this is a fine first
step.
2022-08-18 00:10:08 -04:00
sternenseemann
0083a683d7 Revert "llvmPackages: do not include static archives when shared…"
Reverts #162607 / 1748887ff2.

Reason for revert: This change caused llvm-config{,-native} to be unable
to find static archives bundled with LLVM, as has been [reported]. Ever
since #152944 using moveToOutput in LLVM is _evil_ because llvm-config
obtains it knowledge about the installation locations from the CMake
configure step.

Consequently a change like #162607 will need to be implemented by making
LLVM itself install the static archives to the correct location or by
adding yet another patch which updates llvm-config's knowledge of the
location. The latter is not desireable in my opinion, though, since it
is just asking for this sort of trouble: Before #152944 we had an
outputs.patch that did this sort of things which broke spectacularly in
edge cases.

Fixes #148117.

[reported]: https://github.com/NixOS/nixpkgs/issues/148117#issuecomment-1158245576
2022-07-05 15:03:12 +02:00
Rick van Schijndel
0b45cae8a3
treewide: pkgs/development/compilers: mark broken for darwin 2022-05-30 13:41:09 +02:00
Lassulus
a1780e4b7d
Merge pull request #162607 from waldheinz/libllvm-drop-static
llvmPackages/libllvm: do not include static archives when shared is r…
2022-04-08 19:39:18 +01:00
Aleksey Kladov
6d111cbf61 Clarify that lld package provides unwrapped lld
lld package provides an unwrapped lld. It doesn't always work on NixOS
(eg, it doesn't set rpath), and so dosen't always work.

What one should be using instead is the `lld` from
`llvmPackages.bintools` package. This super counterintutive.

One incremental step we can take here is to clarify that the `lld`
package is unrwapped -- right now, it looks like 100% legit thing one
should be using!
2022-03-27 18:14:55 -04:00
Matthias Treydte
1748887ff2 llvmPackages/libllvm: move static archives to dev output
Reduces closure size by ~240MiB (down to ~100MiB) for
LLVM 13, the others are similar.

Having those archives in the lib output makes no sense
as they are no runtime dependencies. Removing them
alltogether is also not an option because the dynamic
libraries offer only the C API while many users of
libllvm require the C++ API. Those users must have an
dependency on libllvm.dev anyway and will find those
files for linking.
2022-03-04 13:05:53 +01:00
John Ericson
baf290023c
Merge pull request #153790 from sternenseemann/cross-bootstrap-logic
Cross bootstrapping logic fixes benefitting llvmPackages
2022-01-08 12:39:30 -08:00
sternenseemann
e238f456b8 llvmPackages_*.clang: pick clangUseLLVM if targetPlatform.useLLVM
libcxxClang still depends on cc wrapper's gccForLibs for libgcc which is
not available when useLLVM is set. In such cases we need to switch to
clangUseLLVM and (try) to use compiler-rt instead.

Resolves #153759: pkgsLLVM.llvmPackages.stdenv now correctly
clangUseLLVM as cc, allowing compilation to work as expected.
2022-01-07 14:52:13 +01:00
sternenseemann
766f5ffb76 llvmPackages_*: respect cc for target when choosing C++ flavour
llvmPackages_*.clang should check the default compiler for the package
set it is targeting (targetPackages.stdenv.cc) instead of the compiler
that has been used to build it (stdenv.cc) in order to get some sense of
whether to use libc++ or libstdc++.

Since we are now inspecting targetPackages in the llvmPackages.clang
attribute, we need to avoid using it in the cross stdenv — which just
forces us to explicitly request libcxxClang for darwin instead of
relying on the clang attribute to pick it for us.

We also need to do something similar for targetPackages.stdenv.cc: Here
the llvmPackages.clang logic would work as we want (inspect
targetPackages.stdenv.cc and if it doesn't exist, make the choice based
on stdenv.cc), but it gets locked in a cycle with the previous package.
We can easily break this, however: We know that the previous set had
clang and the next one doesn't exist, so we'd choose libcxxClang any day
of the week.
2022-01-07 14:42:41 +01:00
sternenseemann
e5ccc412d2 llvmPackages_*.libllvm: only build tests if doCheck
To make the value of doCheck in the argument attribute set accurate we
also need to include the condition for cross compilation which normally
is added by stdenv.mkDerivation.
2022-01-04 18:40:32 +01:00