GNU bug report logs - #42392
GCC includes ordering issue? g++: error: 'round' is not a member of 'std'

Previous Next

Package: guix;

Reported by: maxim.cournoyer <at> gmail.com

Date: Thu, 16 Jul 2020 13:53:02 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42392 in the body.
You can then email your comments to 42392 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#42392; Package guix. (Thu, 16 Jul 2020 13:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to maxim.cournoyer <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 16 Jul 2020 13:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: maxim.cournoyer <at> gmail.com
To: bug-guix <bug-guix <at> gnu.org>
Subject: GCC includes ordering issue? g++: error: 'round' is not a member of
 'std'
Date: Thu, 16 Jul 2020 09:51:11 -0400
[Message part 1 (text/plain, inline)]
Hello,

The following C++ snippet file reproduces it:

[test.cpp (text/plain, inline)]
// file: test.cpp

#include <cmath>
#include <iostream>


int main() {
    float x = 9.999;

    std::cout << "rounding value: " << x << " --> " << std::round(x);

    return 0;
}

// build with:
// g++ -o test.o -std=c++17 test.cpp
[Message part 3 (text/plain, inline)]
It affects only GCC 8 and newer, GCC 7 is fine.  The available "round"
seems to be the one originating from tgmath.h (implementation detail of
math.h AFAICT).

The std::round function is conditionally defined in the C++ standard
(since C++11) in the cmath header. It is supposed to also #undef the
global "round" macro, but it doesn't, or perhaps the ordering of the
includes is wrong and math.h gets included following cmath.

In cmath, macros such as 'round' are undefined based on some
conditions.  These conditions appear to be:

__cplusplus >= 201103L and _GLIBCXX_USE_C99_MATH_TR1 and not _GLIBCXX_NO_C99_ROUNDING_FUNCS

The following are some data points I've gathered from the following guix environment:

--8<---------------cut here---------------start------------->8---
guix environment --pure  gcc-toolchain <at> 10 --ad-hoc coreutils findutils
strace the-silver-searcher
--8<---------------cut here---------------end--------------->8---


--8<---------------cut here---------------start------------->8---
echo $CPLUS_INCLUDE_PATH
/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/c++:/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include
--8<---------------cut here---------------end--------------->8---

The following lists the special #include_next directives, which tells
cpp (the C preprocessor) to look for the next file with that name in the
remaining of the its search path (as opposed to by starting the lookup
in the current search path).

