all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#49350: gcc-toolchain compilation error with -nostdinc++
@ 2021-07-03 10:41 Ontje Lünsdorf via Bug reports for GNU Guix
  2021-07-06  8:00 ` Sarah Morgensen via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: Ontje Lünsdorf via Bug reports for GNU Guix @ 2021-07-03 10:41 UTC (permalink / raw)
  To: 49350

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#49350: gcc-toolchain compilation error with -nostdinc++
  2021-07-03 10:41 bug#49350: gcc-toolchain compilation error with -nostdinc++ Ontje Lünsdorf via Bug reports for GNU Guix
@ 2021-07-06  8:00 ` Sarah Morgensen via Bug reports for GNU Guix
  2021-07-27  8:07   ` Ontje Lünsdorf via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: Sarah Morgensen via Bug reports for GNU Guix @ 2021-07-06  8:00 UTC (permalink / raw)
  To: Ontje Lünsdorf; +Cc: 49350

Hello,

Thanks for the report.

Ontje Lünsdorf <oluensdorf@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#49350: gcc-toolchain compilation error with -nostdinc++
  2021-07-06  8:00 ` Sarah Morgensen via Bug reports for GNU Guix
@ 2021-07-27  8:07   ` Ontje Lünsdorf via Bug reports for GNU Guix
  0 siblings, 0 replies; 3+ messages in thread
From: Ontje Lünsdorf via Bug reports for GNU Guix @ 2021-07-27  8:07 UTC (permalink / raw)
  To: Sarah Morgensen; +Cc: 49350-done

Hi Sarah,


Sarah Morgensen <iskarian@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-27 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 10:41 bug#49350: gcc-toolchain compilation error with -nostdinc++ Ontje Lünsdorf via Bug reports for GNU Guix
2021-07-06  8:00 ` Sarah Morgensen via Bug reports for GNU Guix
2021-07-27  8:07   ` Ontje Lünsdorf via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.