From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oGrmJ20l5GYhRAAAqHPOHw:P1 (envelope-from ) for ; Fri, 13 Sep 2024 11:43:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id oGrmJ20l5GYhRAAAqHPOHw (envelope-from ) for ; Fri, 13 Sep 2024 13:43:41 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=JiyHUEHw; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail3 header.b=OKmX0f7g; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726227821; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=dQfOtroz/cKOcxKYujls6p9M94cFfNe+0KsuIwtG7lo=; b=EoJIasI0S099eb8k3whhhsQtb30202hPX/sNILc2FoMkNHsinOkjsXDrznKzUQjUrcwWdW lXIjmPZYTDS6Kx1IiFALbdLhQdpU7z67+sxOE74r3fOhfcP2is9Xk22mWRZHjHGgsITwnq C6z87gOgO88b9fgH1OVm6Q5qL3zM3K60Z9NW6PHtsCDG69k8NjAE/AtQR5fHKxGX/0+g5B lW1i/5Iw/5AUQGKJsSs/nwW5KFNsVN6k/Q+/KzL/6bd97pq1qVMcJtdHsPI1x6aya8tqDn Qddav0lmdFSb/4x8zaBojVvY33x/DCaZ4ihOA2uNdlingCtg596kYYwMj/uRyg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726227821; a=rsa-sha256; cv=none; b=KuXiVrRYeLT37LBnMZ9Sci0cfomdhZl0+mhtEeCo3chbbg1+3pG6ym8arOTapmHVvCUCwZ td2MMnCjg9goeSyrgj2p0tpE58GqwHu7WCcgzkokwItKQbZLg6wa8ZejW9uPewKheRqnlI qTx/ifNA7ZZRyj0YPpW/0PJWhBHUjrrYUHqDQPGW42DstoEEEJQCe39beQcn7ErY1WFSA3 HOLoQXPNCm7sX559QPgSGMSXBNskGnN22bYVC2eeEiZWOHli8IezWEtegos8OXvaxONL+b oM8j/btyn0YNg5SqbT4tdxafDsRJkdPjCsuzbr4a0qEOfK+cH3c4use/CV47oA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=JiyHUEHw; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail3 header.b=OKmX0f7g; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 24DC816ED0 for ; Fri, 13 Sep 2024 13:43:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sp4hY-0003lO-Oe; Fri, 13 Sep 2024 07:43:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sp4hU-0003jc-0a for guix-patches@gnu.org; Fri, 13 Sep 2024 07:42:56 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sp4hT-0005P4-HY for guix-patches@gnu.org; Fri, 13 Sep 2024 07:42:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=dQfOtroz/cKOcxKYujls6p9M94cFfNe+0KsuIwtG7lo=; b=JiyHUEHwSq+K5ENRgBe7AZlgzxHrW8UqVHflkYbI1CUbGZOWLpIneq1VnzbIEqCNQ2lyPmX1uY/MKDt1VGMf4F+AwttbmvSDz9uF+BFmTUugN4lfm+P3LLko1gQVCTfKigH3XntD5vgt9wFJIJ2AQRbvSGisN8UEc35p+P5CNKDQtxckVF/svJP8xph7LLN5mIY7csEVXJjVRmTud774taU1uTbfiZyiGMMylVd+bwrgxXFYgfzMsz9GVdA3N/uH6UhMV5Hn2Kb2WlBv7DVumva9KP09urxiUu4oxmoRWoU4q9D1PmuvzWIGrySFgdFk/I6a7deaBXb2krvY7HsALQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sp4hc-0008IC-IN for guix-patches@gnu.org; Fri, 13 Sep 2024 07:43:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 5/5] gnu: arm-none-eabi toolchain 12.3.rel1 Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622776931808 (code B ref 73118); Fri, 13 Sep 2024 11:43:04 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:49 +0000 Received: from localhost ([127.0.0.1]:42624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4hM-0008Gv-FV for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:49 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:24443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4hJ-0008GO-Sr for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227750; x=1726486950; bh=dQfOtroz/cKOcxKYujls6p9M94cFfNe+0KsuIwtG7lo=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=OKmX0f7gZxg6WDiqzlGZeHEVzI8yAX+Dk/zTDqbVnysPGlxix5e1xBPheuppRMVTY fV00UCnvbm0sTjbOTdV5rjhvgSNxy2JdUw+wC8BYwPSFgA9gGEZrkfmggiq4ICyf8w SL1GuZDqNIiiEiaoocJFqH5eTY27p10IhTrTJJfpWSChuvAEdNYj5J+A0MqNLB9gXD 7ciNhsAHkt1fXaq7vr7RuH9qjqv/4UShisvbWjZo9d4Swn47oN/nEcDRvqVX+K2SPa PAluuXA917JXsXEE5rr1dF6UNTK/SmjjqDO75to8JdqrP9J+IOM4qv6f5HNOk4me91 iI23BRbMAwbqw== Date: Fri, 13 Sep 2024 11:42:26 +0000 Message-ID: <19457873ffa7dc65eef642a8e791fa37a4ba16c4.1726227323.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 4a93e7b4bcab4960833702400869b524a5829211 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Rutherther X-ACL-Warn: , Rutherther via Guix-patches From: Rutherther via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.99 X-Migadu-Queue-Id: 24DC816ED0 X-Spam-Score: -6.99 X-TUID: 7J5PFMtpeRfQ Introduces arm-none-eabi 12.3.rel1 toolchain The arguments for this toolchain are taken mostly out of here https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads/12-3-rel1 * gnu/packages/patches/newlib-getentropy.patch: Add a patch. * gnu/local.mk: Register it. * gnu/packages/embedded.scm (make-gcc-arm-none-eabi-12.3.rel1): Add variabl= e. * gnu/packages/embedded.scm (make-newlib-arm-none-eabi-12.3.rel1): Add vari= able. * gnu/packages/embedded.scm (make-newlib-nano-arm-none-eabi-12.3.rel1): Add= variable. * gnu/packages/embedded.scm (make-arm-none-eabi-toolchain-12.3.rel1): Add v= ariable. * gnu/packages/embedded.scm (make-arm-none-eabi-toolchain-nano-12.3.rel1): = Add variable. Change-Id: If4220c6bc7b1def240cbb9d5d245758f7c51a8a0 --- gnu/local.mk | 1 + gnu/packages/embedded.scm | 110 +++++- gnu/packages/patches/newlib-getentropy.patch | 380 +++++++++++++++++++ 3 files changed, 490 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/newlib-getentropy.patch diff --git a/gnu/local.mk b/gnu/local.mk index ed630041ff..ce40b7e28b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1800,6 +1800,7 @@ dist_patch_DATA =3D=09=09=09=09=09=09\ %D%/packages/patches/ngircd-handle-zombies.patch=09=09\ %D%/packages/patches/network-manager-plugin-path.patch=09\ %D%/packages/patches/network-manager-meson.patch=09=09\ + %D%/packages/patches/newlib-getentropy.patch=09=09=09\ %D%/packages/patches/nginx-socket-cloexec.patch=09=09\ %D%/packages/patches/nickle-man-release-date.patch=09=09\ %D%/packages/patches/nnpack-system-libraries.patch=09=09\ diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 4b9da1f529..cc999d35f8 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -78,22 +78,27 @@ (define-module (gnu packages embedded) #:export (make-gcc-arm-none-eabi-4.9 make-gcc-arm-none-eabi-6 make-gcc-arm-none-eabi-7-2018-q2-update + make-gcc-arm-none-eabi-12.3.rel1 =20 make-gcc-vc4 =20 make-newlib-arm-none-eabi make-newlib-arm-none-eabi-7-2018-q2-update + make-newlib-arm-none-eabi-12.3.rel1 =20 make-newlib-nano-arm-none-eabi make-newlib-nano-arm-none-eabi-7-2018-q2-update + make-newlib-nano-arm-none-eabi-12.3.rel1 =20 make-arm-none-eabi-toolchain-4.9 make-arm-none-eabi-toolchain-6 make-arm-none-eabi-toolchain-7-2018-q2-update + make-arm-none-eabi-toolchain-12.3.rel1 =20 make-arm-none-eabi-nano-toolchain-4.9 make-arm-none-eabi-nano-toolchain-6 make-arm-none-eabi-nano-toolchain-7-2018-q2-update + make-arm-none-eabi-nano-toolchain-12.3.rel1 =20 make-gdb-arm-none-eabi =20 @@ -468,12 +473,103 @@ (define make-newlib-nano-arm-none-eabi-7-2018-q2-upd= ate (mlambda () (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-nano-arm= -none-eabi)))) =20 +=0C +;;; The following definitions are for the "12.3.rel1" variant of the +;;; ARM cross toolchain as offered on https://developer.arm.com +(define-public make-gcc-arm-none-eabi-12.3.rel1 + (mlambda () + (let ((base (make-gcc-arm-none-eabi-7-2018-q2-update)) + (xgcc-base (cross-gcc "arm-none-eabi" + #:xgcc gcc-12 + #:xbinutils (cross-binutils "arm-none-eabi= ")))) + (package + (inherit base) + (version "12.3.rel1") + (source + (origin + (inherit (package-source xgcc-base)) + (method git-fetch) + (uri (git-reference + (url "git://gcc.gnu.org/git/gcc.git") + (commit "0f54a73b998b72f7c8452a63730ec3b16fc47854"))) + (sha256 + (base32 "0r6q0m3d8g3k3rkmnqjw8aw5fcnsrmywf4ispdkxmk1al3whk1vk"= )))) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'expand-version-string + (lambda _ + (make-file-writable "gcc/DEV-PHASE") + (with-output-to-file "gcc/DEV-PHASE" + (lambda () + (display "12.3.rel1"))))))) + ((#:configure-flags flags) + #~(cons* "--with-multilib-list=3Daprofile,rmprofile" + "--with-headers=3Dyes" + "--enable-checking=3Drelease" + "--with-gnu-as" + "--with-gnu-ld" + (filter + (lambda (flag) + (not (member flag + '("--with-multilib-list=3Drmprofile" + "--enable-plugins" + "--disable-libffi")))) + #$flags))))))))) + +(define make-base-newlib-arm-none-eabi-12.3.rel1 + (mlambda (original-base) + (let ((base (make-base-newlib-arm-none-eabi-7-2018-q2-update original-= base)) + (commit "4c7d0dfec5793cbf5cf3930b91f930479126d8ce") + (revision "0")) + (package + (inherit base) + (version (git-version "4.3.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "http://sourceware.org/git/newlib-cygwin.git") + (commit commit))) + (sha256 + (base32 + "0drs9v8avh4y2h5bs0ixjn9x662jzkkikx8z034wgl41dxmn6786")))) + (arguments (substitute-keyword-arguments (package-arguments base) + ((#:configure-flags flags) + #~(cons* "--enable-newlib-mb" + "--enable-newlib-reent-check-verify" + "--enable-newlib-register-fini" + #$flags)))))))) + +(define make-newlib-arm-none-eabi-12.3.rel1 + (mlambda () + (make-base-newlib-arm-none-eabi-12.3.rel1 (make-newlib-arm-none-eabi))= )) + +(define make-newlib-nano-arm-none-eabi-12.3.rel1 + (mlambda () + (make-base-newlib-arm-none-eabi-12.3.rel1 (make-newlib-nano-arm-none-e= abi)))) + =0C (define make-libstdc++-arm-none-eabi (mlambda (xgcc newlib) - (let ((libstdc++ (make-libstdc++ xgcc))) + (let* ((libstdc++ (make-libstdc++ xgcc)) + (src (package-source libstdc++))) (package (inherit libstdc++) + (source + (origin + (inherit src) + (patches (append + ; libstdc++ cannot be linked with since the configure= phase + ; cannot detect properly the presence of getentropy f= unction. + ; The function is inside of a header, but it's not pr= esent in the resulting + ; newlib. configure will conclude getentropy is prese= nt, + ; random will use getentropy, and any linking with ra= ndom will fail. + (if (version>=3D? (package-version xgcc) "12.0") + (search-patches "newlib-getentropy.patch") + '()) + (origin-patches src))))) (name "libstdc++-arm-none-eabi") (arguments (substitute-keyword-arguments (package-arguments libstdc++) @@ -626,6 +722,18 @@ (define make-arm-none-eabi-nano-toolchain-7-2018-q2-up= date (make-gcc-arm-none-eabi-7-2018-q2-update) (make-newlib-nano-arm-none-eabi-7-2018-q2-update)))) =20 +(define make-arm-none-eabi-toolchain-12.3.rel1 + (mlambda () + (make-arm-none-eabi-toolchain + (make-gcc-arm-none-eabi-12.3.rel1) + (make-newlib-arm-none-eabi-12.3.rel1)))) + +(define make-arm-none-eabi-nano-toolchain-12.3.rel1 + (mlambda () + (make-arm-none-eabi-toolchain + (make-gcc-arm-none-eabi-12.3.rel1) + (make-newlib-nano-arm-none-eabi-12.3.rel1)))) + (define make-gdb-arm-none-eabi (mlambda () (package diff --git a/gnu/packages/patches/newlib-getentropy.patch b/gnu/packages/pa= tches/newlib-getentropy.patch new file mode 100644 index 0000000000..a4137d81f0 --- /dev/null +++ b/gnu/packages/patches/newlib-getentropy.patch @@ -0,0 +1,380 @@ +Patch-Source: https://github.com/zephyrproject-rtos/gcc/pull/8 + +From 55addb0c0c5ff5e0aab85574aa26abf175af85c8 Mon Sep 17 00:00:00 2001 +From: Stephanos Ioannidis +Date: Mon, 25 Jul 2022 23:10:41 +0900 +Subject: [PATCH] libstdc++: Do not check getentropy and arc4random for cro= ss builds + +The "getentropy" and "arc4random" check may not yield a correct result +for the cross compile builds because linking is often not available for +them and the C library headers (notoriously, newlib) may still declare +these function prototypes even if they are not actually part of the +final library -- for this reason, this commit disables the "getentropy" +and "arc4random" checks for non-native builds. + +This effectively prevents the std::random_device from making use of +these functions when `--with-newlib` is specified, which is indeed a +correct behaviour because the newlib does not provide a default stub +for the "getentropy" function (also note that the newlib "arc4random" +implementation internally calls the missing "getentropy" function). + +For other C libraries, the `GLIBCXX_CROSSCONFIG` function may hard-code +the availability of these functions by manually defining +`HAVE_GETENTROPY` and `HAVE_ARC4RANDOM`, or by calling the +`GLIBCXX_CHECK_GETENTROPY` and `GLIBCXX_CHECK_ARC4RANDOM` functions. + +libstdc++-v3: +=09* configure.ac: Relocate GLIBCXX_CHECK_GETENTROPY and +=09GLIBCXX_CHECK_ARC4RANDOM +=09* configure: Regenerate. + +Signed-off-by: Stephanos Ioannidis +--- + libstdc++-v3/configure | 300 +++++++++++++++++++------------------- + libstdc++-v3/configure.ac | 8 +- + 2 files changed, 154 insertions(+), 154 deletions(-) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 0ce74e8202443..5d43b56b03ffa 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -28088,6 +28088,156 @@ $as_echo "#define _GLIBCXX_USE_RANDOM_TR1 1" >>c= onfdefs.h +=20 +=20 +=20 ++ # Check for other random number APIs ++ ++ ++ ++ ac_ext=3Dcpp ++ac_cpp=3D'$CXXCPP $CPPFLAGS' ++ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 ++$as_echo_n "checking for getentropy... " >&6; } ++if ${glibcxx_cv_getentropy+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ if test x$gcc_no_link =3D xyes; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i; ++=09 ::getentropy(&i, sizeof(i)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ glibcxx_cv_getentropy=3Dyes ++else ++ glibcxx_cv_getentropy=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++else ++ if test x$gcc_no_link =3D xyes; then ++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 ++fi ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i; ++=09 ::getentropy(&i, sizeof(i)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ glibcxx_cv_getentropy=3Dyes ++else ++ glibcxx_cv_getentropy=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getentropy" = >&5 ++$as_echo "$glibcxx_cv_getentropy" >&6; } ++ ++ if test $glibcxx_cv_getentropy =3D yes; then ++ ++$as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h ++ ++ fi ++ ac_ext=3Dc ++ac_cpp=3D'$CPP $CPPFLAGS' ++ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_c_compiler_gnu ++ ++ ++ ++ ++ ++ ac_ext=3Dcpp ++ac_cpp=3D'$CXXCPP $CPPFLAGS' ++ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 ++$as_echo_n "checking for arc4random... " >&6; } ++if ${glibcxx_cv_arc4random+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ if test x$gcc_no_link =3D xyes; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i =3D ::arc4random(); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ glibcxx_cv_arc4random=3Dyes ++else ++ glibcxx_cv_arc4random=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++else ++ if test x$gcc_no_link =3D xyes; then ++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 ++fi ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i =3D ::arc4random(); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ glibcxx_cv_arc4random=3Dyes ++else ++ glibcxx_cv_arc4random=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_arc4random" = >&5 ++$as_echo "$glibcxx_cv_arc4random" >&6; } ++ ++ if test $glibcxx_cv_arc4random =3D yes; then ++ ++$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h ++ ++ fi ++ ac_ext=3Dc ++ac_cpp=3D'$CPP $CPPFLAGS' ++ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_c_compiler_gnu ++ ++ ++ + # For TLS support. +=20 +=20 +@@ -75519,156 +75669,6 @@ $as_echo "#define _GLIBCXX_X86_RDSEED 1" >>confd= efs.h + fi +=20 +=20 +-# Check for other random number APIs +- +- +- +- ac_ext=3Dcpp +-ac_cpp=3D'$CXXCPP $CPPFLAGS' +-ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 +-$as_echo_n "checking for getentropy... " >&6; } +-if ${glibcxx_cv_getentropy+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test x$gcc_no_link =3D xyes; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i; +-=09 ::getentropy(&i, sizeof(i)); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- glibcxx_cv_getentropy=3Dyes +-else +- glibcxx_cv_getentropy=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- if test x$gcc_no_link =3D xyes; then +- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i; +-=09 ::getentropy(&i, sizeof(i)); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- glibcxx_cv_getentropy=3Dyes +-else +- glibcxx_cv_getentropy=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getentropy" = >&5 +-$as_echo "$glibcxx_cv_getentropy" >&6; } +- +- if test $glibcxx_cv_getentropy =3D yes; then +- +-$as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h +- +- fi +- ac_ext=3Dc +-ac_cpp=3D'$CPP $CPPFLAGS' +-ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +- +- +- +- +- +- ac_ext=3Dcpp +-ac_cpp=3D'$CXXCPP $CPPFLAGS' +-ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 +-$as_echo_n "checking for arc4random... " >&6; } +-if ${glibcxx_cv_arc4random+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test x$gcc_no_link =3D xyes; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i =3D ::arc4random(); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- glibcxx_cv_arc4random=3Dyes +-else +- glibcxx_cv_arc4random=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- if test x$gcc_no_link =3D xyes; then +- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i =3D ::arc4random(); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- glibcxx_cv_arc4random=3Dyes +-else +- glibcxx_cv_arc4random=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_arc4random" = >&5 +-$as_echo "$glibcxx_cv_arc4random" >&6; } +- +- if test $glibcxx_cv_arc4random =3D yes; then +- +-$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h +- +- fi +- ac_ext=3Dc +-ac_cpp=3D'$CPP $CPPFLAGS' +-ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +- +- +- + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. +=20 + # Do checks for resource limit functions. +diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac +index e59bcdb29441f..05cdfcddbc43b 100644 +--- a/libstdc++-v3/configure.ac ++++ b/libstdc++-v3/configure.ac +@@ -269,6 +269,10 @@ if $GLIBCXX_IS_NATIVE; then + # For /dev/random and /dev/urandom for std::random_device. + GLIBCXX_CHECK_DEV_RANDOM +=20 ++ # Check for other random number APIs ++ GLIBCXX_CHECK_GETENTROPY ++ GLIBCXX_CHECK_ARC4RANDOM ++ + # For TLS support. + GCC_CHECK_TLS +=20 +@@ -474,10 +478,6 @@ GLIBCXX_CHECK_X86_RDRAND + # Check if assembler supports rdseed opcode. + GLIBCXX_CHECK_X86_RDSEED +=20 +-# Check for other random number APIs +-GLIBCXX_CHECK_GETENTROPY +-GLIBCXX_CHECK_ARC4RANDOM +- + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. + GLIBCXX_CONFIGURE_TESTSUITE +=20 --=20 2.46.0