aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-09-20 23:31:00 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-09-20 23:31:00 +0000
commit7399e345be175f47d0a7287703c752a2941fa889 (patch)
treed215d05316d47d51edd70abb6400cb803f1591bf
parent073809a7187bba6eb3a775d45a248754e9f37a64 (diff)
downloadgcc-7399e345be175f47d0a7287703c752a2941fa889.zip
gcc-7399e345be175f47d0a7287703c752a2941fa889.tar.gz
gcc-7399e345be175f47d0a7287703c752a2941fa889.tar.bz2
libgo: fix build when using -enable-static=no
With -enable-static=no we don't build non-pic objects, but libgotool.a is built from non-pic objects. Build the packages that go into libgotool.a in static mode in all cases. Also ensure that internal test packages are built, since nothing explicitly depended on them. Reviewed-on: https://go-review.googlesource.com/65050 From-SVN: r253042
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/Makefile.am15
-rw-r--r--libgo/Makefile.in13
3 files changed, 27 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 06f8d621..5b3206a 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-5deeab42b0e5fdf2721773ce7fdaf61716599d4d
+1fcb9bb3cefb97cfab1e623826a1cc3f6aadd5f7
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 2376130..336071d 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -395,6 +395,13 @@ toolexeclibgounicode_DATA = \
unicode/utf16.gox \
unicode/utf8.gox
+# Some packages are only needed for tests, so unlike the other
+# internal packages nothing will explicitly depend on them.
+# Force them to be built.
+noinst_DATA = \
+ internal/testenv.gox \
+ net/internal/socktest.gox
+
if LIBGO_IS_RTEMS
rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
else
@@ -573,7 +580,7 @@ s-runtime-inc: runtime.lo Makefile
rm -f runtime.inc.tmp2 runtime.inc.tmp3
$(STAMP) $@
-noinst_DATA = zstdpkglist.go zdefaultcc.go
+noinst_DATA += zstdpkglist.go zdefaultcc.go
# Generate the list of go std packages that were included in libgo
zstdpkglist.go: s-zstdpkglist; @true
@@ -924,6 +931,12 @@ libgotool_a_SOURCES =
libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
libgotool_a_LIBADD = $(addsuffix .o,$(GOTOOL_PACKAGES))
+define STATIC_template
+$(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
+endef
+
+$(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
+
# Make sure runtime.inc is built before compiling any .c file.
$(libgo_la_OBJECTS): runtime.inc
$(libgo_llgo_la_OBJECTS): runtime.inc
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 5f7adb2..3ace02d 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -765,6 +765,12 @@ toolexeclibgounicode_DATA = \
unicode/utf16.gox \
unicode/utf8.gox
+
+# Some packages are only needed for tests, so unlike the other
+# internal packages nothing will explicitly depend on them.
+# Force them to be built.
+noinst_DATA = internal/testenv.gox net/internal/socktest.gox \
+ zstdpkglist.go zdefaultcc.go
@LIBGO_IS_RTEMS_FALSE@rtems_task_variable_add_file =
@LIBGO_IS_RTEMS_TRUE@rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-none.c
@@ -817,7 +823,6 @@ runtime_files = \
GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
-noinst_DATA = zstdpkglist.go zdefaultcc.go
@LIBGO_IS_LINUX_FALSE@syscall_epoll_file =
@LIBGO_IS_LINUX_TRUE@syscall_epoll_file = epoll.go
SYSINFO_FLAGS = \
@@ -3248,6 +3253,12 @@ s-epoll: Makefile
$(SHELL) $(srcdir)/mvifdiff.sh epoll.go.tmp epoll.go
$(STAMP) $@
+define STATIC_template
+$(subst -,_,$(subst .,_,$(subst /,_,$(1))))_GOCFLAGS = -static
+endef
+
+$(foreach package,$(GOTOOL_PACKAGES),$(eval $(call STATIC_template,$(package).lo)))
+
# Make sure runtime.inc is built before compiling any .c file.
$(libgo_la_OBJECTS): runtime.inc
$(libgo_llgo_la_OBJECTS): runtime.inc