Unverified Commit 32a023ac authored by Alyssa Ross's avatar Alyssa Ross Committed by GitHub
Browse files

cc-wrapper: Make gccgo look like go (#430137)

parents 674b40f9 335a0cc6
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ let
    versionAtLeast
    ;

  inherit (stdenvNoCC) hostPlatform targetPlatform;
  inherit (stdenvNoCC) buildPlatform hostPlatform targetPlatform;

  includeFortifyHeaders' =
    if includeFortifyHeaders != null then
@@ -445,6 +445,13 @@ stdenvNoCC.mkDerivation {
    inherit nixSupport;

    inherit defaultHardeningFlags;
  }
  // optionalAttrs cc.langGo or false {
    # So gccgo looks more like go for buildGoModule

    inherit (targetPlatform.go) GOOS GOARCH GOARM;

    CGO_ENABLED = 1;
  };

  dontBuild = true;
@@ -873,6 +880,9 @@ stdenvNoCC.mkDerivation {
    + optionalString cc.langFortran or false ''
      hardening_unsupported_flags+=" format"
    ''
    + optionalString cc.langGo or false ''
      hardening_unsupported_flags+=" format"
    ''
    + optionalString targetPlatform.isWasm ''
      hardening_unsupported_flags+=" stackprotector fortify pie pic"
    ''