anchor.diff:          if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
         EOF
         ${
  -      lib.optionalString (stdenv.isLinux) ''
  -        # provide libraries needed for static compilation
  -        ${
  -          if useMusl then
  -            "for f in ${musl.stdenv.cc.cc}/lib/* ${musl}/lib/* ${zlib.static}/lib/*; do"
  -          else
  -            "for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do"
  -        }
  -          ln -s $f $out/lib/svm/clibraries/${platform.arch}/$(basename $f)
  -        done
  -
  -        # add those libraries to $lib output too, so we can use them with
  -        # `native-image -H:CLibraryPath=''${lib.getLib graalvmXX-ce}/lib ...` and reduce
  -        # closure size by not depending on GraalVM $out (that is much bigger)
  -        mkdir -p $lib/lib
  -        for f in ${glibc}/lib/*; do
  -          ln -s $f $lib/lib/$(basename $f)
  -        done
  -      ''
  +        lib.optionalString (stdenv.isLinux) ''
  +          # provide libraries needed for static compilation
  +          ${
  +            if useMusl then
  +              ''for f in "${musl.stdenv.cc.cc}/lib/"* "${musl}/lib/"* "${zlib.static}/lib/"*; do''
  +            else
  +              ''for f in "${glibc}/lib/"* "${glibc.static}/lib/"* "${zlib.static}/lib/"*; do''
  +          }
  +            ln -s "$f" "$out/lib/svm/clibraries/${platform.arch}/$(basename $f)"
  +          done
  +
  +          # add those libraries to $lib output too, so we can use them with
  +          # `native-image -H:CLibraryPath=''${lib.getLib graalvmXX-ce}/lib ...` and reduce
  +          # closure size by not depending on GraalVM $out (that is much bigger)
  +          # we always use glibc here, since musl is only supported for static compilation
  +          mkdir -p "$lib/lib"
  +          for f in "${glibc}/lib/"*; do
  +            ln -s "$f" "$lib/lib/$(basename $f)"
  +          done
  +        ''
         }
       '';
   
  
positive.code:     outputs = [ "out" "lib" ];
  
      installPhase = ''
        # ensure that $lib/lib exists to avoid breaking builds
        mkdir -p $lib/lib
        # jni.h expects jni_md.h to be in the header search path.
        ln -s $out/include/linux/*_md.h $out/include/
  
  
negative.code:   ] ++ lib.optionals useMusl [
      (lib.getDev musl)
      # GraalVM 21.3.0+ expects musl-gcc as <system>-musl-gcc
      (writeShellScriptBin "${stdenv.hostPlatform.system}-musl-gcc" ''${lib.getDev musl}/bin/musl-gcc "$@"'')
    ]);
  
    withNativeImageSvm = builtins.elem "native-image-installable-svm" platform.products;
  