From patchwork Sat May 25 12:26:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1939259 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mUgjEBNF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vmh5038Fqz20KL for ; Sat, 25 May 2024 22:27:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC7733858D29 for ; Sat, 25 May 2024 12:27:45 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 7F8BD3858C41 for ; Sat, 25 May 2024 12:26:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F8BD3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7F8BD3858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::429 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716640007; cv=none; b=QcpaI7hN8a7/jE5AYfyvttkKLBXQYz9/gssDSIss4tuOuhv45kI/RuZcgEjkPTo3uJlKXl2ZswWJ9B7OGJAhXKJN38Mlk1ti7m+k21ZGVFQH5z8LdrL6xsCoZfRRJK8KNXmnt7nwgFhy/mSkEkiAVr+5dbD1V+hh42Rmd5lxn/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716640007; c=relaxed/simple; bh=g5n/GIRHPAALJEqCNF3xxISUxNPDt81RIMTHuLadvPg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LC4yn7cb8kC0lz94SBgxx5qXXpQyMacZ/lcHGxRxod0CnRb/vGfZMpinLo7lz0gBTQKpf6fPbOH/8xHa5xdlTqtatLn1EKseaeT7VxPObZSFp2cqMa9FdnePk0KS+V5HsInl7Pe6VRCv7LyaVFitZ6wtWHxV35UqauU8t/iXsgQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6f6a045d476so3844806b3a.1 for ; Sat, 25 May 2024 05:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716640004; x=1717244804; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9yATPSZhbsdI0NBexexILr0LAxkQSJ4ydgUYt7CKYDo=; b=mUgjEBNFDdF4ECEO+xlW0tHqFMvDAW6ErX8BIwhk31ErLuLBTQwdCJK3jP8D4PAR1R n4/Pkd2ZEwK6jhY4RDzgvzoNKLMUW5uhaH1roUNV41HdRshLGmOti++/39QYfnVsLQr4 SufV3EqtBLn0oFV47VoTB1UzWTFr1duim3zJ90Xov/Km/caLEIKk0cwBloym74k3U/SI DTLfXFnghcfVHLHRpgrZ/jMEAt3hsBHJ1jOOjEtExAstRzrNi0QrqJu5mvabnIU4huKx /jH1cBsRGHeRa3fuCB2EuOKljDhMO4KPgdFwu/yGai2AtJh4J9Psfy/2+T3Pcr7UoWKm vgiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716640004; x=1717244804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9yATPSZhbsdI0NBexexILr0LAxkQSJ4ydgUYt7CKYDo=; b=MZ/Rw6U5yGMm9uaYFEzr5Lzl0duqGZb3k0SXLO2u6r555CE7AMvNMkh0MtNnFCrDJi +eALKN47VzeB6y8esUM+deNwOJU/PIHFqrtce393sGZj5xoTsRIdwFw4vsyMriZRdneF yMkNGLoO7ChPgb8It7TKq6NZ23oVjNIxKRYxbX4UlD9M/OsPGxFML58o1NtQESXsEefu bqkwRMrf0PqwwpEBhBj6PdU8ImgC8DBVGK/2OUFViN6HqUHAKg2dHD/vSZu4Z5rSQSS+ /4IiXOPv3KbTXziQulAjQ9z82jFU0eJ8HJU2sPxOJ4QY3igrOzRCeIfm2DU8DxSzqxT5 7nIA== X-Gm-Message-State: AOJu0YxKOrULALJddTjneS798Ohz+oC5CZnbrB4moJfx1dqe1jIkAdgA Ihe0K7lealjPnVvQXrxp4ZUYytZchzGg2dzSOi1PWXByHvlWyYVkfG8Ujw== X-Google-Smtp-Source: AGHT+IG39DN8VtmgABSeYJR2vKHXiUcoHVePBk1hGyueCSo/s5VosT0XOOLd3S1bWNhAoG/aXWpxUA== X-Received: by 2002:a05:6a00:301b:b0:6ee:1c9d:b471 with SMTP id d2e1a72fcca58-6f8f3e8c64cmr4956770b3a.25.1716640004226; Sat, 25 May 2024 05:26:44 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.129.178]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3eb39sm2402626b3a.30.2024.05.25.05.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 05:26:43 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id CF440740795; Sat, 25 May 2024 05:26:41 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH v2 1/2] Add --disable-static-c++-link-check option [BZ #31412] Date: Sat, 25 May 2024 05:26:40 -0700 Message-ID: <20240525122641.3154365-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525122641.3154365-1-hjl.tools@gmail.com> References: <20240525122641.3154365-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3021.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org The current minimum GCC version of glibc build is GCC 6.2 or newer. But building i686 glibc with GCC 6.4 on Fedora 40 failed since the C++ header files couldn't be found which was caused by the static C++ link check failure due to missing __divmoddi4 which was referenced in i686 libc.a and added to GCC 7. Add --disable-static-c++-link-check configure option to disable the static C++ link test. The newly built i686 libc.a can be used by GCC 6.4 to create static C++ tests. This fixes BZ #31412. Signed-off-by: H.J. Lu Reviewed-by: Carlos O'Donell --- INSTALL | 8 ++++++++ configure | 24 +++++++++++++++++++----- configure.ac | 22 +++++++++++++++------- manual/install.texi | 8 ++++++++ 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/INSTALL b/INSTALL index c8c524527b..d8b06f20aa 100644 --- a/INSTALL +++ b/INSTALL @@ -224,6 +224,14 @@ if 'CFLAGS' is specified it must enable optimization. For example: By default for x86_64, the GNU C Library is built with the vector math library. Use this option to disable the vector math library. +'--disable-static-c++-link-check' + By default, if the C++ toolchain doesn't not support static + linking, configure couldn't find the C++ header files and the glibc + build fails. Use this option to disable the static C++ link check + so that the C++ header files can be located. The newly built + libc.a can be used to create static C++ tests if the C++ toolchain + has necessary static C++ libraries. + '--disable-scv' Disable using 'scv' instruction for syscalls. All syscalls will use 'sc' instead, even if the kernel supports 'scv'. PowerPC only. diff --git a/configure b/configure index 432e40a592..31205ce568 100755 --- a/configure +++ b/configure @@ -778,6 +778,7 @@ ac_user_opts=' enable_option_checking with_pkgversion with_bugurl +enable_static_c___link_check with_gd with_gd_include with_gd_lib @@ -1447,6 +1448,8 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-static-c++-link-check + disable static C++ link check [default=no] --disable-sanity-checks really do not use threads (should not be used except in special situations) [default=yes] --enable-shared build shared library [default=yes if GNU ld] @@ -3810,6 +3813,15 @@ if test -z "$CPP"; then fi +# Check whether --enable-static-c++-link-check was given. +if test ${enable_static_c___link_check+y} +then : + enableval=$enable_static_c___link_check; static_cxx_link_check=$enableval +else $as_nop + static_cxx_link_check=yes +fi + + # We need the C++ compiler only for testing. @@ -4220,10 +4232,11 @@ else $as_nop fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -# Static case. -old_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -static" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test $static_cxx_link_check = yes; then + # Static case. + old_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -static" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -4244,7 +4257,8 @@ else $as_nop fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LDFLAGS="$old_LDFLAGS" + LDFLAGS="$old_LDFLAGS" +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/configure.ac b/configure.ac index bdc385d03c..ee64d49b03 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,12 @@ fi AC_SUBST(cross_compiling) AC_PROG_CPP +AC_ARG_ENABLE([static-c++-link-check], + AS_HELP_STRING([--disable-static-c++-link-check], + [disable static C++ link check @<:@default=no@:>@]), + [static_cxx_link_check=$enableval], + [static_cxx_link_check=yes]) + # We need the C++ compiler only for testing. AC_PROG_CXX # It's useless to us if it can't link programs (e.g. missing -lstdc++). @@ -61,10 +67,11 @@ AC_LANG_PUSH([C++]) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [libc_cv_cxx_link_ok=yes], [libc_cv_cxx_link_ok=no]) -# Static case. -old_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -static" -AC_LINK_IFELSE([AC_LANG_SOURCE([ +if test $static_cxx_link_check = yes; then + # Static case. + old_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -static" + AC_LINK_IFELSE([AC_LANG_SOURCE([ #include int @@ -74,9 +81,10 @@ main() return 0; } ])], - [], - [libc_cv_cxx_link_ok=no]) -LDFLAGS="$old_LDFLAGS" + [], + [libc_cv_cxx_link_ok=no]) + LDFLAGS="$old_LDFLAGS" +fi AC_LANG_POP([C++])]) AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=]) diff --git a/manual/install.texi b/manual/install.texi index 7c44594617..ac3728c301 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -252,6 +252,14 @@ configure with @option{--disable-werror}. By default for x86_64, @theglibc{} is built with the vector math library. Use this option to disable the vector math library. +@item --disable-static-c++-link-check +By default, if the C++ toolchain doesn't not support static linking, +configure couldn't find the C++ header files and the glibc build fails. +Use this option to disable the static C++ link check so that the C++ +header files can be located. The newly built libc.a can be used to +create static C++ tests if the C++ toolchain has necessary static C++ +libraries. + @item --disable-scv Disable using @code{scv} instruction for syscalls. All syscalls will use @code{sc} instead, even if the kernel supports @code{scv}. PowerPC only. From patchwork Sat May 25 12:26:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1939258 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=PnHKih8g; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vmh4G0lWTz20KL for ; Sat, 25 May 2024 22:27:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 164AF385E83D for ; Sat, 25 May 2024 12:27:05 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 010CE3858D29 for ; Sat, 25 May 2024 12:26:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 010CE3858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 010CE3858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::529 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716640007; cv=none; b=uCYQ4lw/drEUcg2aE5MPe/xDqru7IBX3OfMmaPecDhSpJQ0jVAWZyXNrqqT0bUxlGk5xn1SKgI8AcyJHdXoUZN4aiSc0l7M43rURn8zCdBGNnN0iIuJL30Is494+wG0D+yj8vfdmKwyPCVPrQoRctP31r3CislP5YH+CjpK8fO4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716640007; c=relaxed/simple; bh=KOnJFtCoqg+djX8yaSqDOX1U4Qa5U0u52JQ6/ZUnotw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mLGuGfQLmEfWCUTkIpK9mJF6jjs4feFlQa3tBbfz4AHNWwmw+VlcQdkCCDZ8fBzkbFYBu1G6RtmYf41tgPG7gJW/znzwS2F98H79tolSVP5k2fc81nx9ccW4/AUxN6AqFXutBJgiplXd7Ur0d1VO+o0kgz5H/r/3uxMSnNQdMHc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-68195b58daeso1376833a12.2 for ; Sat, 25 May 2024 05:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716640004; x=1717244804; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WWg66SqrUUPwswIyHACik28PLYgzFXSZXYy+lYhv0SY=; b=PnHKih8gA563peBYrIe0kLl9yp/wPvODU1pecUOCQN7VBiIhOH4IhBSTkGTEFvPrsg R6PleAYvHjIGh9lwTBtiO7DUAacXR9/Y1YaV53kADUTN4LTKBe0Kmc4QNsOde9qL3TVk JfMHG/KYr6eIXLRApyC+L8DF9RwYdcU9IWYvz2DkKeEe5rkfaPHdDRQQTHYjwtkraxN9 jbHBCR6x8KDa748S6SNV53by19tzStJsxHIVjQpzCC37zoarzb0M0hfQTCYadzyAL0QK +IzsF/WQ4IVEfQ0YhxHD/VayQX7grGgij+ObGsHcRieh7xbSDCLlOdaefLbAHJNbxfNe 7cSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716640004; x=1717244804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WWg66SqrUUPwswIyHACik28PLYgzFXSZXYy+lYhv0SY=; b=Bj8yAruPIs+wodLV/BZeVxLI25XRpIC4S3r1PlsjKW3c2xthCmxWiIDg9W7lts4/V/ cJpCPaFUZtmuoYjie5Drw7hPFZrzPmZz1Byhf0YNT5mRSrSorbj+DvpTpBU2WfcqoKcF tYRF8aw8yynE1c7oegzlAxG/n92R+7WJuPkfi1stx3LjU+o0lKVpUy0uCtTLPp5bKU88 mY7yn3TrP9iK/ivIcAPHtewcar1+2xZK52wSX7lVz2urzFJ5ykcwpL/xB3safaYL3uJQ nKzLkIG1XWYzvVMGeYfB4Fst2eJajoM9wW1OziKQitpnfj60J9faGPDxQSKwCW5I4GLg bbCQ== X-Gm-Message-State: AOJu0YzIaloayF/UyErIJxQGvxvGdJxCoqihaV99Wp9/QDJ4rhluNI63 c7ppbNL24P7SKpHkzOvOVkR0Hzi8GTc+fziHheNXwRufpXDsfpmZSbP0Fg== X-Google-Smtp-Source: AGHT+IGj0JxvL1JaGOfCifI5K4TFVcz8eWsAPkIfO3fQyL2pzY7JfZUIUW0By8c+jnPhyZGl2PueXw== X-Received: by 2002:a17:902:c401:b0:1f4:71ef:98f8 with SMTP id d9443c01a7336-1f471ef99b9mr7457185ad.16.1716640003791; Sat, 25 May 2024 05:26:43 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.129.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c9aa1f1sm29211565ad.241.2024.05.25.05.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 May 2024 05:26:43 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id DA0BC7407AF; Sat, 25 May 2024 05:26:41 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH v2 2/2] Add --disable-static-c++-tests option [BZ #31797] Date: Sat, 25 May 2024 05:26:41 -0700 Message-ID: <20240525122641.3154365-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240525122641.3154365-1-hjl.tools@gmail.com> References: <20240525122641.3154365-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3021.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org By default, if the C++ toolchain doesn't not support static linking, configure couldn't find the C++ header files and the glibc build fails. The --disable-static-c++-link-check option allows the glibc build to finish, but static C++ tests will fail if the C++ toolchain doesn't have necessary static C++ libraries which may not be easily installed. Add --disable-static-c++-tests option to skip the static C++ link check and tests. This fixes BZ #31797. Signed-off-by: H.J. Lu Reviewed-by: Carlos O'Donell --- INSTALL | 9 +++++++++ configure | 22 ++++++++++++++++++---- configure.ac | 15 +++++++++++---- manual/install.texi | 8 ++++++++ nptl/Makefile | 3 +++ 5 files changed, 49 insertions(+), 8 deletions(-) diff --git a/INSTALL b/INSTALL index d8b06f20aa..00c07e1515 100644 --- a/INSTALL +++ b/INSTALL @@ -224,6 +224,15 @@ if 'CFLAGS' is specified it must enable optimization. For example: By default for x86_64, the GNU C Library is built with the vector math library. Use this option to disable the vector math library. +'--disable-static-c++-tests' + By default, if the C++ toolchain doesn't not support static + linking, configure couldn't find the C++ header files and the glibc + build fails. '--disable-static-c++-link-check' allows the glibc + build to finish, but static C++ tests will fail if the C++ + toolchain doesn't have necessary static C++ libraries. Use this + option to skip the static C++ tests. This option implies + '--disable-static-c++-link-check'. + '--disable-static-c++-link-check' By default, if the C++ toolchain doesn't not support static linking, configure couldn't find the C++ header files and the glibc diff --git a/configure b/configure index 31205ce568..49b093043c 100755 --- a/configure +++ b/configure @@ -778,6 +778,7 @@ ac_user_opts=' enable_option_checking with_pkgversion with_bugurl +enable_static_c___tests enable_static_c___link_check with_gd with_gd_include @@ -1448,6 +1449,8 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-static-c++-tests + disable static C++ tests[default=no] --disable-static-c++-link-check disable static C++ link check [default=no] --disable-sanity-checks really do not use threads (should not be used except @@ -3813,6 +3816,20 @@ if test -z "$CPP"; then fi +# This will get text that should go into config.make. +config_vars= + +# Check whether --enable-static-c++-tests was given. +if test ${enable_static_c___tests+y} +then : + enableval=$enable_static_c___tests; static_cxx_tests=$enableval +else $as_nop + static_cxx_tests=yes +fi + +config_vars="$config_vars +static-cxx-tests = $static_cxx_tests" + # Check whether --enable-static-c++-link-check was given. if test ${enable_static_c___link_check+y} then : @@ -4232,7 +4249,7 @@ else $as_nop fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -if test $static_cxx_link_check = yes; then +if test $static_cxx_link_check$static_cxx_tests = yesyes; then # Static case. old_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" @@ -4277,9 +4294,6 @@ if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then as_fn_error $? "you must configure in a separate build directory" "$LINENO" 5 fi -# This will get text that should go into config.make. -config_vars= - # Check for a --with-gd argument and set libgd-LDFLAGS in config.make. # Check whether --with-gd was given. diff --git a/configure.ac b/configure.ac index ee64d49b03..e48957f318 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,16 @@ fi AC_SUBST(cross_compiling) AC_PROG_CPP +# This will get text that should go into config.make. +config_vars= + +AC_ARG_ENABLE([static-c++-tests], + AS_HELP_STRING([--disable-static-c++-tests], + [disable static C++ tests@<:@default=no@:>@]), + [static_cxx_tests=$enableval], + [static_cxx_tests=yes]) +LIBC_CONFIG_VAR([static-cxx-tests], [$static_cxx_tests]) + AC_ARG_ENABLE([static-c++-link-check], AS_HELP_STRING([--disable-static-c++-link-check], [disable static C++ link check @<:@default=no@:>@]), @@ -67,7 +77,7 @@ AC_LANG_PUSH([C++]) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [libc_cv_cxx_link_ok=yes], [libc_cv_cxx_link_ok=no]) -if test $static_cxx_link_check = yes; then +if test $static_cxx_link_check$static_cxx_tests = yesyes; then # Static case. old_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" @@ -92,9 +102,6 @@ if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then AC_MSG_ERROR([you must configure in a separate build directory]) fi -# This will get text that should go into config.make. -config_vars= - # Check for a --with-gd argument and set libgd-LDFLAGS in config.make. AC_ARG_WITH([gd], AS_HELP_STRING([--with-gd=DIR], diff --git a/manual/install.texi b/manual/install.texi index ac3728c301..916b33f2a7 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -252,6 +252,14 @@ configure with @option{--disable-werror}. By default for x86_64, @theglibc{} is built with the vector math library. Use this option to disable the vector math library. +@item --disable-static-c++-tests +By default, if the C++ toolchain doesn't not support static linking, +configure couldn't find the C++ header files and the glibc build fails. +@option{--disable-static-c++-link-check} allows the glibc build to finish, +but static C++ tests will fail if the C++ toolchain doesn't have necessary +static C++ libraries. Use this option to skip the static C++ tests. This +option implies @option{--disable-static-c++-link-check}. + @item --disable-static-c++-link-check By default, if the C++ toolchain doesn't not support static linking, configure couldn't find the C++ header files and the glibc build fails. diff --git a/nptl/Makefile b/nptl/Makefile index b3f8af2e1c..cf85a3717d 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -545,6 +545,9 @@ tests-static += \ # tests-static tests += tst-cancel24-static +ifeq ($(static-cxx-tests),no) +tests-unsupported += tst-cancel24-static +endif tests-internal += \ tst-sem11-static \