From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E44943858C54; Wed, 13 Apr 2022 10:55:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E44943858C54 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/93602] [9/10/11/12 Regression] Missing reference to libiconv in 9.x libstdc++ Date: Wed, 13 Apr 2022 10:55:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 9.2.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2022 10:55:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93602 --- Comment #17 from Jonathan Wakely --- I confirmed that --without-libiconv-prefix doesn't work. With GNU libiconv installed as /usr/local/lib/libiconv.so.2 it breaks the compiler: /gccobj/./gcc/xgcc -B/gccobj/./gcc/ -dumpspecs > tmp-specs /gccobj/./gcc/xgcc: error while loading shared libraries: libiconv.so.2: ca= nnot open shared object file: No such file or directory (In reply to Jonathan Wakely from comment #16) > I think we need to use LTLIBICONV when linking libstdc++. But that adds the libiconv libdir to libstdc++.so.6's RPATH, which can resu= lt in user applications picking up unwanted version of other libraries. Simply adding -liconv isn't a solution either, because that might create a runtime dependency on a libiconv.so that isn't in the ldconfig search paths, and so won't be found at run-time. That just moves the problem from link-ti= me to run-time. I tried configuring libiconv with --enable-static (which is disabled by default) and configuring GCC with --with-libiconv-type=3Dstatic which cause LTLIBICONV=3D/usr/local/lib/libiconv.a to be defined by libstdc++'s configu= re. But that still fails, because libstdc++-v3/src/Makefile doesn't use LTLIBIC= ONV, so we still don't link libstdc++.so to it.=20 A better solution is to add the libiconv sources to the GCC source tree, so that it is built in-tree. If the libiconv sources are in a dir called "libiconv" at the top level of the GCC source tree then a static libiconv.a will be built as part of the GCC build. But we still don't link libstdc++.s= o to it without using LTLIBICONV. So although I'm reluctant to add LTLIBICONV to the libstdc++ build, because= of the rpath effects, I think we need to do it. Users who don't want those rpa= th effects can link to an out-of-tree libiconv.a or build and use an in-tree libiconv.a Of course the best approach is just to not install libiconv on glibc system= s at all, because it's unnecessary.=