--8<---------------cut here---------------start------------->8---
ag -f include_next $(realpath /gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/*)
/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/bits/std_abs.h
37:#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
38:#include_next <stdlib.h>
40:# include_next <math.h>
42:#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/cmath
44:#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
45:#include_next <math.h>
46:#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/complex.h
38:# include_next <complex.h>

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/cstdlib
74:#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
75:#include_next <stdlib.h>
76:#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS

/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/limits.h
40:   #include's protect themselves, and in GCC 2 we may #include_next through
47:/* We don't have #include_next.
119:    We put this #include_next outside the double inclusion check because
124:# include_next <limits.h>

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/fenv.h
36:# include_next <fenv.h>

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/math.h
29:#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
30:# include_next <math.h>

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/stdlib.h
29:#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
30:# include_next <stdlib.h>

/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/tgmath.h
35:#  include_next <tgmath.h>
--8<---------------cut here---------------end--------------->8---


Finally, the following lists the exact order in which g++/cpp have
opened them (I'm hoping that maps with the order it derived from its search
path/#include_next):

--8<---------------cut here---------------start------------->8---
strace -z -f -e trace=openat g++ -o test.o -std=c++14 test.cpp
[...]
[pid  8163] openat(AT_FDCWD, "test.cpp", O_RDONLY|O_NOCTTY) = 3
[pid  8163] openat(AT_FDCWD, "/tmp/ccEUTfto.s", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/stdc-predef.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD,
"/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/c++/cmath",
O_RDONLY|O_NOCTTY) = 4  # From gcc-10.1.0
[pid  8163] openat(AT_FDCWD, "/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/x86_64-unknown-linux-gnu/bits/os_defines.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/features.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/sys/cdefs.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/wordsize.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/long-double.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/gnu/stubs.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/gnu/stubs-64.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/x86_64-unknown-linux-gnu/bits/cpu_defines.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/c++/bits/cpp_type_traits.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/c++/ext/type_traits.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD,
"/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/math.h",
O_RDONLY|O_NOCTTY) = 4  # This one is from glibc-2.31
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/libc-header-start.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/types.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/wordsize.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/timesize.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/typesizes.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/time64.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/math-vector.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/libm-simd-decl-stubs.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/floatn.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/floatn-common.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/long-double.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/flt-eval-method.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/fp-logb.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/fp-fast.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-helper-functions.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-helper-functions.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-helper-functions.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-helper-functions.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls-narrow.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/iscanonical.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/c++/bits/std_abs.h", O_RDONLY|O_NOCTTY) = 4
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/stdlib.h", O_RDONLY|O_NOCTTY) = 4

[...]

[pid  8163] openat(AT_FDCWD, "test.cpp", O_RDONLY) = 4
test.cpp: In function 'int main()':
test.cpp:10:61: error: 'round' is not a member of 'std'; did you mean 'round'?
   10 |     std::cout << "rounding value: " << x << " --> " << std::round(x);
      |                                                             ^~~~~
[pid  8163] openat(AT_FDCWD, "/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h", O_RDONLY) = 5
In file included from /gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/features.h:465,
                 from /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/x86_64-unknown-linux-gnu/bits/os_defines.h:39,
                 from /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h:518,
                 from /gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/c++/cmath:41,
                 from test.cpp:3:
/gnu/store/4rssdv43wikii23rghfjlr62z83x44r0-profile/include/bits/mathcalls.h:298:1: note: 'round' declared here
  298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
[pid  8163] +++ exited with 1 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=8163, si_uid=1000, si_status=1, si_utime=43, si_stime=8} ---
+++ exited with 1 +++
--8<---------------cut here---------------end--------------->8---

Perhaps the wrong math.h (the one from glibc) is being included? Indeed,
browsing its content, I can't see a definition for round, and all cmath
does is wrap the original definitions in the std namespace!

The possible math.h candidates are:

--8<---------------cut here---------------start------------->8---
find -L /gnu/store/dis9nlzbqy5j860gl1nxjijmcw9dsb6w-profile/include -name '*math.h' | xargs realpath
/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/math.h
/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/tgmath.h
/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/tr1/math.h
/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/include/c++/tr1/tgmath.h
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/math.h
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/tgmath.h
--8<---------------cut here---------------end--------------->8---

The #include_next does what it's intended to do and pick math.h from
another search directory with a file of the same name, which it finds in
glibc.

I don't have any more ideas of things to look at at this point in time.

Maxim

Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 20 Jul 2020 21:46:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#42392; Package guix. (Tue, 21 Jul 2020 15:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 42392 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: maxim.cournoyer <at> gmail.com
Cc: 42392 <at> debbugs.gnu.org
Subject: Re: bug#42392: GCC includes ordering issue? g++: error: 'round' is
 not a member of 'std'
Date: Tue, 21 Jul 2020 17:27:22 +0200
[Message part 1 (text/plain, inline)]
Hi,

maxim.cournoyer <at> gmail.com skribis:

> The following C++ snippet file reproduces it:
>
> // file: test.cpp
>
> #include <cmath>
> #include <iostream>
>
>
> int main() {
>     float x = 9.999;
>
>     std::cout << "rounding value: " << x << " --> " << std::round(x);
>
>     return 0;
> }
>
> // build with:
> // g++ -o test.o -std=c++17 test.cpp
>
>
> It affects only GCC 8 and newer, GCC 7 is fine.  The available "round"
> seems to be the one originating from tgmath.h (implementation detail of
> math.h AFAICT).
>
> The std::round function is conditionally defined in the C++ standard
> (since C++11) in the cmath header. It is supposed to also #undef the
> global "round" macro, but it doesn't, or perhaps the ordering of the
> includes is wrong and math.h gets included following cmath.
>
> In cmath, macros such as 'round' are undefined based on some
> conditions.  These conditions appear to be:
>
> __cplusplus >= 201103L and _GLIBCXX_USE_C99_MATH_TR1 and not _GLIBCXX_NO_C99_ROUNDING_FUNCS

See also
<https://lists.gnu.org/archive/html/guix-devel/2020-06/msg00096.html>,
which suggests rather a misconfiguration issue.

Comparing ‘c++config.h’ from GCC 7 (which works) and GCC 8 (the first
one that exhibits this problem), we see:

[Message part 2 (text/x-patch, inline)]
diff -ubBr --show-c-function /gnu/store/93z2pmmpla1n47q3xivqyic4mwvy0r5q-gcc-toolchain-8.4.0/include/c\+\+/x86_64-unknown-linux-gnu/bits/c\+\+config.h /gnu/store/xa45bzcbib4zqa7gk70nb35dzzwyr376-gcc-toolchain-7.5.0/include/c\+\+/x86_64-unknown-linux-gnu/bits/c\+\+config.h
--- /gnu/store/xa45bzcbib4zqa7gk70nb35dzzwyr376-gcc-toolchain-7.5.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h	1970-01-01 01:00:01.000000000 +0100
+++ /gnu/store/93z2pmmpla1n47q3xivqyic4mwvy0r5q-gcc-toolchain-8.4.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h	1970-01-01 01:00:01.000000000 +0100

[...]

@@ -644,61 +619,61 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to 1 if you have the `acosf' function. */
-#define _GLIBCXX_HAVE_ACOSF 1
+/* #undef _GLIBCXX_HAVE_ACOSF */
 
 /* Define to 1 if you have the `acosl' function. */
-#define _GLIBCXX_HAVE_ACOSL 1
+/* #undef _GLIBCXX_HAVE_ACOSL */
 
 /* Define to 1 if you have the `aligned_alloc' function. */
 #define _GLIBCXX_HAVE_ALIGNED_ALLOC 1
 
 /* Define to 1 if you have the `asinf' function. */
-#define _GLIBCXX_HAVE_ASINF 1
+/* #undef _GLIBCXX_HAVE_ASINF */
 
 /* Define to 1 if you have the `asinl' function. */
-#define _GLIBCXX_HAVE_ASINL 1
+/* #undef _GLIBCXX_HAVE_ASINL */
 
 /* Define to 1 if the target assembler supports .symver directive. */
 #define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1
 
 /* Define to 1 if you have the `atan2f' function. */
-#define _GLIBCXX_HAVE_ATAN2F 1
+/* #undef _GLIBCXX_HAVE_ATAN2F */
 
 /* Define to 1 if you have the `atan2l' function. */
-#define _GLIBCXX_HAVE_ATAN2L 1
+/* #undef _GLIBCXX_HAVE_ATAN2L */
 
 /* Define to 1 if you have the `atanf' function. */
-#define _GLIBCXX_HAVE_ATANF 1
+/* #undef _GLIBCXX_HAVE_ATANF */
 
 /* Define to 1 if you have the `atanl' function. */
-#define _GLIBCXX_HAVE_ATANL 1
+/* #undef _GLIBCXX_HAVE_ATANL */
 
 /* Define to 1 if you have the `at_quick_exit' function. */
-#define _GLIBCXX_HAVE_AT_QUICK_EXIT 1
+/* #undef _GLIBCXX_HAVE_AT_QUICK_EXIT */
 
 /* Define to 1 if the target assembler supports thread-local storage. */
 /* #undef _GLIBCXX_HAVE_CC_TLS */
 
 /* Define to 1 if you have the `ceilf' function. */
-#define _GLIBCXX_HAVE_CEILF 1
+/* #undef _GLIBCXX_HAVE_CEILF */
 
 /* Define to 1 if you have the `ceill' function. */
-#define _GLIBCXX_HAVE_CEILL 1
+/* #undef _GLIBCXX_HAVE_CEILL */
 
 /* Define to 1 if you have the <complex.h> header file. */
-#define _GLIBCXX_HAVE_COMPLEX_H 1
+/* #undef _GLIBCXX_HAVE_COMPLEX_H */
 
 /* Define to 1 if you have the `cosf' function. */
-#define _GLIBCXX_HAVE_COSF 1
+/* #undef _GLIBCXX_HAVE_COSF */
 
 /* Define to 1 if you have the `coshf' function. */
-#define _GLIBCXX_HAVE_COSHF 1
+/* #undef _GLIBCXX_HAVE_COSHF */
 
 /* Define to 1 if you have the `coshl' function. */
-#define _GLIBCXX_HAVE_COSHL 1
+/* #undef _GLIBCXX_HAVE_COSHL */
 
 /* Define to 1 if you have the `cosl' function. */
-#define _GLIBCXX_HAVE_COSL 1
+/* #undef _GLIBCXX_HAVE_COSL */
 
 /* Define to 1 if you have the <dirent.h> header file. */
 #define _GLIBCXX_HAVE_DIRENT_H 1
[Message part 3 (text/plain, inline)]
/tmp/guix-build-gcc-10.1.0.drv-0/build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/config.log
reads this:

--8<---------------cut here---------------start------------->8---
configure:19924: checking for float trig functions
configure:19948:  /tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc/xgcc -shared-libgcc -B/tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc -nostdinc++ -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/include -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/sys-include   -fno-checking -c -fno-builtin -D_GNU_SOURCE  conftest.cpp >&5
In file included from /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/math.h:36,
                 from conftest.cpp:122:
/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/cmath:41:10: fatal error: bits/c++config.h: No such file or directory
   41 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:19948: $? = 1
configure: failed program was:

[...]

| /* end confdefs.h.  */
| #include <math.h>
| int
| main ()
| {
| acosf (0); asinf (0); atanf (0); cosf (0); sinf (0); tanf (0); coshf (0); sinhf (0); tanhf (0);
|   ;
|   return 0;
| }
configure:19962: result: no
--8<---------------cut here---------------end--------------->8---

At this point, we have:

--8<---------------cut here---------------start------------->8---
export CPLUS_INCLUDE_PATH=\
"/gnu/store/61pv34q6kad3cii1pngyairvxbxgdm1n-isl-0.22.1/include\
:/gnu/store/35afkywncrr5xsb4cxcljf6rpjcb7f61-gmp-6.2.0/include\
:/gnu/store/5jf395qa3v4amdi60850rz2a15zlsrza-mpfr-4.0.2/include\
:/gnu/store/lgrnkwh7w5yawgqaglwj1pls5vwz1nz7-mpc-1.1.0/include\
:/gnu/store/243algr6h60j46spn5dqhjc4mhkd0a0p-libelf-0.8.13/include\
:/gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-1.2.11/include\
:/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/include\
:/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/include\
:/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/include\
:/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/include\
:/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/include\
:/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-binutils-2.34/include\
:/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++\
:/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include\
:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include\
:/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20/include"
--8<---------------cut here---------------end--------------->8---

but <bits/c++config.h> is in a directory not listed here:

--8<---------------cut here---------------start------------->8---
$ find /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 -name c++config.h
/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h
--8<---------------cut here---------------end--------------->8---

‘gcc-final’ doesn’t have this problem because it depends on ‘libstdc++’
(separate package) where:

--8<---------------cut here---------------start------------->8---
$ find /gnu/store/v507xkc5flnzqa49yp41w5y611p4lqbg-libstdc++-7.5.0 -name c++config.h
/gnu/store/v507xkc5flnzqa49yp41w5y611p4lqbg-libstdc++-7.5.0/include/bits/c++config.h
--8<---------------cut here---------------end--------------->8---

So somehow the problems seems to be that ‘xgcc’ doesn’t search
‘gcc-7.5.0/include/c++/x86_64-unknown-linux-gnu’.  We could add it to
CPLUS_INCLUDE_PATH manually, but it seems to me we’re missing something.

Thoughts?

Thanks,
Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#42392; Package guix. (Thu, 23 Jul 2020 09:39:02 GMT) Full text and rfc822 format available.

Message #13 received at 42392 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: maxim.cournoyer <at> gmail.com
Cc: 42392 <at> debbugs.gnu.org
Subject: Re: bug#42392: GCC includes ordering issue? g++: error: 'round' is
 not a member of 'std'
Date: Thu, 23 Jul 2020 11:37:53 +0200
[Message part 1 (text/plain, inline)]
Hi!

Ludovic Courtès <ludo <at> gnu.org> skribis:

> /tmp/guix-build-gcc-10.1.0.drv-0/build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/config.log
> reads this:
>
> configure:19924: checking for float trig functions
> configure:19948:  /tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc/xgcc -shared-libgcc -B/tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc -nostdinc++ -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/include -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/sys-include   -fno-checking -c -fno-builtin -D_GNU_SOURCE  conftest.cpp >&5
> In file included from /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/math.h:36,
>                  from conftest.cpp:122:
> /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/cmath:41:10: fatal error: bits/c++config.h: No such file or directory
>    41 | #include <bits/c++config.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> configure:19948: $? = 1
> configure: failed program was:
>
> [...]
>
> | /* end confdefs.h.  */
> | #include <math.h>
> | int
> | main ()
> | {
> | acosf (0); asinf (0); atanf (0); cosf (0); sinf (0); tanf (0); coshf (0); sinhf (0); tanhf (0);
> |   ;
> |   return 0;
> | }
> configure:19962: result: no

The attached patch addresses this with a questionable yet efficient
hack.  The test cases reported by Maxim and by Erik Garrison now build
fine.

I’ve asked for guidance for a proper fix at
<https://gcc.gnu.org/pipermail/gcc-help/2020-July/139204.html>, but in
the meantime, I’m happy to go with this patch.

Thoughts?

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 9ff5e3d7c0..8969fefd84 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -530,6 +530,12 @@ Go.  It also includes runtime support libraries for these languages.")
               (patches (search-patches "gcc-strmov-store-file-names.patch"
                                        "gcc-7-libsanitizer-mode-size.patch"
                                        "gcc-5.0-libvtv-runpath.patch"))))
