]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testcshared, misc/cgo/testshared: fix clang warnings and errors
authorDave Cheney <dave@cheney.net>
Thu, 30 Apr 2015 01:57:34 +0000 (11:57 +1000)
committerDave Cheney <dave@cheney.net>
Thu, 30 Apr 2015 17:08:15 +0000 (17:08 +0000)
Fix several warnings generated on the linux-amd64-clang builder
and make it clear to clang that -znow is a linker only flag.

Tested with

    env CC=clang-3.5 ./all.bash
    env CC=gcc-4.8 ./all.bash

Change-Id: I5ca7366ba8bf6221a36d25a2157dda4b4f3e16fa
Reviewed-on: https://go-review.googlesource.com/9523
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testcshared/main0.c
src/cmd/internal/ld/lib.go

index fa0eb4a09e69547a4c9033b31560b54f0d8cfa5a..7fe0a27ff872e8474b56581f4e215e6ddfc58b28 100644 (file)
@@ -5,6 +5,10 @@
 #include <stdint.h>
 #include <stdio.h>
 
+extern int8_t DidInitRun(void);
+extern int8_t DidMainRun(void);
+extern int32_t FromPkg(void);
+
 // Tests libgo.so to export the following functions.
 //   int8_t DidInitRun();
 //   int8_t DidMainRun();
index b14a6c1b50b1f2163d29a1eb1f64e589a6af532f..44389c9fa81260d80c5f4429df85f968e41d4f85 100644 (file)
@@ -946,7 +946,7 @@ func hostlink() {
                // We force all symbol resolution to be done at program startup
                // because lazy PLT resolution can use large amounts of stack at
                // times we cannot allow it to do so.
-               argv = append(argv, "-znow")
+               argv = append(argv, "-Wl,-znow")
        }
 
        argv = append(argv, "-o")