forked from moovweb/gvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add apply_patches function and initial patches
These patches are for two issues: * Enabling Go to build on Alpine by disabling PIC per: golang/go#6940 https://github.com/docker-library/golang/blob/master/1.7/alpine/no-pic.patch * Fixing Go 1.4 bug appearing on macOS 10.12.1 per: golang/go#16352 (comment)
- Loading branch information
Showing
9 changed files
with
476 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
All no-pic patches were based upon: | ||
https://raw.githubusercontent.com/docker-library/golang/master/1.6/alpine/no-pic.patch | ||
https://raw.githubusercontent.com/docker-library/golang/master/1.7/alpine/no-pic.patch | ||
|
||
go1.4/no-pic.patch was hand-crafted from the above, based upon: | ||
https://go.googlesource.com/go/+/go1.4.3/src/cmd/ld/lib.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c | ||
--- a/src/cmd/ld/lib.c | ||
+++ b/src/cmd/ld/lib.c | ||
@@ -692,6 +692,11 @@ hostlink(void) { | ||
p = strchr(p + 1, ' '); | ||
} | ||
|
||
+ // The Go linker does not currently support building PIE | ||
+ // executables when using the external linker. See: | ||
+ // https://github.com/golang/go/issues/6940 | ||
+ argv[argc++] = "-fno-PIC"; | ||
+ | ||
argv[argc] = nil; | ||
|
||
quotefmtinstall(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go | ||
--- a/src/cmd/link/internal/ld/lib.go | ||
+++ b/src/cmd/link/internal/ld/lib.go | ||
@@ -1071,6 +1071,11 @@ func hostlink() { | ||
argv = append(argv, peimporteddlls()...) | ||
} | ||
|
||
+ // The Go linker does not currently support building PIE | ||
+ // executables when using the external linker. See: | ||
+ // https://github.com/golang/go/issues/6940 | ||
+ argv = append(argv, "-fno-PIC") | ||
+ | ||
if Debug['v'] != 0 { | ||
fmt.Fprintf(&Bso, "host link:") | ||
for _, v := range argv { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go | ||
index 8ccbec9dd634..4e96bfadc260 100644 | ||
--- a/src/cmd/link/internal/ld/lib.go | ||
+++ b/src/cmd/link/internal/ld/lib.go | ||
@@ -1194,6 +1194,11 @@ func hostlink() { | ||
argv = append(argv, peimporteddlls()...) | ||
} | ||
|
||
+ // The Go linker does not currently support building PIE | ||
+ // executables when using the external linker. See: | ||
+ // https://github.com/golang/go/issues/6940 | ||
+ argv = append(argv, "-fno-PIC") | ||
+ | ||
if Debug['v'] != 0 { | ||
fmt.Fprintf(&Bso, "host link:") | ||
for _, v := range argv { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go | ||
index 14f4fa9..5599307 100644 | ||
--- a/src/cmd/link/internal/ld/lib.go | ||
+++ b/src/cmd/link/internal/ld/lib.go | ||
@@ -1272,6 +1272,11 @@ func hostlink() { | ||
argv = append(argv, peimporteddlls()...) | ||
} | ||
|
||
+ // The Go linker does not currently support building PIE | ||
+ // executables when using the external linker. See: | ||
+ // https://github.com/golang/go/issues/6940 | ||
+ argv = append(argv, "-fno-PIC") | ||
+ | ||
if Debug['v'] != 0 { | ||
fmt.Fprintf(Bso, "host link:") | ||
for _, v := range argv { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go | ||
index 14f4fa9..5599307 100644 | ||
--- a/src/cmd/link/internal/ld/lib.go | ||
+++ b/src/cmd/link/internal/ld/lib.go | ||
@@ -1272,6 +1272,11 @@ func hostlink() { | ||
argv = append(argv, peimporteddlls()...) | ||
} | ||
|
||
+ // The Go linker does not currently support building PIE | ||
+ // executables when using the external linker. See: | ||
+ // https://github.com/golang/go/issues/6940 | ||
+ argv = append(argv, "-fno-PIC") | ||
+ | ||
if Debug['v'] != 0 { | ||
fmt.Fprintf(Bso, "host link:") | ||
for _, v := range argv { |
Oops, something went wrong.