+    (inputs
+     ;; XXX: This gross hack allows us to have libstdc++'s <bits/c++config.h>
+     ;; in the search path, thereby avoiding misconfiguration of libstdc++:
+     ;; <https://bugs.gnu.org/42392>.
+     `(("libstdc++" ,libstdc++-headers)
+       ,@(package-inputs gcc-6)))
     (description
      "GCC is the GNU Compiler Collection.  It provides compiler front-ends
 for several languages, including C, C++, Objective-C, Fortran, Ada, and Go.
@@ -607,6 +613,31 @@ using compilers other than GCC."
     (propagated-inputs '())
     (synopsis "GNU C++ standard library")))
 
+(define libstdc++
+  ;; Libstdc++ matching the default GCC.
+  (make-libstdc++ gcc))
+
+(define libstdc++-headers
+  ;; XXX: This package is for internal use to work around
+  ;; <https://bugs.gnu.org/42392> (see above).  The main difference compared
+  ;; to the libstdc++ headers that come with 'gcc' is that <bits/c++config.h>
+  ;; is right under include/c++ and not under
+  ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR).
+  (package
+    (inherit libstdc++)
+    (name "libstdc++-headers")
+    (outputs '("out"))
+    (build-system trivial-build-system)
+    (arguments
+     '(#:builder (let* ((out       (assoc-ref %outputs "out"))
+                        (libstdc++ (assoc-ref %build-inputs "libstdc++")))
+                   (mkdir out)
+                   (mkdir (string-append out "/include"))
+                   (symlink (string-append libstdc++ "/include")
+                            (string-append out "/include/c++")))))
+    (inputs `(("libstdc++" ,libstdc++)))
+    (synopsis "Headers of GNU libstdc++")))
+
 (define-public libstdc++-4.9
   (make-libstdc++ gcc-4.9))
 

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 24 Jul 2020 12:25:02 GMT) Full text and rfc822 format available.

