GNU bug report logs - #49350
gcc-toolchain compilation error with -nostdinc++

Previous Next

Package: guix;

Reported by: Ontje Lünsdorf <oluensdorf <at> mailbox.org>

Date: Sat, 3 Jul 2021 12:05:02 UTC

Severity: normal

Done: Ontje Lünsdorf <oluensdorf <at> mailbox.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 49350 in the body.
You can then email your comments to 49350 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#49350; Package guix. (Sat, 03 Jul 2021 12:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ontje Lünsdorf <oluensdorf <at> mailbox.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 03 Jul 2021 12:05:02 GMT) Full text and rfc822 format available.

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

From: Ontje Lünsdorf <oluensdorf <at> mailbox.org>
To: bug-guix <at> gnu.org
Subject: gcc-toolchain compilation error with -nostdinc++
Date: Sat, 03 Jul 2021 12:41:11 +0200
Hi all,


I've problems compiling LLVM manually with the gcc-toolchain.
sanitizer_posix_libcdep.cpp is build with -nostdinc++ and fails to find
bits/c++config.h.

I think the issue can be reproduced with this example test.cpp:

#include <stdlib.h>
int main() { return 0; }

c++ from archlinux compiles that file, while c++ from gcc-toolchain doesn't:

$ c++ -nostdinc++ test.cpp
$ guix environment --ad-hoc gcc-toolchain -- c++ -nostdinc++ test.cpp
In file included from /gnu/store/nh9r04xhzmbk3hjsj92yhlhmjsp521g4-profile/include/c++/stdlib.h:36,
                 from test.cpp:1:
/gnu/store/nh9r04xhzmbk3hjsj92yhlhmjsp521g4-profile/include/c++/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
   41 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.

Is this expected and I'm doing something wrong?

Thanks & best regards,
Ontje




Information forwarded to bug-guix <at> gnu.org:
bug#49350; Package guix. (Tue, 06 Jul 2021 08:01:02 GMT) Full text and rfc822 format available.

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

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Ontje Lünsdorf <oluensdorf <at> mailbox.org>
Cc: 49350 <at> debbugs.gnu.org
Subject: Re: bug#49350: gcc-toolchain compilation error with -nostdinc++
Date: Tue, 06 Jul 2021 01:00:37 -0700
Hello,

Thanks for the report.

Ontje Lünsdorf <oluensdorf <at> mailbox.org> writes:

> Hi all,
>
>
> I've problems compiling LLVM manually with the gcc-toolchain.
> sanitizer_posix_libcdep.cpp is build with -nostdinc++ and fails to find
> bits/c++config.h.
>
> I think the issue can be reproduced with this example test.cpp:
>
> #include <stdlib.h>
> int main() { return 0; }

I am able to repro with this test case on Guix System, both in and
outside of a guix environment --pure.

>
> c++ from archlinux compiles that file, while c++ from gcc-toolchain doesn't:
>
> $ c++ -nostdinc++ test.cpp
> $ guix environment --ad-hoc gcc-toolchain -- c++ -nostdinc++ test.cpp
> In file included from /gnu/store/nh9r04xhzmbk3hjsj92yhlhmjsp521g4-profile/include/c++/stdlib.h:36,
>                  from test.cpp:1:
> /gnu/store/nh9r04xhzmbk3hjsj92yhlhmjsp521g4-profile/include/c++/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
>    41 | #include <bits/c++config.h>
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
>
> Is this expected and I'm doing something wrong?

The issue seems to be with the (automatically set by Guix)
CPLUS_INCLUDE_PATH environment variable. The following works as
expected:

  guix environment --pure --ad-hoc gcc-toolchain -- CPLUS_INCLUDE_PATH= c++ -nostdinc++ test.cpp

It seems that -nostdinc++ controls whether GCC decides to add the C++
std include paths internally, but it still looks in the paths indicated
by CPLUS_INCLUDE_PATH. Guix sets CPLUS_INCLUDE_PATH and friends because
there is no system-wide /include. I'm not sure how expected this
specific behavior is, though...

>
> Thanks & best regards,
> Ontje

Hope that helps,
Sarah




Reply sent to Ontje Lünsdorf <oluensdorf <at> mailbox.org>:
You have taken responsibility. (Tue, 27 Jul 2021 14:41:01 GMT) Full text and rfc822 format available.

Notification sent to Ontje Lünsdorf <oluensdorf <at> mailbox.org>:
bug acknowledged by developer. (Tue, 27 Jul 2021 14:41:02 GMT) Full text and rfc822 format available.

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

From: Ontje Lünsdorf <oluensdorf <at> mailbox.org>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 49350-done <at> debbugs.gnu.org
Subject: Re: bug#49350: gcc-toolchain compilation error with -nostdinc++
Date: Tue, 27 Jul 2021 10:07:33 +0200
Hi Sarah,


Sarah Morgensen <iskarian <at> mgsn.dev> writes:

> The issue seems to be with the (automatically set by Guix)
> CPLUS_INCLUDE_PATH environment variable. The following works as
> expected:
>
>   guix environment --pure --ad-hoc gcc-toolchain -- CPLUS_INCLUDE_PATH= c++ -nostdinc++ test.cpp

thanks, this solved my problem.

Best regards,
Ontje




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

This bug report was last modified 2 years and 245 days ago.

Previous Next


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