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

Merge pull request #298849 from rhelmot/freebsd-minimal2/fblibc

FreeBSD: Rework scope + building libc
parents 0913fe1d 2cc214b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -81,6 +81,8 @@ let
        && final.parsed.kernel == platform.parsed.kernel;
      isCompatible = _: throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details";
      # Derived meta-data
      useLLVM = final.isFreeBSD;

      libc =
        /**/ if final.isDarwin              then "libSystem"
        else if final.isMinGW               then "msvcrt"
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
  callPackage,
  crossLibcStdenv,
  attributePathToSplice ? [ "freebsd" ],
  branch ? "release/13.1.0",
  branch ? "release/14.0.0",
}:

let
+21 −7
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ lib.packagesFromDirectoryRecursive {
}
// {
  inherit sourceData patchesRoot versionData;
  patches = ./patches/${self.versionData.revision};

  # Keep the crawled portion of Nixpkgs finite.
  buildFreebsd = lib.dontRecurseIntoAttrs buildFreebsd;
@@ -26,7 +27,8 @@ lib.packagesFromDirectoryRecursive {
    sha256 = "BpHqJfnGOeTE7tkFJBx0Wk8ryalmf4KNTit/Coh026E=";
  };

  compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isFreeBSD) self.compat;
  compatIsNeeded = !stdenvNoCC.hostPlatform.isFreeBSD;
  compatIfNeeded = lib.optional self.compatIsNeeded self.compat;
  freebsd-lib = import ./lib {
    version = lib.concatStringsSep "." (
      map toString (
@@ -44,7 +46,7 @@ lib.packagesFromDirectoryRecursive {

  compat = self.callPackage ./pkgs/compat/package.nix {
    inherit stdenv;
    inherit (buildFreebsd) makeMinimal boot-install;
    inherit (buildFreebsd) makeMinimal;
  };

  csu = self.callPackage ./pkgs/csu.nix {
@@ -52,13 +54,11 @@ lib.packagesFromDirectoryRecursive {
    inherit (self) include;
  };

  include = self.callPackage ./pkgs/include/package.nix {
    inherit (buildFreebsd) makeMinimal install rpcgen;
  };
  include = self.callPackage ./pkgs/include/package.nix { inherit (buildFreebsd) rpcgen mtree; };

  install = self.callPackage ./pkgs/install.nix {
    inherit (buildFreebsd) makeMinimal;
    inherit (self) mtree libnetbsd;
    inherit (self) libmd libnetbsd;
  };

  libc = self.callPackage ./pkgs/libc/package.nix {
@@ -67,16 +67,30 @@ lib.packagesFromDirectoryRecursive {
      install
      gencat
      rpcgen
      mkcsmapper
      mkesdb
      ;
    inherit (self) csu include;
  };

  libnetbsd = self.callPackage ./pkgs/libnetbsd/package.nix { inherit (buildFreebsd) makeMinimal; };

  libmd = self.callPackage ./pkgs/libmd.nix { inherit (buildFreebsd) makeMinimal; };

  mkDerivation = self.callPackage ./pkgs/mkDerivation.nix {
    inherit stdenv;
    inherit (buildFreebsd) makeMinimal install tsort;
    inherit (buildFreebsd)
      freebsdSetupHook
      makeMinimal
      install
      tsort
      lorder
      ;
  };

  makeMinimal = self.callPackage ./pkgs/makeMinimal.nix { inherit (self) make; };

  mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) libnetbsd libmd; };

  tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildFreebsd) makeMinimal install; };
}
+13 −0
Original line number Diff line number Diff line
--- a/contrib/mtree/Makefile	2023-12-04 23:02:13.919144141 -0700
+++ b/contrib/mtree/Makefile		2023-12-04 23:02:58.371810109 -0700
@@ -10,8 +10,8 @@
 SRCS=  compare.c crc.c create.c excludes.c misc.c mtree.c spec.c specspec.c \
        verify.c getid.c pack_dev.c only.c
 .if (${HOSTPROG:U} == "")
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+LIBADD+= ${LIBUTIL}
+#LIBADD+= -lutil
 .endif

 CPPFLAGS+=	-I${NETBSDSRCDIR}/sbin/mknod
+11 −0
Original line number Diff line number Diff line
--- a/share/mk/src.libnames.mk	2023-12-21 23:56:50.767042385 -0800
+++ b/share/mk/src.libnames.mk	2023-12-21 23:56:39.671089506 -0800
@@ -392,7 +392,7 @@
 _DP_ztest=	geom m nvpair umem zpool pthread avl zfs_core spl zutil zfs uutil icp
 # The libc dependencies are not strictly needed but are defined to make the
 # assert happy.
-_DP_c=		compiler_rt
+_DP_c=		
 # Use libssp_nonshared only on i386 and power*.  Other archs emit direct calls
 # to __stack_chk_fail, not __stack_chk_fail_local provided by libssp_nonshared.
 .if ${MK_SSP} != "no" && \
Loading