Notification sent to maxim.cournoyer <at> gmail.com:
bug acknowledged by developer. (Fri, 24 Jul 2020 12:25:02 GMT) Full text and rfc822 format available.

Message #18 received at 42392-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: maxim.cournoyer <at> gmail.com
Cc: 42392-done <at> debbugs.gnu.org
Subject: Re: bug#42392: GCC includes ordering issue? g++: error: 'round' is
 not a member of 'std'
Date: Fri, 24 Jul 2020 14:24:47 +0200
Hello,

Ludovic Courtès <ludo <at> gnu.org> skribis:

> The attached patch addresses this with a questionable yet efficient
> hack.  The test cases reported by Maxim and by Erik Garrison now build
> fine.
>
> I’ve asked for guidance for a proper fix at
> <https://gcc.gnu.org/pipermail/gcc-help/2020-July/139204.html>, but in
> the meantime, I’m happy to go with this patch.

I pushed a variant of this patch:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=12dc9f58c422c06bf9950f21c54ca3df1dc40af1

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#42392; Package guix. (Sun, 26 Jul 2020 05:34:02 GMT) Full text and rfc822 format available.

Message #21 received at 42392 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 42392 <at> debbugs.gnu.org
Subject: Re: bug#42392: GCC includes ordering issue? g++: error: 'round' is
 not a member of 'std'
