diff options
author | Shenghou Ma <minux.ma@gmail.com> | 2012-05-05 01:54:16 +0800 |
---|---|---|
committer | Shenghou Ma <minux.ma@gmail.com> | 2012-05-05 01:54:16 +0800 |
commit | a64243770d5a68d5e4aeacfeb3b5d259c75cf734 (patch) | |
tree | 333badd98783c6efb64dbefae2d7d2904f704a3f /src/cmd/5c | |
parent | b3e5edd1c0ecb3109b67d305377557d74d33a8ad (diff) | |
download | go-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.c | 4 |
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"); |