Commit aab8c7ba authored by Matthew Bauer's avatar Matthew Bauer Committed by Matthew Bauer
Browse files

netbsd: add cross target

parent 1b267521
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ rec {
        else if final.isAndroid             then "bionic"
        else if final.isLinux /* default */ then "glibc"
        else if final.isAvr                 then "avrlibc"
        else if final.isNetBSD              then "nblibc"
        # TODO(@Ericson2314) think more about other operating systems
        else                                     "native/impure";
      extensions = {
+7 −0
Original line number Diff line number Diff line
@@ -212,4 +212,11 @@ rec {
    libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
    platform = {};
  };

  # BSDs

  amd64-netbsd = {
    config = "x86_64-unknown-netbsd";
    libc = "nblibc";
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ let
    /**/ if libc == null then null
    else if targetPlatform.libc == "musl"             then "${libc_lib}/lib/ld-musl-*"
    else if targetPlatform.libc == "bionic"           then "/system/bin/linker"
    else if targetPlatform.libc == "nblibc"           then "${libc_lib}/libexec/ld.elf_so"
    else if targetPlatform.system == "i686-linux"     then "${libc_lib}/lib/ld-linux.so.2"
    else if targetPlatform.system == "x86_64-linux"   then "${libc_lib}/lib/ld-linux-x86-64.so.2"
    # ARM with a wildcard, which can be "" or "-armhf".
+4 −0
Original line number Diff line number Diff line
@@ -291,6 +291,10 @@ stdenv.mkDerivation {
      hardening_unsupported_flags+=" stackprotector pic"
    ''

    + optionalString targetPlatform.isNetBSD ''
      hardening_unsupported_flags+=" stackprotector fortify"
    ''

    + optionalString (targetPlatform.libc == "newlib") ''
      hardening_unsupported_flags+=" stackprotector fortify pie pic"
    ''
+4 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ let version = "7.4.0";
        ./riscv-no-relax.patch
      ]
      ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
      ++ optionals targetPlatform.isNetBSD [
        ../libstdc++-netbsd-ctypes.patch
      ]
      ++ optional noSysDirs ../no-sys-dirs.patch
      ++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied
        url = "https://git.busybox.net/buildroot/plain/package/gcc/7.1.0/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";
@@ -302,6 +305,7 @@ stdenv.mkDerivation ({
      "--disable-gnu-indirect-function"
    ]
    ++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
    ++ optional targetPlatform.isNetBSD "--disable-libcilkrts"
  ;

  targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
Loading