From 7f00c40155297161be7d10e507ebfd46e31e633f Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Tue, 1 Nov 2022 00:23:46 +0000 Subject: [PATCH] 3p: pass -p to go tool asm to for go1.19 --- third_party/default.nix | 2 +- third_party/tvl/nix/buildGo/default.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/third_party/default.nix b/third_party/default.nix index 4d192d7b4a..b672b8b3a8 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -54,7 +54,7 @@ rec { nixos = import ./nixpkgs/nixos; nixeval = import ./nixpkgs/nixos/lib/eval-config.nix; buildGo = - let orig = import ./tvl/nix/buildGo { pkgs = (nixpkgs // { go = nixpkgs.go_1_18; }); inherit gopkgs; }; + let orig = import ./tvl/nix/buildGo { pkgs = nixpkgs; inherit gopkgs; }; in orig // { program = { dockerData ? [], ... }@args: let diff --git a/third_party/tvl/nix/buildGo/default.nix b/third_party/tvl/nix/buildGo/default.nix index bca849fde2..dbe42d255a 100644 --- a/third_party/tvl/nix/buildGo/default.nix +++ b/third_party/tvl/nix/buildGo/default.nix @@ -68,7 +68,7 @@ let in runCommand name { buildInputs = cgoBuildInputs; } '' - ${go}/bin/go tool compile -o ${name}.a -trimpath=$PWD -trimpath=${go} ${includeSources uniqueDeps} ${spaceOut srcs} + ${go}/bin/go tool compile -o ${name}.a -trimpath=$PWD -trimpath=${go} -p main ${includeSources uniqueDeps} ${spaceOut srcs} mkdir -p $out/bin export GOROOT_FINAL=go ${go}/bin/go tool link -o $out/bin/${name} -buildid nix \ @@ -107,8 +107,8 @@ let # This is required for several popular packages (e.g. x/sys). ifAsm = do: lib.optionalString (sfiles != [ ]) do; asmBuild = ifAsm '' - ${go}/bin/go tool asm -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -gensymabis -o ./symabis ${spaceOut sfiles} - ${go}/bin/go tool asm -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -o ./asm.o ${spaceOut sfiles} + ${go}/bin/go tool asm -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -p ${path} -gensymabis -o ./symabis ${spaceOut sfiles} + ${go}/bin/go tool asm -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -p ${path} -o ./asm.o ${spaceOut sfiles} ''; asmLink = ifAsm "-symabis ./symabis -asmhdr $out/go_asm.h"; asmPack = ifAsm ''