Commit Graph

87 Commits

Author SHA1 Message Date
Audrey Dutcher
e49098e99d llvmPackages: add support for native FreeBSD
* asan doesn't work quite right, disable it
* support for 32-bit FreeBSD uses by default logic tuned for a very old
  FreeBSD; fix that
* Some llvm tests fail for the same reason as MacOS; disable them
* libcxx no longer needs a FreeBSD special case
* Add an option to conditionally disable terminfo. terminfo doesn't seem
  to cross-compile static for FreeBSD, which means that it needs to be
  disabled when building the very early FreeBSD bootstrap tools.

Co-authored-by: John Ericson <git@JohnEricson.me>
2024-05-17 14:19:37 -07:00
github-actions[bot]
9c36f57e91
Merge staging-next into staging 2024-04-22 06:01:32 +00:00
Randy Eckenrode
99df680e03
llvmPackages_{12,13,14,15,16,17,18,git}: use fixpoint instead of rec
Currently, overriding llvmPackages.libllvm doesn’t work correctly. The
original version of libllvm will also be built because it is referenced
by libclang. Switching to the fixpoint allows the override to be
propagated to clang as expected. This will be needed for future Darwin
stdenv bootstrap improvements.
2024-04-21 20:52:37 -04:00
Tristan Ross
2941e51966
llvmPackages_{12,13,14,15,16,17,18,git}: use common llvm 2024-04-13 19:57:49 -07:00
Tristan Ross
dc4d5c2193
llvmPackages_{12,13,14,15,16,17,18,git}: use common clang 2024-04-13 19:01:42 -07:00
Weijia Wang
e65e742588
Merge pull request #303449 from ExpidusOS/feat/llvm-git-commonify-libcxx
llvmPackages_{12,13,14,15,16,17,18,git}: use common libcxx
2024-04-13 16:31:35 +02:00
Weijia Wang
8a26b55947
Merge pull request #303479 from ExpidusOS/feat/llvm-git-commonify-compiler-rt
llvmPackages_{12,13,14,15,16,17,18,git}: use common compiler-rt
2024-04-13 16:31:02 +02:00
Tristan Ross
782fc2ebac
llvmPackages_{12,13,14,15,16,17,18,git}: use common libcxx 2024-04-12 15:50:13 -07:00
Tristan Ross
1572ec6bb1
llvmPackages_{12,13,14,15,16,17,18,git}: use common lld 2024-04-12 13:57:50 -07:00
Weijia Wang
ded11d6ffe
Merge pull request #303447 from ExpidusOS/feat/llvm-git-commonify-libunwind
llvmPackages_{12,13,14,15,16,17,18,git}: use common libunwind
2024-04-12 22:55:30 +02:00
Weijia Wang
792acac153
Merge pull request #303448 from ExpidusOS/feat/llvm-git-commonify-openmp
llvmPackages_{12,13,14,15,16,17,18,git}: use common openmp
2024-04-12 22:47:24 +02:00
Tristan Ross
312264686e
llvmPackages_{12,13,14,15,16,17,18,git}: use common compiler-rt 2024-04-12 13:38:29 -07:00
Tristan Ross
8c71431f14
llvmPackages_{12,13,14,15,16,17,18,git}: use common openmp 2024-04-12 07:22:03 -07:00
Tristan Ross
ae92b08fd4
llvmPackages_{12,13,14,15,16,17,18,git}: use common libunwind 2024-04-11 22:54:11 -07:00
edef
725bb4e48c lib: add xor
This gets clumsily reimplemented in various places, to no useful end.
2024-04-04 19:46:58 +00:00
annalee
5b1b33f069
llvmPackages_{12,13,14,15,16,17,git}.libcxx: add LIBCXXABI_USE_COMPILER_RT=ON
since https://github.com/NixOS/nixpkgs/pull/292043 libcxxabi is built
using the same compiler wrapper as libcxx and thus uses the
`-rtlib=compiler-rt`. Adding the `LIBCXXABI_USE_COMPILER_RT=ON` at build
time ensures that the compiler-rt libraries provided at link time
resolving symbol errors for aarch64 pkgLLVM.libcxx build

