aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/Make-lang.in
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2021-01-05 11:32:31 +0100
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2021-01-05 11:32:31 +0100
commita20893cf6b95f60f5319b2196621acc65180125c (patch)
treea9758792f3a9e925d450b313def0d351a93ab00f /gcc/cp/Make-lang.in
parent4615cde5d7ef281d4b554df411f82ad707f0a54d (diff)
downloadgcc-a20893cf6b95f60f5319b2196621acc65180125c.zip
gcc-a20893cf6b95f60f5319b2196621acc65180125c.tar.gz
gcc-a20893cf6b95f60f5319b2196621acc65180125c.tar.bz2
build: libcody: Link with -lsocket -lnsl if necessary [PR98316]
With the introduction of C++20 modules and libcody, cc1plus and cc1objplus gained a dependency on the socket functions. Before those were merged into libc in Solaris 11.4, one needed to link with -lsocket -lnsl on Solaris, so that merge broke the Solaris 11.3 build. While we already have 4 different checks for those libraries in the tree, I decided to import autoconf-archive's AX_LIB_SOCKET_NSL macro instead. At the same time, the patch only links libcody and the networking libs where needed (cc1plus, cc1objplus). Bootstrapped without regressions on i386-pc-solaris2.11 (Solaris 11.3 and 11.4), sparc-sun-solaris2.11, and x86_64-pc-linux-gnu. 2020-12-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> c++tools: PR c++/98316 * configure.ac: Include ../config/ax_lib_socket_nsl.m4. (NETLIBS): Determine using AX_LIB_SOCKET_NSL. * configure: Regenerate. * Makefile.in (NETLIBS): Define. (g++-mapper-server$(exeext)): Add $(NETLIBS). gcc/objcp: PR c++/98316 * Make-lang.in (cc1objplus$(exeext)): Add $(CODYLIB), $(NETLIBS). gcc/cp: PR c++/98316 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS). gcc: PR c++/98316 * configure.ac (NETLIBS): Determine using AX_LIB_SOCKET_NSL. * aclocal.m4, configure: Regenerate. * Makefile.in (NETLIBS): Define. (BACKEND): Remove $(CODYLIB). config: PR c++/98316 * ax_lib_socket_nsl.m4: Import from autoconf-archive.
Diffstat (limited to 'gcc/cp/Make-lang.in')
-rw-r--r--gcc/cp/Make-lang.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 7e9c8d5..7f01c7d 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -134,7 +134,8 @@ cc1plus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) $(c++.prev)
@$(call LINK_PROGRESS,$(INDEX.c++),start)
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
- $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
+ $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) $(NETLIBS) \
+ $(LIBS) $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.c++),end)
ifeq ($(ENABLE_MAINTAINER_RULES), true)