Unverified Commit aa5c0b2f authored by John Ericson's avatar John Ericson Committed by GitHub
Browse files

freeebsd: Fix cross compilation (#456250)

parents 8971ea0b a22c426f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
{
  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"
  '';
+11 −0
Original line number Diff line number Diff line
{
  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"