summaryrefslogtreecommitdiff
path: root/src/cmd/cc/macbody
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/cc/macbody
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/cc/macbody')
-rw-r--r--src/cmd/cc/macbody4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/cc/macbody b/src/cmd/cc/macbody
index 874e82d25..e9b4ba9fb 100644
--- a/src/cmd/cc/macbody
+++ b/src/cmd/cc/macbody
@@ -751,6 +751,10 @@ macprag(void)
pragdynexport();
return;
}
+ if(s && strcmp(s->name, "dynlinker") == 0) {
+ pragdynlinker();
+ return;
+ }
while(getnsc() != '\n')
;
return;