Summary: | [11 regression] cc1plus doesn't link on Solaris 11.3 | ||
---|---|---|---|
Product: | gcc | Reporter: | Rainer Orth <ro> |
Component: | c++ | Assignee: | Rainer Orth <ro> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ebotcazou, nathan, webrown.cpp |
Priority: | P1 | Keywords: | build |
Version: | 11.0 | ||
Target Milestone: | 11.0 | ||
URL: | https://gcc.gnu.org/pipermail/gcc-patches/2020-December/562185.html | ||
Host: | Target: | *-*-solaris2.11 | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2020-12-16 00:00:00 | |
Attachments: | Initial patch |
Description
Rainer Orth
2020-12-16 10:11:47 UTC
Besides, currently libcody.a (and, once this PR is fixed, libsocket and libnsl) are linked into every backend instead of just into cc1plus. I believe this should change, just like f951 is the only user of $(ZLIB) (and $(ZLIBINC)). Created attachment 49778 [details]
Initial patch
The attach has only been lightly tested so far: it allowed cc1plus to link on
Solaris 11.3, bootstrap still running.
Looks good, and separating out cc1plus' libraries from other executables is goodness. do you want to take this bug? That's easiest, I guess. With one minor addition (gcc/objcp/Make-lang.in needs the same treatment), the Solaris 11.3 build completed successfully; make check still running. I'll try the patch on Solaris 11.4 and Linux/x86_64 tonight, then post it. Final patch posted. The master branch has been updated by Rainer Orth <ro@gcc.gnu.org>: https://gcc.gnu.org/g:a20893cf6b95f60f5319b2196621acc65180125c commit r11-6457-ga20893cf6b95f60f5319b2196621acc65180125c Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Date: Tue Jan 5 11:32:31 2021 +0100 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. Fixed for GCC 11. thanks Rainer! |