Unverified Commit 725e7d2b authored by nixpkgs-ci[bot]'s avatar nixpkgs-ci[bot] Committed by GitHub
Browse files

ponyc: Fixes code generation to use generic arch, not native (#491562)

parents cb1749a8 c0de9821
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -99,6 +99,20 @@ stdenv.mkDerivation rec {
        --replace-fail "https://github.com/google/googletest/releases/download/v$googletestRev/googletest-$googletestRev.tar.gz" "$NIX_BUILD_TOP/deps/googletest-$googletestRev.tar"
  '';

  # We do not concern ourselves with darwin as the ponyc compiler
  # has logic which overrides this environmental variable in this
  # case.
  env.arch =
    if stdenv.hostPlatform.isx86_64 then
      "x86-64"
    else if stdenv.hostPlatform.isAarch64 then
      "armv8-a"
    else
      lib.warn ''
        architecture '${stdenv.hostPlatform.system}' compiles with native optimizations,
        this may result in crashes on incompatible CPUs!
      '' "native";

  preBuild = ''
    extraFlags=(build_flags=-j$NIX_BUILD_CORES)
  ''