Date: Sun, 26 Jul 2020 01:33:20 -0400
Hello Ludovic!

Thank you for the investigation, and sorry for not having been able to
reply earlier!

Ludovic Courtès <ludo <at> gnu.org> writes:

[...]

>>
>> __cplusplus >= 201103L and _GLIBCXX_USE_C99_MATH_TR1 and not _GLIBCXX_NO_C99_ROUNDING_FUNCS

Thanks for pointing out this configuration time problem!

[...]

> Comparing ‘c++config.h’ from GCC 7 (which works) and GCC 8 (the first
> one that exhibits this problem), we see:
>
> diff -ubBr --show-c-function /gnu/store/93z2pmmpla1n47q3xivqyic4mwvy0r5q-gcc-toolchain-8.4.0/include/c\+\+/x86_64-unknown-linux-gnu/bits/c\+\+config.h /gnu/store/xa45bzcbib4zqa7gk70nb35dzzwyr376-gcc-toolchain-7.5.0/include/c\+\+/x86_64-unknown-linux-gnu/bits/c\+\+config.h
> --- /gnu/store/xa45bzcbib4zqa7gk70nb35dzzwyr376-gcc-toolchain-7.5.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h	1970-01-01 01:00:01.000000000 +0100
> +++ /gnu/store/93z2pmmpla1n47q3xivqyic4mwvy0r5q-gcc-toolchain-8.4.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h	1970-01-01 01:00:01.000000000 +0100
>
[...]

