freeebsd: Fix cross compilation (#456250)

This commit is contained in:
John Ericson
2025-11-01 06:37:46 +00:00
committed by GitHub
2 changed files with 25 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
{
lib,
stdenv,
fetchpatch,
mkDerivation,
libcMinimal,
include,
@@ -32,6 +33,19 @@ mkDerivation {
libgcc
];
patches = [
# https://github.com/freebsd/freebsd-src/pull/1882
(fetchpatch {
name = "freebsd-libthr-use-nonstring-attribute.patch";
url = "https://github.com/freebsd/freebsd-src/pull/1882/commits/650800993deb513dc31e99ef5cdecd50ee70bb04.diff";
hash = "sha256-WKN7dfGAs1+XADT4aLUkkKmQQ4n7gsyFUTCeo6mcuMY=";
includes = [ "lib/libthr/thread/thr_printf.c" ];
})
];
# Presumably newer Clang has gotten more strict.
CWARNEXTRA = "-Wno-cast-function-type-mismatch";
preBuild = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib"
'';

View File

@@ -1,5 +1,6 @@
{
mkDerivation,
fetchpatch,
include,
rpcgen,
flex,
@@ -30,6 +31,16 @@ mkDerivation {
]
++ extraSrc;
patches = [
# https://github.com/freebsd/freebsd-src/pull/1882
(fetchpatch {
name = "freebsd-rtld-use-nonstring-attribute.patch";
url = "https://github.com/freebsd/freebsd-src/pull/1882/commits/650800993deb513dc31e99ef5cdecd50ee70bb04.diff";
hash = "sha256-V9jDE/5Fu6hLIzlG1e6AqLnGwlzW2OjonyUgvSVtm58=";
includes = [ "libexec/rtld-elf/rtld.c" ];
})
];
outputs = [
"out"
"man"