stdenv/freebsd: upgrade to modern llvm to fix FreeBSD 15 build
Also do some other misc modernization
This commit is contained in:
@@ -99,12 +99,11 @@ let
|
||||
"lib/clang"
|
||||
];
|
||||
# SYNCME: this version number must be synced with the one in make-bootstrap-tools.nix
|
||||
version = "18";
|
||||
version = "21";
|
||||
};
|
||||
libunwind = linkBootstrap {
|
||||
name = "libunwind";
|
||||
paths = [
|
||||
"lib/libunwind.a"
|
||||
"lib/libunwind.so"
|
||||
"lib/libunwind.so.1"
|
||||
"lib/libunwind.so.1.0"
|
||||
@@ -291,6 +290,7 @@ let
|
||||
};
|
||||
freebsd = {
|
||||
locales = linkBootstrap { paths = [ "share/locale" ]; };
|
||||
libiconvModules = linkBootstrap { paths = [ "lib/i18n" ]; };
|
||||
libc = linkBootstrap {
|
||||
name = "bootstrapLibs";
|
||||
paths = [
|
||||
@@ -303,16 +303,12 @@ let
|
||||
"lib/crtendS.o"
|
||||
"lib/crti.o"
|
||||
"lib/crtn.o"
|
||||
"lib/libc++.a"
|
||||
"lib/libc++.so"
|
||||
"lib/libc++.so.1"
|
||||
"lib/libc.a"
|
||||
"lib/libc.so"
|
||||
"lib/libc.so.7"
|
||||
"lib/libc_nonshared.a"
|
||||
"lib/libcrypt.so"
|
||||
"lib/libcrypt.so.5"
|
||||
"lib/libcxxrt.a"
|
||||
"lib/libcxxrt.so"
|
||||
"lib/libcxxrt.so.1"
|
||||
"lib/libdevstat.so"
|
||||
@@ -329,11 +325,10 @@ let
|
||||
"lib/libgcc_s.so.1"
|
||||
"lib/libkvm.so"
|
||||
"lib/libkvm.so.7"
|
||||
"lib/libm.a"
|
||||
"lib/libm.so"
|
||||
"lib/libm.so.5"
|
||||
"lib/libmd.so"
|
||||
"lib/libmd.so.6"
|
||||
"lib/libmd.so.7"
|
||||
"lib/libncurses.so"
|
||||
"lib/libncurses.so.6"
|
||||
"lib/libncursesw.so"
|
||||
@@ -344,7 +339,7 @@ let
|
||||
"lib/libthr.so"
|
||||
"lib/libthr.so.3"
|
||||
"lib/libutil.so"
|
||||
"lib/libutil.so.9"
|
||||
"lib/libutil.so.10"
|
||||
"lib/libxnet.so"
|
||||
"include"
|
||||
"share"
|
||||
@@ -459,8 +454,6 @@ let
|
||||
export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
|
||||
export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
|
||||
export PATH_LOCALE=${prevStage.freebsd.localesReal or prevStage.freebsd.locales}/share/locale
|
||||
''
|
||||
+ lib.optionalString (prevStage.freebsd ? libiconvModules) ''
|
||||
export PATH_I18NMODULE=${prevStage.freebsd.libiconvModules}/lib/i18n
|
||||
'';
|
||||
};
|
||||
@@ -589,7 +582,10 @@ in
|
||||
__bootstrapArchive = bootstrapArchive;
|
||||
fetchurl = prevStage.fetchurlReal;
|
||||
freebsd = super.freebsd.overrideScope (
|
||||
self': super': { localesPrev = prevStage.freebsd.localesReal; }
|
||||
self': super': {
|
||||
inherit (prevStage.freebsd) libc;
|
||||
localesPrev = prevStage.freebsd.localesReal;
|
||||
}
|
||||
);
|
||||
};
|
||||
})
|
||||
|
||||
@@ -46,6 +46,8 @@ let
|
||||
mkdir = runCommand "mkdir" { coreutils = coreutils-big; } ''
|
||||
mkdir -p $out/bin
|
||||
cp $coreutils/bin/mkdir $out/bin
|
||||
cp $coreutils/bin/cp $out/bin
|
||||
cp $coreutils/bin/mv $out/bin
|
||||
'';
|
||||
in
|
||||
rec {
|
||||
@@ -58,13 +60,13 @@ rec {
|
||||
gnutar
|
||||
])
|
||||
''
|
||||
rm -rf include lib/*.a lib/i18n lib/bash share
|
||||
rm -rf include lib/*.a lib/bash share
|
||||
'';
|
||||
bootstrap-tools = tar-all "bootstrap-tools.tar.xz" (
|
||||
with pkgs;
|
||||
# SYNCME: this version number must be synced with the one in default.nix
|
||||
let
|
||||
llvmPackages = llvmPackages_18;
|
||||
llvmPackages = llvmPackages_21;
|
||||
in
|
||||
[
|
||||
(runCommand "bsdcp" { } "mkdir -p $out/bin; cp ${freebsd.cp}/bin/cp $out/bin/bsdcp")
|
||||
@@ -84,14 +86,16 @@ rec {
|
||||
gzip
|
||||
bzip2
|
||||
bzip2.dev
|
||||
curl
|
||||
# We don't use wcurl, and it uses shebangs for the build system when cross-compiling.
|
||||
# That pollutes the bootstrap tarballs and prevents it from working.
|
||||
(curl.overrideAttrs (old: {
|
||||
postFixup = "rm $bin/bin/wcurl";
|
||||
}))
|
||||
expand-response-params
|
||||
binutils-unwrapped
|
||||
freebsd.libc
|
||||
llvmPackages.libcxx
|
||||
llvmPackages.libcxx.dev
|
||||
llvmPackages.compiler-rt
|
||||
llvmPackages.compiler-rt.dev
|
||||
stdenv.cc.libcxx
|
||||
stdenv.cc.libcxx.dev
|
||||
llvmPackages.clang-unwrapped
|
||||
(freebsd.locales.override { locales = [ "C.UTF-8" ]; })
|
||||
]
|
||||
|
||||
@@ -6,7 +6,9 @@ BADLIST=ld-elf.so.1
|
||||
|
||||
oobpatch() {
|
||||
$out/libexec/ld-elf.so.1 $src/bin/cp $1 ./tmp
|
||||
$out/libexec/ld-elf.so.1 $out/bin/patchelf --set-rpath $out/lib --set-interpreter $out/libexec/ld-elf.so.1 ./tmp
|
||||
$out/libexec/ld-elf.so.1 $out/bin/patchelf --set-rpath $out/lib ./tmp
|
||||
# This will fail for libraries, but we don't have set -e so it's fine
|
||||
$out/libexec/ld-elf.so.1 $out/bin/patchelf --set-interpreter $out/libexec/ld-elf.so.1 ./tmp
|
||||
$out/libexec/ld-elf.so.1 $src/bin/mv ./tmp $1
|
||||
BADLIST="$BADLIST|${1##*/}"
|
||||
}
|
||||
@@ -14,6 +16,9 @@ oobpatch() {
|
||||
oobpatch $out/bin/patchelf
|
||||
oobpatch $out/lib/libthr.so.3
|
||||
oobpatch $out/lib/libc.so.7
|
||||
oobpatch $out/lib/libgmp.so.10
|
||||
oobpatch $out/lib/librt.so.1
|
||||
oobpatch $out/lib/libsys.so.7
|
||||
|
||||
for f in $($out/libexec/ld-elf.so.1 $out/bin/find $out/lib -type f); do
|
||||
$out/libexec/ld-elf.so.1 $out/bin/grep -E "$BADLIST" <<<"$f" && continue
|
||||
|
||||
Reference in New Issue
Block a user