Interesting!

> /tmp/guix-build-gcc-10.1.0.drv-0/build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/config.log
> reads this:
>
> configure:19924: checking for float trig functions

Notes: This check is made by the GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1 m4
macro defined under in libstdc++-v3/linkage.m4.  The macro definition
hasn't changed since 2005, so it's not the cause of the problem.

> configure:19948:  /tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc/xgcc -shared-libgcc -B/tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc -nostdinc++ -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/include -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/sys-include   -fno-checking -c -fno-builtin -D_GNU_SOURCE  conftest.cpp >&5
> In file included from /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/math.h:36,
>                  from conftest.cpp:122:
> /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/cmath:41:10: fatal error: bits/c++config.h: No such file or directory
>    41 | #include <bits/c++config.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> configure:19948: $? = 1
> configure: failed program was:

Eh! I fail to see what changed between 7.5 and 8.1, that would have
caused such a change in behavior.

[...]

> At this point, we have:
>
> export CPLUS_INCLUDE_PATH=\
> "/gnu/store/61pv34q6kad3cii1pngyairvxbxgdm1n-isl-0.22.1/include\
> :/gnu/store/35afkywncrr5xsb4cxcljf6rpjcb7f61-gmp-6.2.0/include\
> :/gnu/store/5jf395qa3v4amdi60850rz2a15zlsrza-mpfr-4.0.2/include\
> :/gnu/store/lgrnkwh7w5yawgqaglwj1pls5vwz1nz7-mpc-1.1.0/include\
> :/gnu/store/243algr6h60j46spn5dqhjc4mhkd0a0p-libelf-0.8.13/include\
> :/gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-1.2.11/include\
> :/gnu/store/i8h2pcxqdq07ijm3ibkka8f4smn1w48v-bzip2-1.0.8/include\
> :/gnu/store/9860f1abqj8wjjnwl8a9v54pdcc3bhgf-xz-5.2.4/include\
> :/gnu/store/60g7r3l01fd7c58yjbm6krgcwj1jkpwg-file-5.38/include\
> :/gnu/store/swqdvwri9dbv6zssg6v0by7l05hd6wxp-gawk-5.0.1/include\
> :/gnu/store/hm40bxnv8jxmbc1lpb7zfimii4xm9m81-make-4.3/include\
> :/gnu/store/m1z7cdbqsqyp9xnjw5cvlb4a7gkcg3m4-binutils-2.34/include\
> :/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++\
> :/gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include\
> :/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include\
> :/gnu/store/gfapkk5c6hvl1d94m4sqnhn7f9l5gqyh-linux-libre-headers-5.4.20/include"
>
>
> but <bits/c++config.h> is in a directory not listed here:
>
> $ find /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 -name c++config.h
> /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/x86_64-unknown-linux-gnu/bits/c++config.h
>
>
> ‘gcc-final’ doesn’t have this problem because it depends on ‘libstdc++’
> (separate package) where:
>
> $ find /gnu/store/v507xkc5flnzqa49yp41w5y611p4lqbg-libstdc++-7.5.0 -name c++config.h
> /gnu/store/v507xkc5flnzqa49yp41w5y611p4lqbg-libstdc++-7.5.0/include/bits/c++config.h
>
>
> So somehow the problems seems to be that ‘xgcc’ doesn’t search
> ‘gcc-7.5.0/include/c++/x86_64-unknown-linux-gnu’.  We could add it to
> CPLUS_INCLUDE_PATH manually, but it seems to me we’re missing something.
>
> Thoughts?

