]> Cypherpunks repositories - gostls13.git/commitdiff
makefiles: use correct gcc order in case --as-needed is in use.
authorRuss Cox <rsc@golang.org>
Sun, 15 Nov 2009 20:57:28 +0000 (12:57 -0800)
committerRuss Cox <rsc@golang.org>
Sun, 15 Nov 2009 20:57:28 +0000 (12:57 -0800)
Suggested by eostapets.
Fixes #141.

R=r
https://golang.org/cl/155049

src/Make.pkg
src/libcgo/Makefile

index dc0e70f37a8468c6021773c43df1eeb205f8dd7d..137779207546d2218b9a8f5f9669d841db694962 100644 (file)
@@ -112,7 +112,7 @@ _CGO_LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup
        gcc $(_CGO_CFLAGS_$(GOARCH)) -fPIC -O2 -o $@ -c $(CGO_CFLAGS) $*.cgo4.c
 
 $(elem)_%.so: %.cgo4.o
-       gcc $(_CGO_CFLAGS_$(GOARCH)) $(_CGO_LDFLAGS_$(GOOS)) -o $@ $*.cgo4.o $(CGO_LDFLAGS)
+       gcc $(_CGO_CFLAGS_$(GOARCH)) -o $@ $*.cgo4.o $(CGO_LDFLAGS)  $(_CGO_LDFLAGS_$(GOOS))
 
 $(pkgdir)/$(dir)/$(elem)_%.so: $(elem)_%.so
        @test -d $(GOROOT)/pkg && mkdir -p $(pkgdir)/$(dir)
index a323823503520768a985188d6abe0b330df8608c..0cd19fbba411b1f54833b477e37fbbaaa00fa088 100644 (file)
@@ -24,7 +24,7 @@ LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dyl
        gcc $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.S
 
 libcgo.so: $(OFILES)
-       gcc $(CFLAGS_$(GOARCH)) $(LDFLAGS_$(GOOS)) -o libcgo.so $(OFILES)
+       gcc $(CFLAGS_$(GOARCH)) -o libcgo.so $(OFILES) $(LDFLAGS_$(GOOS))
 
 $(GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so: libcgo.so
        cp libcgo.so $@