3p: pass -p to go tool asm to for go1.19

This commit is contained in:
Luke Granger-Brown 2022-11-01 00:23:46 +00:00
parent 2f0b9369fe
commit 7f00c40155
2 changed files with 4 additions and 4 deletions
third_party
default.nix
tvl/nix/buildGo

View file

@ -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

View file

@ -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 ''