Great findings!

But you got me curious as how the previous GCC version managed to eschew
this problem :-).  Sadly, a couple evening of eye-balling GCC logs and
looking at include files haven't given me a clue.

Oh well, thank you for fixing it!

Maxim




Information forwarded to bug-guix <at> gnu.org:
bug#42392; Package guix. (Mon, 27 Jul 2020 18:25:01 GMT) Full text and rfc822 format available.

Message #24 received at 42392 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 42392 <at> debbugs.gnu.org
Subject: Re: bug#42392: GCC includes ordering issue? g++: error: 'round' is
 not a member of 'std'
Date: Mon, 27 Jul 2020 20:24:32 +0200
Hi!

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

>> configure:19948:  /tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc/xgcc -shared-libgcc -B/tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc -nostdinc++ -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/include -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/sys-include   -fno-checking -c -fno-builtin -D_GNU_SOURCE  conftest.cpp >&5
>> In file included from /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/math.h:36,
>>                  from conftest.cpp:122:
>> /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/cmath:41:10: fatal error: bits/c++config.h: No such file or directory
>>    41 | #include <bits/c++config.h>
>>       |          ^~~~~~~~~~~~~~~~~~
>> compilation terminated.
>> configure:19948: $? = 1
>> configure: failed program was:
>
> Eh! I fail to see what changed between 7.5 and 8.1, that would have
> caused such a change in behavior.

Nothing: the difference is between ‘gcc-final’ and the GCCs exported
from (gnu packages gcc).

‘gcc-final’ has ‘libstdc++’ (a separate package) has an input, like I
wrote.  And thus <bits/c++config.h> is found in this case.

Does that make sense?

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.