Commit cf1b7c4d authored by Sören Tempel's avatar Sören Tempel Committed by sternenseemann
Browse files

newlib: fix build of nano variant on non-ARM architectures

librdimon.a is only available on ARM architectures, therefore building
newlib-nano for other architectures (e.g. RISC-V) fails presently.
This commit fixes this issue by only copying the library files that
actually exist in the for loop body. Alternatively, it would be
theoretically feasible to change the libraries iterated over based
on the targeted architecture.
parent cde6a6e9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -73,10 +73,12 @@ stdenv.mkDerivation (finalAttrs: {
      cd $out${finalAttrs.passthru.libdir}

      for f in librdimon.a libc.a libg.a; do
        cp "$f" "''${f%%\.a}_nano.a"
        # Some libraries are only available for specific architectures.
        # For example, librdimon.a is only available on ARM.
        [ -f "$f" ] && cp "$f" "''${f%%\.a}_nano.a"
      done
    )
  '';
  '' + ''[ "$(find $out -type f | wc -l)" -gt 0 ] || (echo '$out is empty' 1>&2 && exit 1)'';

  passthru = {
    incdir = "/${stdenv.targetPlatform.config}/include";