aboutsummaryrefslogtreecommitdiffstats
path: root/main/go/no-pic.patch
blob: 633dd9a1cf0db48ae498bf8f56b9c57f217a39d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -786,6 +786,11 @@ hostlink(void)
 		p = strchr(p + 1, ' ');
 	}
 
+	// The Go linker does not currently support building objects that
+	// may be linked into a PIE. See:
+	// https://code.google.com/p/go/issues/detail?id=6940
+	argv[argc++] = "-fno-PIC";
+
 	argv[argc] = nil;
 
 	quotefmtinstall();