From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aJteG2pMeF/AUwAA0tVLHw (envelope-from ) for ; Sat, 03 Oct 2020 10:03:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0FE6F2pMeF8SRwAA1q6Kng (envelope-from ) for ; Sat, 03 Oct 2020 10:03:22 +0000 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 7FC929403C9 for ; Sat, 3 Oct 2020 10:03:21 +0000 (UTC) Received: from localhost ([::1]:51426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOeNr-0005rf-2b for larch@yhetil.org; Sat, 03 Oct 2020 06:03:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOeNZ-0005qF-W2 for bug-guix@gnu.org; Sat, 03 Oct 2020 06:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOeNZ-000330-LZ for bug-guix@gnu.org; Sat, 03 Oct 2020 06:03:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOeNZ-0003Xd-HH for bug-guix@gnu.org; Sat, 03 Oct 2020 06:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#43579: g++ does not provide std::fegetround Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 03 Oct 2020 10:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43579 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Andreas Enge Received: via spool by 43579-submit@debbugs.gnu.org id=B43579.160171936713591 (code B ref 43579); Sat, 03 Oct 2020 10:03:01 +0000 Received: (at 43579) by debbugs.gnu.org; 3 Oct 2020 10:02:47 +0000 Received: from localhost ([127.0.0.1]:43000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOeNK-0003X8-Ls for submit@debbugs.gnu.org; Sat, 03 Oct 2020 06:02:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOeNF-0003Wl-Ox for 43579@debbugs.gnu.org; Sat, 03 Oct 2020 06:02:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52322) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOeN6-0002yE-VS; Sat, 03 Oct 2020 06:02:32 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43986 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kOeMu-0000gZ-J6; Sat, 03 Oct 2020 06:02:26 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200923162121.GA28654@jurong> <87wo0arulv.fsf@gnu.org> <87o8llxsew.fsf@debian> <20201002180621.GA4862@jurong> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 12 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 03 Oct 2020 12:02:18 +0200 In-Reply-To: <20201002180621.GA4862@jurong> (Andreas Enge's message of "Fri, 2 Oct 2020 20:06:21 +0200") Message-ID: <87362vhbkl.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43579@debbugs.gnu.org, Maxim Cournoyer Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: a+wMduS1c97G Hi, (Cc=E2=80=99ing Maxim who=E2=80=99s looked into this before.) Andreas Enge skribis: > well, just put these lines into a file called "round.cpp" (as attached), > and then > gcc round.cpp Ah yes, I wasn=E2=80=99t sure if this was =E2=80=98gcc-toolchain=E2=80=99 o= r not. Only 7.x (the current =E2=80=98gcc-final=E2=80=99) works: --8<---------------cut here---------------start------------->8--- $ cat t.cpp #include int main () { return std::fegetround (); } $ guix environment -C --ad-hoc gcc-toolchain@7 -- g++ -Wall -c t.cpp $ guix environment -C --ad-hoc gcc-toolchain -- g++ -Wall -c t.cpp t.cpp: In function 'int main()': t.cpp:3:16: error: 'fegetround' is not a member of 'std'; did you mean 'feg= etround'? 3 | return std::fegetround (); | ^~~~~~~~~~ In file included from /gnu/store/maa9v3r0l3kzi9y20mz5m5c1f83m75n5-profile/i= nclude/c++/fenv.h:36, from /gnu/store/maa9v3r0l3kzi9y20mz5m5c1f83m75n5-profile/i= nclude/c++/cfenv:41, from t.cpp:1: /gnu/store/maa9v3r0l3kzi9y20mz5m5c1f83m75n5-profile/include/fenv.h:104:12: = note: 'fegetround' declared here 104 | extern int fegetround (void) __THROW __attribute_pure__; | ^~~~~~~~~~ $ guix describe Generacio 162 Oct 01 2020 00:23:38 (nuna) guix 7607ace repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 7607ace5091aea0157ba5c8a508129cc5fc4f931 --8<---------------cut here---------------end--------------->8--- It=E2=80=99s the same story as . > The difference to the Opensuse headers is that in bits/c++config.h, > they define _GLIBCXX_USE_C99_FENV_TR1, which, as I understand it, > removes the fe* functions from the global namespace to put them back into > the std:: namespace. Indeed, the build log of =E2=80=98gcc-10=E2=80=99 for instance has this: --8<---------------cut here---------------start------------->8--- checking fenv.h usability... yes checking fenv.h presence... yes checking for fenv.h... yes checking for complex.h... (cached) yes checking for complex.h... (cached) yes checking for ISO C99 support to TR1 in ... yes checking for ISO C99 support to TR1 in ... yes checking for fenv.h... (cached) yes checking for ISO C99 support to TR1 in ... no --8<---------------cut here---------------end--------------->8--- Here=E2=80=99s the =E2=80=98prev-x86_64-unknown-linux-gnu/libstdc++-v3/conf= ig.log=E2=80=99 excerpt: --8<---------------cut here---------------start------------->8--- configure:16448: checking for fenv.h configure:16448: result: yes configure:16462: checking for ISO C99 support to TR1 in configure:16490: /tmp/guix-build-gcc-10.2.0.drv-0/build/./gcc/xgcc -shared= -libgcc -B/tmp/guix-build-gcc-10.2.0.drv-0/build/./gcc -nostdinc++ -L/tmp/g= uix-build-gcc-10.2.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src = -L/tmp/guix-build-gcc-10.2.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++= -v3/src/.libs -L/tmp/guix-build-gcc-10.2.0.drv-0/build/x86_64-unknown-linux= -gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/xpdy9vvqym9xv7praqkwsm3gdzn2= kv1p-gcc-10.2.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/xpdy9vvqym9xv7pr= aqkwsm3gdzn2kv1p-gcc-10.2.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/sto= re/xpdy9vvqym9xv7praqkwsm3gdzn2kv1p-gcc-10.2.0/x86_64-unknown-linux-gnu/inc= lude -isystem /gnu/store/xpdy9vvqym9xv7praqkwsm3gdzn2kv1p-gcc-10.2.0/x86_64= -unknown-linux-gnu/sys-include -fno-checking -c -g -O2 -D_GNU_SOURCE -std= =3Dc++98 conftest.cpp >&5 conftest.cpp: In function 'int main()': conftest.cpp:102:7: error: 'fexcept_t' was not declared in this scope; did = you mean 'except'? 102 | fexcept_t* pflag; | ^~~~~~~~~ | except conftest.cpp:102:18: error: 'pflag' was not declared in this scope 102 | fexcept_t* pflag; | ^~~~~ conftest.cpp:103:7: error: 'fenv_t' was not declared in this scope 103 | fenv_t* penv; | ^~~~~~ conftest.cpp:103:15: error: 'penv' was not declared in this scope 103 | fenv_t* penv; | ^~~~ conftest.cpp:105:13: error: 'feclearexcept' was not declared in this scope 105 | ret =3D feclearexcept(except); | ^~~~~~~~~~~~~ conftest.cpp:106:13: error: 'fegetexceptflag' was not declared in this scope 106 | ret =3D fegetexceptflag(pflag, except); | ^~~~~~~~~~~~~~~ conftest.cpp:107:13: error: 'feraiseexcept' was not declared in this scope 107 | ret =3D feraiseexcept(except); | ^~~~~~~~~~~~~ conftest.cpp:108:13: error: 'fesetexceptflag' was not declared in this scope 108 | ret =3D fesetexceptflag(pflag, except); | ^~~~~~~~~~~~~~~ conftest.cpp:109:13: error: 'fetestexcept' was not declared in this scope 109 | ret =3D fetestexcept(except); | ^~~~~~~~~~~~ conftest.cpp:110:13: error: 'fegetround' was not declared in this scope 110 | ret =3D fegetround(); | ^~~~~~~~~~ conftest.cpp:111:13: error: 'fesetround' was not declared in this scope 111 | ret =3D fesetround(mode); | ^~~~~~~~~~ conftest.cpp:112:13: error: 'fegetenv' was not declared in this scope 112 | ret =3D fegetenv(penv); | ^~~~~~~~ conftest.cpp:113:13: error: 'feholdexcept' was not declared in this scope 113 | ret =3D feholdexcept(penv); | ^~~~~~~~~~~~ conftest.cpp:114:13: error: 'fesetenv' was not declared in this scope 114 | ret =3D fesetenv(penv); | ^~~~~~~~ conftest.cpp:115:13: error: 'feupdateenv' was not declared in this scope 115 | ret =3D feupdateenv(penv); | ^~~~~~~~~~~ configure:16490: $? =3D 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "package-unused" | #define PACKAGE_TARNAME "libstdc++" | #define PACKAGE_VERSION "version-unused" | #define PACKAGE_STRING "package-unused version-unused" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define _GLIBCXX_HOSTED 1 | #define _GLIBCXX_VERBOSE 1 | #define _GLIBCXX_ATOMIC_BUILTINS 1 | #define HAVE_ATOMIC_LOCK_POLICY 1 | #define _GLIBCXX_USE_DECIMAL_FLOAT 1 | #define _GLIBCXX_USE_INT128 1 | #define HAVE_STRXFRM_L 1 | #define HAVE_STRERROR_L 1 | #define HAVE_STRERROR_R 1 | #define _GLIBCXX_USE_LONG_LONG 1 | #define HAVE_WCHAR_H 1 | #define HAVE_MBSTATE_T 1 | #define HAVE_WCTYPE_H 1 | #define _GLIBCXX_USE_WCHAR_T 1 | #define _GLIBCXX98_USE_C99_MATH 1 | #define HAVE_TGMATH_H 1 | #define HAVE_COMPLEX_H 1 | #define _GLIBCXX98_USE_C99_COMPLEX 1 | #define _GLIBCXX98_USE_C99_STDIO 1 | #define _GLIBCXX98_USE_C99_STDLIB 1 | #define HAVE_VFWSCANF 1 | #define HAVE_VSWSCANF 1 | #define HAVE_VWSCANF 1 | #define HAVE_WCSTOF 1 | #define HAVE_ISWBLANK 1 | #define _GLIBCXX98_USE_C99_WCHAR 1 | #define _GLIBCXX_USE_C99 1 | #define _GLIBCXX11_USE_C99_MATH 1 | #define HAVE_TGMATH_H 1 | #define HAVE_COMPLEX_H 1 | #define _GLIBCXX11_USE_C99_COMPLEX 1 | #define _GLIBCXX11_USE_C99_STDIO 1 | #define _GLIBCXX11_USE_C99_STDLIB 1 | #define HAVE_VFWSCANF 1 | #define HAVE_VSWSCANF 1 | #define HAVE_VWSCANF 1 | #define HAVE_WCSTOF 1 | #define HAVE_ISWBLANK 1 | #define _GLIBCXX11_USE_C99_WCHAR 1 | #define _GLIBCXX_FULLY_DYNAMIC_STRING 0 | #define HAVE_GETS 1 | #define HAVE_EOWNERDEAD 1 | #define HAVE_ENOTRECOVERABLE 1 | #define HAVE_ENOLINK 1 | #define HAVE_EPROTO 1 | #define HAVE_ENODATA 1 | #define HAVE_ENOSR 1 | #define HAVE_ENOSTR 1 | #define HAVE_ETIME 1 | #define HAVE_EBADMSG 1 | #define HAVE_ECANCELED 1 | #define HAVE_EOVERFLOW 1 | #define HAVE_ENOTSUP 1 | #define HAVE_EIDRM 1 | #define HAVE_ETXTBSY 1 | #define HAVE_ECHILD 1 | #define HAVE_ENOSPC 1 | #define HAVE_EPERM 1 | #define HAVE_ETIMEDOUT 1 | #define HAVE_EWOULDBLOCK 1 | #define HAVE_UCHAR_H 1 | #define _GLIBCXX_USE_C11_UCHAR_CXX11 1 | #define HAVE_INT64_T 1 | #define HAVE_INT64_T_LONG 1 | #define _GLIBCXX_USE_LFS 1 | #define HAVE_SYS_IOCTL_H 1 | #define HAVE_POLL 1 | #define HAVE_S_ISREG 1 | #define HAVE_SYS_UIO_H 1 | #define HAVE_WRITEV 1 | #define HAVE_FENV_H 1 | #define HAVE_COMPLEX_H 1 | #define HAVE_COMPLEX_H 1 | #define _GLIBCXX_USE_C99_COMPLEX_TR1 1 | #define _GLIBCXX_USE_C99_CTYPE_TR1 1 | #define HAVE_FENV_H 1 | /* end confdefs.h. */ | #include | int | main () | { | int except, mode; | fexcept_t* pflag; | fenv_t* penv; | int ret; | ret =3D feclearexcept(except); | ret =3D fegetexceptflag(pflag, except); | ret =3D feraiseexcept(except); | ret =3D fesetexceptflag(pflag, except); | ret =3D fetestexcept(except); | ret =3D fegetround(); | ret =3D fesetround(mode); | ret =3D fegetenv(penv); | ret =3D feholdexcept(penv); | ret =3D fesetenv(penv); | ret =3D feupdateenv(penv); |=20 | ; | return 0; | } configure:16497: result: no --8<---------------cut here---------------end--------------->8--- The same program builds fine outside. Turns out GCC provides , too: --8<---------------cut here---------------start------------->8--- $ find /tmp/guix-build-gcc-10.2.0.drv-0/ -name fenv.h /tmp/guix-build-gcc-10.2.0.drv-0/gcc-10.2.0/fixincludes/tests/base/bits/fen= v.h /tmp/guix-build-gcc-10.2.0.drv-0/gcc-10.2.0/libstdc++-v3/include/tr1/fenv.h /tmp/guix-build-gcc-10.2.0.drv-0/gcc-10.2.0/libstdc++-v3/include/c_compatib= ility/fenv.h /tmp/guix-build-gcc-10.2.0.drv-0/build/prev-x86_64-unknown-linux-gnu/libstd= c++-v3/include/tr1/fenv.h /tmp/guix-build-gcc-10.2.0.drv-0/build/prev-x86_64-unknown-linux-gnu/libstd= c++-v3/include/fenv.h --8<---------------cut here---------------end--------------->8--- So this is again #include_next not picking the right due to search path ordering issues and/or duplicate entries. Thoughts anyone? I think we need a proper fix but the feedback we got from GCC folks last time didn=E2=80=99t give me much insight as to what we should do. > This should happen somewhere in a configure phase inside the gcc build, b= ut > I do not know how to obtain the config.log file easily (short of adding a > phase "(const #f)" to the build recipe and doing a "guix build -K"). I do: guix build -e '(@ (gnu packages gcc) gcc-10)' --no-grafts --check -K Then I hit C-c once the relevant =E2=80=98configure=E2=80=99 has run (you c= an check what=E2=80=99s in /tmp/guix-build-gcc-10*). :-) Thanks, Ludo=E2=80=99.