Merge remote-tracking branch 'origin/master' into hardened-stdenv
This commit is contained in:
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
|
||||
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
|
||||
|
||||
# Find the loader dynamically
|
||||
LOADER="$(find ${libc.out or libc}/lib -name ld-linux\* | head -n 1)"
|
||||
LOADER="$(find ${lib.getLib libc}/lib -name ld-linux\* | head -n 1)"
|
||||
|
||||
# Replace references to the loader
|
||||
find src/cmd -name asm.c -exec sed -i "s,/lib/ld-linux.*\.so\.[0-9],$LOADER," {} \;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ stdenv, lib, fetchurl, tzdata, iana_etc, go_1_4, runCommand
|
||||
, perl, which, pkgconfig, patch, fetchpatch
|
||||
, pcre
|
||||
, Security, Foundation }:
|
||||
, Security, Foundation, bash }:
|
||||
|
||||
let
|
||||
goBootstrap = runCommand "go-bootstrap" {} ''
|
||||
@@ -34,6 +34,7 @@ stdenv.mkDerivation rec {
|
||||
# I'm not sure what go wants from its 'src', but the go installation manual
|
||||
# describes an installation keeping the src.
|
||||
preUnpack = ''
|
||||
topdir=$PWD
|
||||
mkdir -p $out/share
|
||||
cd $out/share
|
||||
'';
|
||||
@@ -94,14 +95,22 @@ stdenv.mkDerivation rec {
|
||||
sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
|
||||
|
||||
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
|
||||
|
||||
sed -i '1 a\exit 0' misc/cgo/errors/test.bash
|
||||
|
||||
mkdir $topdir/dirtyhacks
|
||||
cat <<EOF > $topdir/dirtyhacks/clang
|
||||
#!${bash}/bin/bash
|
||||
$(type -P clang) "\$@" 2> >(sed '/ld: warning:.*ignoring unexpected dylib file/ d' 1>&2)
|
||||
exit $?
|
||||
EOF
|
||||
chmod +x $topdir/dirtyhacks/clang
|
||||
PATH=$topdir/dirtyhacks:$PATH
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./remove-tools-1.5.patch
|
||||
]
|
||||
# -ldflags=-s is required to compile on Darwin, see
|
||||
# https://github.com/golang/go/issues/11994
|
||||
++ stdenv.lib.optional stdenv.isDarwin ./strip.patch;
|
||||
];
|
||||
|
||||
GOOS = if stdenv.isDarwin then "darwin" else "linux";
|
||||
GOARCH = if stdenv.isDarwin then "amd64"
|
||||
|
||||
Reference in New Issue
Block a user