summaryrefslogtreecommitdiff
path: root/src/cmd/5c
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-05-05 01:54:16 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-05-05 01:54:16 +0800
commita64243770d5a68d5e4aeacfeb3b5d259c75cf734 (patch)
tree333badd98783c6efb64dbefae2d7d2904f704a3f /src/cmd/5c
parentb3e5edd1c0ecb3109b67d305377557d74d33a8ad (diff)
downloadgo-a64243770d5a68d5e4aeacfeb3b5d259c75cf734.tar.gz
cmd/cgo, cmd/cc, cmd/ld: detect dynamic linker automatically
Some newer Linux distributions (Ubuntu ARM at least) use a new multiarch directory organization, where dynamic linker is no longer in the hardcoded path in our linker. For example, Ubuntu 12.04 ARM hardfloat places its dynamic linker at /lib/arm-linux-gnueabihf/ld-linux.so.3 Ref: http://lackof.org/taggart/hacking/multiarch/ Also, to support Debian GNU/kFreeBSD as a FreeBSD variant, we need this capability, so it's part of issue 3533. This CL add a new pragma (#pragma dynlinker "path") to cc. R=iant, rsc CC=golang-dev http://codereview.appspot.com/6086043
Diffstat (limited to 'src/cmd/5c')
-rw-r--r--src/cmd/5c/swt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/5c/swt.c b/src/cmd/5c/swt.c
index f8fbb1354..dea28cf6f 100644
--- a/src/cmd/5c/swt.c
+++ b/src/cmd/5c/swt.c
@@ -405,6 +405,10 @@ outcode(void)
Bprint(&outbuf, "\n$$ // dynexport\n");
for(i=0; i<ndynexp; i++)
Bprint(&outbuf, "dynexport %s %s\n", dynexp[i].local, dynexp[i].remote);
+ Bprint(&outbuf, "\n$$ // dynlinker\n");
+ if(dynlinker != nil) {
+ Bprint(&outbuf, "dynlinker %s\n", dynlinker);
+ }
Bprint(&outbuf, "\n$$\n\n");
}
Bprint(&outbuf, "!\n");