GNU bug report logs - #38061
[minimal reproducer included] libstdc++ mutex references cause clang builds to fail

Previous Next

Package: guix;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Mon, 4 Nov 2019 20:31:02 UTC

Severity: normal

Done: Mathieu Othacehe <m.othacehe <at> gmail.com>

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 38061 in the body.
You can then email your comments to 38061 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#38061; Package guix. (Mon, 04 Nov 2019 20:31:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Dong <contact <at> carldong.me>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 04 Nov 2019 20:31:03 GMT) Full text and rfc822 format available.

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

From: Carl Dong <contact <at> carldong.me>
To: "bug-guix <at> gnu.org" <bug-guix <at> gnu.org>
Subject: [minimal reproducer included] libstdc++ mutex references cause clang
 builds to fail
Date: Mon, 04 Nov 2019 20:29:46 +0000
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 <at> carldong.me
"I fight for the users"




Information forwarded to bug-guix <at> gnu.org:
bug#38061; Package guix. (Tue, 05 Nov 2019 08:01:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Carl Dong <contact <at> carldong.me>
Cc: 38061 <at> debbugs.gnu.org
Subject: Re: bug#38061: [minimal reproducer included] libstdc++ mutex
 references cause clang builds to fail
Date: Tue, 05 Nov 2019 08:59:59 +0100
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 <at> 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 closed, send any further explanations to 38061 <at> debbugs.gnu.org and Carl Dong <contact <at> carldong.me> Request was from Mathieu Othacehe <m.othacehe <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 17 Nov 2019 11:18:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 15 Dec 2019 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 127 days ago.

Previous Next


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