https://hydra.nixos.org/build/253162977
2024-03-21 09:11:27 +00:00
Martin Weinelt
3321e63b12
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/sphinx-autobuild/default.nix
2024-03-19 04:00:32 +01:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00
a-n-n-a-l-e-e
ce789e7e35
llvmPackages_{12,13,14,15,16,17,git}.{libcxx,libcxxabi}: merge libcxxabi into libcxx (#292043)
- merge libcxxabi into libcxx for LLVM 12, 13, 14, 15, 16, 17, and git.
- remove the link time workaround `-lc++ -lc++abi` from 58 packages as it is no longer required.
- fixes https://github.com/NixOS/nixpkgs/issues/166205
- provides alternative fixes for. https://github.com/NixOS/nixpkgs/issues/269548 https://github.com/NixOS/nix/issues/9640
- pkgsCross.x86_64-freebsd builds work again

This change can be represented in 3 stages
1. merge libcxxabi into libcxx -- files: pkgs/development/compilers/llvm/[12, git]/{libcxx, libcxxabi}
2. update stdenv to account for merge -- files: stdenv.{adapters, cc.wrapper, darwin}
3. remove all references to libcxxabi outside of llvm (about 58 packages modified)

### merging libcxxabi into libcxx
- take the union of the libcxxabi and libcxx cmake flags
- eliminate the libcxx-headers-only package - it was only needed to break libcxx <-> libcxxabi circular dependency
- libcxx.cxxabi is removed. external cxxabi (freebsd) will symlink headers / libs into libcxx.
- darwin will re-export the libcxxabi symbols into libcxx so linking `-lc++` is sufficient.
- linux/freebsd `libc++.so` is a linker script `LINK(libc++.so.1, -lc++abi)` making `-lc++` sufficient.
- libcxx/default.nix [12, 17] are identical except for patches and `LIBCXX_ADDITIONAL_LIBRARIES` (only used in 16+)
- git/libcxx/defaul.nix  does not link with -nostdlib when useLLVM is true so flag is removed. this is not much different than before as libcxxabi used -nostdlib where libcxx did not, so libc was linked in anyway.

### stdenv changes
- darwin bootstrap, remove references to libcxxabi and cxxabi
- cc-wrapper: remove c++ link workaround when libcxx.cxxabi doesn't exist (still exists for LLVM pre 12)
- adapter: update overrideLibcxx to account for a pkgs.stdenv that only has libcxx

### 58 package updates
- remove `NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}` as no longer needed
- swift, nodejs_v8 remove libcxxabi references in the clang override

https://github.com/NixOS/nixpkgs/pull/292043
2024-03-11 03:53:37 -07:00
Philip Taron
7201396492
llvm: stop running strip-preserve-atime.test
This test fails in the presence of anti-virus software or other
intrusion-detection software that modifies the atime when run.

See nixos/nixpkgs#284056 and llvm/llvm-project#82372.
2024-03-07 06:18:50 -08:00
Alyssa Ross
ee9c2b7c6a llvmPackages_16.mlir: init
The Nixpkgs release code generates a list of attributes on
x86_64-linux, then tries to evaluate them on all platforms.  This
meant that Darwin evals broke when llvmPackages was bumped to 17 on
Linux, because the list of attributes is evaluated for Linux, finds an
llvmPackages.mlir attribute, then gets an evaluation error when it
tries to evalute that on Darwin.  The easiest fix is to just make sure
an llvmPackages.mlir attribute exists on Darwin too.
2024-03-01 20:59:17 +01:00
Robert Scott
5ddeaeb1fe llvmPackages_*.llvm: disable trivialautovarinit hardening flag 2024-02-24 12:00:10 +00:00
Weijia Wang
bd1607202d
llvmPackages: move patches to proper folders (#287092)
* llvmPackages: move clang-*-LLVMgold-path.patch to common/clang

* llvmPackages: move exegesis-force-bdver2.patch to 9/llvm

* llvmPackages: move llvm-config-link-static.patch to common/llvm

* llvmPackages: move TLI-musl.patch to common/llvm

* llvmPackages: move libcxx-0001-musl-hacks.patch to common/llvm
2024-02-23 05:14:36 +01:00
Robert Scott
be19273a30
Merge pull request #274089 from risicle/ris-zerocallusedregs
cc-wrapper: add `zerocallusedregs` hardening flag, add `pkgsExtraHardening` package set
2024-01-21 13:33:06 +00:00
Robert Scott
506ec38e7f cc-wrapper, clang: use new mechanism to selectively unsupport zerocallusedregs
this allows a compiler derivation to provide a
hardeningUnsupportedFlagsByTargetPlatform passthru attr
that will be called with the targetPlatform to determine
the unsupported hardening flags for that platform.

we can do this because even though a clang compiler is
multi-target by nature, cc-wrapper effectively fixes the
target platform at wrapping time. otherwise we'd have to
sniff the intended target at runtime, which wouldn't
be fun at all.

the advantage of using a new attribute instead of
allowing hardeningUnsupportedFlags to optionally be a
function is that hardeningUnsupportedFlags retains its
simple overriding pattern for simple cases (i.e.
  `(prev.hardeningUnsupportedFlags or []) ++ [ "foo" ]`
) which will continue to work as long as the bottom-most
function of hardeningUnsupportedFlagsByTargetPlatform
falls back to hardeningUnsupportedFlags.
2024-01-21 11:16:07 +00:00
github-actions[bot]
4dea63e421
Merge master into staging-next 2024-01-20 18:01:02 +00:00
Robert Scott
40868719b0 cc-wrapper: add zerocallusedregs hardening flag
this uses the value `used-gpr` which seems to be a commonly
chosen value for general use
2024-01-20 13:48:33 +00:00
Alyssa Ross
c1e6f66dc5 llvmPackages.compiler-rt: mark broken for RISC-V GCC
c33c7c3d5f ("clang_11: Fix RISC-V builds for compiler-rt. (#135718)")
already marked tihs as broken for LLVM 11, but didn't apply the same
change to other affected LLVM versions.
2024-01-20 13:21:24 +01:00
github-actions[bot]
e59c8549eb
Merge staging-next into staging 2024-01-13 18:01:22 +00:00
SharzyL
810cef75ba
llvmPackages_*.clangUseLLVM: add libunwind to lib search path 2024-01-13 11:16:58 +08:00
Nikodem Rabuliński
62cb8f4628
llef: init at unstable-2023-10-18 2024-01-12 20:06:30 +01:00
Ryan Lahfa
cc34adbe66
Merge pull request #280126 from lxsameer/staging
llvm: Avoid cross compiling if the build platform can execute host binaries
2024-01-12 19:25:35 +01:00
a-n-n-a-l-e-e
2ec46240ae
llvmPackages_{15,16,17,git}.libcxx: fix darwin link flags (#278945)
This change applies the upstream PR
https://github.com/llvm/llvm-project/pull/77218 so the same link flags
on darwin are used as when LIBCXX_CXX_ABI=libcxxabi. Specifically, this
adds
"-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
which prevents libcxx from segfaulting on darwin
2024-01-12 08:45:41 -06:00
Sameer Rahmani
a0b4b85bfa
llvm: Avoid cross compiling if the build platform can execute host binaries 2024-01-11 11:00:31 +00:00
Vladimír Čunát
8a839514de
Merge branch 'master' into staging-next 2024-01-04 15:07:44 +01:00
Semion Nadezhdin
622a03c198 llvmPackages_{14,15,16,17,git}.lldb: unify lua and python path patch 2024-01-04 11:00:25 +01:00
Bernardo Meurer
8e5a5551e8
Merge pull request #273788 from sternenseemann/llvmgold-clang-16-and-above 2023-12-22 20:06:56 -03:00
Alyssa Ross
333088006c pkgsLLVM.llvmPackages.compiler-rt: fix for RISC-V
compiler-rt includes <linux/unistd.h> on RISC-V.  This only seems to
be necessary for useLLVM, but looking at the source code I can't
see any reason for that, so probably in the non-useLLVM case it just
gets propagated in.
2023-12-19 11:34:37 +01:00
sternenseemann
3e8355df84 llvmPackages_{16,17,git}: reenable LLVMgold plugin
See https://github.com/nixos/nixpkgs/issues/123361 for context regarding
the clang patch.

Seems like the https://github.com/llvm/llvm-project/issues/61350 crash
no longer occurs in the test suite and we can reenable the gold plugin
by default.
2023-12-12 17:36:20 +01:00
Weijia Wang
f6da64f8db llvmPackages_17.libclc: init 2023-12-12 02:28:36 +01:00
Artturi
1ea40b20f1
Merge pull request #268812 from Artturin/llvmdedup3 2023-11-23 21:00:27 +02:00
Artturin
8b68c650d8 llvmPackages_16.libclc: fix cross eval
libclc was moved in to the set in 223afab31f
2023-11-22 21:50:36 +02:00
Artturin
b59fd202d7 llvmPackages: Remove dead code
for hygiene

Run `deadnix . --edit`

`gccForLibs` is an argument used by multi.nix but it's an argument to
cc-wrapper, not to llvmPackages.

`@args` in `llvm/default.nix` was accidentally added in 4badff49fd

There are no uses of `@` therefore these changes are safe.
2023-11-21 02:05:15 +02:00
Artturin
e6751897e0 llvmPackages: Dedupe monorepoSrc 2023-11-21 01:46:51 +02:00
Artturin
5ac86a99e7 llvmPackages: Dedupe releaseInfo 2023-11-21 01:46:51 +02:00
Artturin
2902f99c57 llvmPackages: Dedupe llvm_meta 2023-11-21 01:46:47 +02:00
Martin Weinelt
c17ba56fe9
Merge pull request #266321 from lilyinstarlight/fix/llvm-16-wasi
[staging-next] llvmPackages: 12 -> 16 on wasm
2023-11-09 16:07:25 +01:00
Lily Foster
e58eaa0ee9
llvmPackages_{15,16}: fix libcxxabi -fno-exceptions build for wasm 2023-11-08 13:51:49 -05:00
Alyssa Ross
772a2502f1
llvmPackages_16.compiler-rt: fix FreeBSD build
The clang_rt.crt* files are only built on Linux (see the
COMPILER_RT_HAS_CRT CMake variable).
2023-11-07 10:01:10 +01:00
Vladimír Čunát
1046dc0255
Merge #263876: pkgsCross.wasi32.stdenv: fix build with LLVM 16
...into staging-next
2023-10-30 07:15:14 +01:00