From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D7D6D385829C; Sun, 25 Feb 2024 12:17:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7D6D385829C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708863464; bh=H59GwRmNcoaOKBknAv+pSJkPDqncvRcJN7N792WOmZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ydDBTPJhN904Ajy9zjwAOLOL8yfl6erNkLslvDIYEWK1qHQHvsBeHY+Z+52TgwSlm 4B++7ZIudhLSFM9XHTNHEltLisXp2JrDHsMkuWGqLvZ+TlZBDrNUzeZBqjsad6C3Y8 sNB+m/SCOVeXYpA7wHXIVxW8o0UXHtguqhxnGYaM= From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug build/31412] GCC 6 failed to build i386 glibc on Fedora 39 Date: Sun, 25 Feb 2024 12:17:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: build X-Bugzilla-Version: 2.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31412 --- Comment #2 from H.J. Lu --- (In reply to Florian Weimer from comment #1) > H.J., what do you mean by static linking in this context? $ gcc -static .... > I think your GCC 6 environment is misconfigured. Shouldn't it use system > libgcc.a? [hjl@gnu-cfl-1 tmp]$ gcc -print-file-name=3Dlibgcc.a /usr/lib/gcc/x86_64-redhat-linux/13/libgcc.a [hjl@gnu-cfl-1 tmp]$ /usr/gcc-14.0.1-x32/bin/gcc -print-file-name=3Dlibgcc.= a=20 /usr/gcc-14.0.1-x32/lib/gcc/x86_64-pc-linux-gnu/14.0.1/libgcc.a [hjl@gnu-cfl-1 tmp]$ /usr/gcc-6.3.1-x32/bin/gcc -print-file-name=3Dlibgcc.a= =20 /usr/gcc-6.3.1-x32/lib/gcc/x86_64-pc-linux-gnu/6.3.1/libgcc.a [hjl@gnu-cfl-1 tmp]$=20 All versions of GCC should use /usr/lib/gcc/x86_64-redhat-linux/13/libgcc.a? It won't work for GCC 14 or higher. The configure.ac change: ommit d337ceb76d898935560dc264cf2ad36b17017db7 Author: Florian Weimer Date: Mon Oct 26 09:41:10 2015 +0100 Use the CXX compiler only if it can create dynamic and static programs * configure.ac (CXX): Clear the variable if the C++ toolchain d= oes not support static linking. * configure: Regenerate. diff --git a/configure.ac b/configure.ac index e502aa5db2..3c7f6c0096 100644 --- a/configure.ac +++ b/configure.ac @@ -57,9 +57,26 @@ AC_PROG_CXX # It's useless to us if it can't link programs (e.g. missing -lstdc++). AC_CACHE_CHECK([whether $CXX can link programs], libc_cv_cxx_link_ok, [dnl AC_LANG_PUSH([C++]) +# Default, dynamic case. AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [libc_cv_cxx_link_ok=3Dyes], [libc_cv_cxx_link_ok=3Dno]) +# Static case. +old_LDFLAGS=3D"$LDFLAGS" +LDFLAGS=3D"$LDFLAGS -static" +AC_LINK_IFELSE([AC_LANG_SOURCE([ +#include + +int +main() +{ + std::cout << "Hello, world!"; + return 0; +} +])], + [], + [libc_cv_cxx_link_ok=3Dno]) +LDFLAGS=3D"$old_LDFLAGS" AC_LANG_POP([C++])]) AS_IF([test $libc_cv_cxx_link_ok !=3D yes], [CXX=3D]) makes it impossible to properly build i386 glibc with GCC 6 on Fedora 39. --=20 You are receiving this mail because: You are on the CC list for the bug.=