* bug#38061: [minimal reproducer included] libstdc++ mutex references cause clang builds to fail
@ 2019-11-04 20:29 Carl Dong
2019-11-05 7:59 ` Mathieu Othacehe
0 siblings, 1 reply; 2+ messages in thread
From: Carl Dong @ 2019-11-04 20:29 UTC (permalink / raw)
To: 38061
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 <mutex>
#include <iostream>
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 <mutex> also cause compilation
errors, which seem odd to me.
Any help would be very much appreciated!
Cheers,
Carl Dong
contact@carldong.me
"I fight for the users"
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#38061: [minimal reproducer included] libstdc++ mutex references cause clang builds to fail
2019-11-04 20:29 bug#38061: [minimal reproducer included] libstdc++ mutex references cause clang builds to fail Carl Dong
@ 2019-11-05 7:59 ` Mathieu Othacehe
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Othacehe @ 2019-11-05 7:59 UTC (permalink / raw)
To: Carl Dong; +Cc: 38061
Hello Carl,
> In my original non-minimal build, other things in <mutex> also cause compilation
> errors, which seem odd to me.
This problem is not directly related to <mutex>. You'll have the same
issue with <list>, <vector> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-05 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-04 20:29 bug#38061: [minimal reproducer included] libstdc++ mutex references cause clang builds to fail Carl Dong
2019-11-05 7:59 ` Mathieu Othacehe
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).