Commit Graph

84 Commits

Author SHA1 Message Date
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
Lily Foster
e58eaa0ee9
llvmPackages_{15,16}: fix libcxxabi -fno-exceptions build for wasm 2023-11-08 13:51:49 -05:00
Vladimír Čunát
6d408ebbe5
Merge #255706: llvmPackages_{15,16}.llvm: skip googletest-timeout lit test
...into staging
2023-09-28 08:53:52 +02:00
Robert Scott
23375e8231 llvmPackages_15.llvm: skip googletest-timeout lit test
timing-based tests can cause trouble on loaded or slow machines
2023-09-17 17:24:42 +01:00
Sandro Jäckel
fccf04b620 treewide: replace -DCMAKE_BUILD_TYPE in cmakeFlags with cmakeBuildType 2023-09-08 14:18:26 +00:00
github-actions[bot]
d987b47512
Merge master into staging-next 2023-09-08 06:00:58 +00:00
Rahul Butani
0251e2645a llvmPackages_15.libcxx: fix the generated linker script
See:
 - https://github.com/NixOS/nixpkgs/issues/214524#issuecomment-1429146432
 - 57c7bb3ec8
 - https://reviews.llvm.org/D133566

We can drop this patch in `llvmPackages_16`.

Fixes #214524.
2023-09-08 05:41:29 +03:00
github-actions[bot]
204bfce523
Merge staging-next into staging 2023-09-07 00:02:49 +00:00
Artturi
de42a231a4
Merge pull request #236203 from SharzyL/llvm_no_extend 2023-09-06 23:44:14 +03:00
Artturi
872e54e9e7
Merge pull request #253533 from Artturin/llvmusesuball 2023-09-06 21:17:12 +03:00
Artturi
0d16a6b6a5
Merge pull request #253573 from Artturin/llvmdedup2 2023-09-06 21:15:53 +03:00
Artturin
d7d68a1a04 llvmPackages.lldb: remove unnecessary inherit
release_version is provided with callPackage
2023-09-06 20:23:43 +03:00
Artturin
ea946c7423 llvmPackages.libcxxabi: dedupe wasm.patch
found with fdupes

```
pkgs/development/compilers/llvm/8/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/13/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/14/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/10/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/15/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/12/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/9/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/16/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/git/libcxxabi/wasm.patch
pkgs/development/compilers/llvm/11/libcxxabi/wasm.patch
```
2023-09-06 19:16:28 +03:00
Artturin
91089054d4 llvmPackages.bintools-unwrapped: deduplicate 2023-09-06 03:59:37 +03:00
Artturin
9809024653 llvmPackages.lldb: use substituteAll 2023-09-06 01:05:32 +03:00
Raito Bezarius
56bb8b73a6 llvmPackages_15.libcxxabi: fix build on Linux and Darwin
The previous fix in 314584b2 broke *-linux.
2023-08-26 12:18:45 +02:00
Randy Eckenrode
314584b222
llvmPackages_15.libcxxabi: fix build on Darwin 2023-08-24 18:28:16 -04:00
Peter Waller
6ba1b5b0b3 llvmPackages_15, llvmPackages_16: Make the pkgsLLVM.stdenv work
What changed:

* Fixed crtbeginS.o and crtendS.o missing
  (they may or may not be called crt{begin_end},{,_shared}.

* Fixed implicit function declaration causing build errors for various
  builds by supplying -Wno-implicit-function-declaration.

* Fixed __cxxabi_config.h missing, by adding -I${cxxabi}/include/c++/v1
  in the wrapper.

* Fixed libcxx failing to build due to missing libunwind symbols by
  including libunwind as a buildInput, and setting
  -DLIBCXX_ADDITIONAL_LIBRARIES=unwind for stdenv.hostPlatform.useLLVM == true.

* libcxxabi wants to find libunwind at libunwind_shared.so, so symlink
  it there in libunwind.

* llvmPackages_16.libcxxabi: Pass -nostdlib via CMAKE_*_LINKER_FLAGS

  Without this flag, the link of libcxxabi.so tries to pull in libgcc and
  friends, from the clang compiler driver.

* Drop unneeded musl hack patch from libcxx.

* Pass -Wno-error=implicit-function-declaration only to compiler-rt

  See LLVM forum discussion:

  https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213

  In summary, LLVM 16 made implicit function declaration an error. This
  happens a lot in configure scripts which can break things.

* llvmPackages_16: !isDarwin: Supply -DLIBCXX_ABI_USE_LLVM_UNWINDER=On

  Otherwise it fails with various undefined references to _Unwind_*
  functions: (full list: _Unwind_DeleteException _Unwind_GetIP
  _Unwind_GetLanguageSpecificData _Unwind_GetRegionStart
  _Unwind_RaiseException _Unwind_Resume _Unwind_SetGR _Unwind_SetIP).

* 16.libcxxabi: Only pass -nostdlib for useLLVM and Darwin builds

What was tested:

* x86_64-linux, aarch64-linux, the stdenv builds.
  * Additionally I was able to get nix to build, with an overlay to fix
    a couple of minor issues in downstream packages (overlay supplied in
    PR #246577.

* aarch64-darwin fails spuriously in a single LLVM test
  strip-preserve-atime.test checking atime timestamps.

* The same for pkgsLLVM with llvmPackages = llvmPackages_15.

Signed-off-by: Peter Waller <p@pwaller.net>
2023-08-22 17:33:24 +01:00
Artturi
289d9cf8a7
Merge pull request #230387 from Artturin/llvmsplit1 2023-06-20 16:43:41 +03:00
SharzyL
39cabe4c89
llvmPackages: remove extend attribute 2023-06-06 13:08:40 +08:00
Artturin
d53d5a8b38 llvmPackages.lldb: deduplicate >10 2023-05-09 19:59:45 +03:00
github-actions[bot]
54295bf976
Merge staging-next into staging 2023-05-08 18:02:09 +00:00
fetsorn
91e7191660 llvm: fix typos
"verion" -> "version"
2023-05-08 21:05:07 +04:00
github-actions[bot]
cfd87655c8
Merge staging-next into staging 2023-05-05 18:01:52 +00:00
github-actions[bot]
c0860aa88a
Merge master into staging-next 2023-05-05 18:01:12 +00:00
Domen Kožar
6cf7bb9998
Merge pull request #225197 from stephank/feat/swift58
swift: 5.7.3 -> 5.8
2023-05-05 13:58:07 +01:00
Alyssa Ross
776ba7a410 llvm_15: backport patch for musl 1.2.4 2023-05-03 09:37:13 +00:00
Stéphan Kochen
c96a05a293 llvmPackages_15.compiler-rt: fix missing builtins
Darwin-specific builtins were present on x86-64-darwin, but not on
aarch64-darwin. This is the same issue as #186575, but while the fixes
were correctly applied to LLVM 15, we were still disabling the build of
builtins on aarch64-darwin. Likely just a confusion.
2023-04-30 15:03:19 +02: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
Alyssa Ross
3e0cb1ab7d compiler-rt: use -ffreestanding when no libc
This fixes building for x86_64-windows with no libc (for UEFI).
Otherwise, it would try to include a malloc header.
2023-04-28 10:01:22 +00:00
Adam Joseph
2e77eb8190 clang_15: fix build!=(host==target) cross compilation
clang_15 appears to not cross compile in the build!=(host==target)
case due to two problems, which this commit fixes:

- It trips -Wmaybe-uninitialized on recent gcc, but only in the
  build!=host case (likely due to #ifdefs)

- Two more buildPlatform tools have been added:
  clang-tidy-confusable-chars-gen and clang-pseudo-gen

Co-authored-by: Rahul Butani <rrbutani@users.noreply.github.com>
2023-04-19 01:06:08 +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
John Ericson
975e73668f
Merge pull request #219356 from alyssais/llvm-platforms
llvm: tighten platforms
2023-03-10 08:33:29 -05: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
Martin Weinelt
0580d85143 Merge remote-tracking branch 'origin/staging-next' into staging 2023-03-03 04:46:31 +01:00
Alyssa Ross
9bfc5871c1 llvmPackages_15.compiler-rt: drop codesign patch
This was added in 00839fea22 ("llvmPackages_15.compiler-rt: fixes for Darwin"),
which says:

> this introduces a codesigning related patch that we can drop once
> #195107 goes through

The referenced PR ("sigtool: 0.1.2 → 0.1.3") has now been merged, so
I'm dropping the patch as instructed.
2023-03-02 12:36:21 +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
ed209e6279 clang_15: mark hardeningUnsupportedFlags fortify3
Port of 74ea4fe24f ("llvm*Packages.clang: mark
hardeningUnsupportedFlags fortify3").
2023-02-28 10:53:33 +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
Alyssa Ross
e731fba414 llvmPackages_git.compiler-rt: fix armv7l patch
Use the same patch as compiler-rt 15.
2023-02-27 10:56:20 +00:00
Alyssa Ross
1e26d33371 clang_15: add nostdlibinc flag
Port of 44165d3657 ("llvmPackages_{14, git}.clang: add nostdlibinc flag")
to Clang 15.  It was originally thought this wasn't needed[1], but it is,
to fix expressions like the following:

	with import ./. {};

	llvmPackages_15.libcxxStdenv.mkDerivation {
	  name = "libcxx-stdenv-c++-test";

	  dontUnpack = true;

	  input = ''
	    #include <cstdlib>

	    int main() {
	        std::abort();
	        return 0;
	    }
	  '';
	  passAsFile = [ "input" ];

	  installPhase = ''
	    $CXX -c -o $out -x c++ $inputPath
	   '';
	}

[1]: https://github.com/NixOS/nixpkgs/pull/194634#issue-1398202534
2023-02-26 13:40:24 +00:00
Alyssa Ross
f9afd57302 Revert "llvmPackages_15: update licenses"
This reverts commit 386aba3115.

As I understand it from reading
<https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents>,
the structure of LLVM licensing is as follows:

 - They're in the process of relicensing to Apache-2.0 WITH LLVM-exception,
   but they haven't got permission to relicense all the code yet.
   This means that some of the code can be used under the new license,
   but not all of it, and it's difficult to know which is which.  This
   license is therefore probably not useful yet, until the relicensing
   effort is commit.

 - While the relicensing effort is ongoing, code being contributed to
   LLVM has to have permission to be used under the old and new
   licensing schemes.  Since the new licensing scheme can't be used
   for all code yet, it only makes sense to use LLVM's code under the
   old licensing scheme at the moment.

 - The old licensing scheme is that code for the LLVM components we
   care about is all available under the NCSA license, and some
   components are optionally available under a different license,
   usually the MIT license, instead.

So I think we should go back to just listing NCSA, or NCSA/MIT, and
forget about the new license until it actually becomes useful,
i.e. LLVM's relicensing effort is complete.
2023-02-24 00:06:46 +00:00
Alyssa Ross
7ce8e7c4cf lib.licenses.asl20-llvm: replace llvm-exception
LLVM-exception only makes sense when used with the Apache 2.0 license,
so let's combine them, so it's not possible to forget one of them like
happened with llvm_15.
2023-02-23 17:42:15 +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