bug#38061: [minimal reproducer included] libstdc++ mutex references cause clang builds to fail

2019-11-05 Thread Mathieu Othacehe


Hello Carl,

> In my original non-minimal build, other things in  also cause 
> compilation
> errors, which seem odd to me.

This problem is not directly related to . You'll have the same
issue with ,  or any other header from stdlib.

As explained here:
https://www.mail-archive.com/guix-devel@gnu.org/msg50183.html, the root
cause is that clang cannot find libstdc++ headers which paths are
hardcoded into gcc.

We need to find a clean way to hardcode those paths into clang. However,
I'm not sure on how to proceed cleanly.

Mathieu





bug#38061: [minimal reproducer included] libstdc++ mutex references cause clang builds to fail

2019-11-04 Thread Carl Dong
Hi all,

I'm having another issue with the clang toolchain right now and I've come up
with a minimal reproducer:

Given the following manifest.scm:
--8<---cut here---start->8---
(use-modules (gnu packages gcc)
 (gnu packages linux)
 (gnu packages llvm))

(packages->manifest
 (list clang
   (make-libstdc++ gcc)
   linux-libre-headers))
--8<---cut here---end--->8---

And test.cpp:
--8<---cut here---start->8---
#include 
#include 

typedef std::once_flag once_flag;

int
main()
{
std::cout << "Hello, World\n";
}
--8<---cut here---end--->8---

If you invoke:
--8<---cut here---start->8---
guix environment --manifest=manifest.scm --container --pure -- clang++ test.cpp
--8<---cut here---end--->8---

The output looks like:
--8<---cut here---start->8---
test.cpp:4:14: error: no type named 'once_flag' in namespace 'std'
typedef std::once_flag once_flag;
~^
1 error generated.
--8<---cut here---end--->8---

In my original non-minimal build, other things in  also cause compilation
errors, which seem odd to me.

Any help would be very much appreciated!

Cheers,
Carl Dong
cont...@carldong.me
"I fight for the users"