Skip to content

Commit aa5c0b2

Browse files
authored
freeebsd: Fix cross compilation (#456250)
2 parents 8971ea0 + a22c426 commit aa5c0b2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

pkgs/os-specific/bsd/freebsd/pkgs/libthr.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
lib,
33
stdenv,
4+
fetchpatch,
45
mkDerivation,
56
libcMinimal,
67
include,
@@ -32,6 +33,19 @@ mkDerivation {
3233
libgcc
3334
];
3435

36+
patches = [
37+
# https://github.com/freebsd/freebsd-src/pull/1882
38+
(fetchpatch {
39+
name = "freebsd-libthr-use-nonstring-attribute.patch";
40+
url = "https://github.com/freebsd/freebsd-src/pull/1882/commits/650800993deb513dc31e99ef5cdecd50ee70bb04.diff";
41+
hash = "sha256-WKN7dfGAs1+XADT4aLUkkKmQQ4n7gsyFUTCeo6mcuMY=";
42+
includes = [ "lib/libthr/thread/thr_printf.c" ];
43+
})
44+
];
45+
46+
# Presumably newer Clang has gotten more strict.
47+
CWARNEXTRA = "-Wno-cast-function-type-mismatch";
48+
3549
preBuild = ''
3650
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib"
3751
'';

pkgs/os-specific/bsd/freebsd/pkgs/rtld-elf.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
mkDerivation,
3+
fetchpatch,
34
include,
45
rpcgen,
56
flex,
@@ -30,6 +31,16 @@ mkDerivation {
3031
]
3132
++ extraSrc;
3233

34+
patches = [
35+
# https://github.com/freebsd/freebsd-src/pull/1882
36+
(fetchpatch {
37+
name = "freebsd-rtld-use-nonstring-attribute.patch";
38+
url = "https://github.com/freebsd/freebsd-src/pull/1882/commits/650800993deb513dc31e99ef5cdecd50ee70bb04.diff";
39+
hash = "sha256-V9jDE/5Fu6hLIzlG1e6AqLnGwlzW2OjonyUgvSVtm58=";
40+
includes = [ "libexec/rtld-elf/rtld.c" ];
41+
})
42+
];
43+
3344
outputs = [
3445
"out"
3546
"man"

0 commit comments

Comments
 (0)