#53194 closed enhancement (fixed)
clang: have -stdlib=libstdc++ refer to MacPorts libstdc++
Reported by: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) | Owned by: | jeremyhu@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | haspatch | Cc: | larryv@…, mojca (Mojca Miklavec) |
Port: | clang-3.9 |
Description
I know libstdc++ vs. libc++ has been discusses extensively on the mailing list, but I do not 100% understand all of it.
Please forgive me if I am missing some important aspect with this proposal.
For my own projects, having -stdlib=libstdc++
refer to the MacPorts libstdc++ would (hopefully) solve a few problems.
Attached is a proposal based on this.
Attachments (5)
Change History (25)
comment:1 follow-up: 4 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)
comment:2 Changed 8 years ago by kencu (Ken)
or, as Jeremy suggested a few months back, comment:ticket:52468:45, use the moniker macports-libstdc++
to refer to the one from libgcc, use libstdc++
for the system's built-in one, and use libc++
for the system's libc++ and for the one provided by the libcxx.
And I see Jeremy is replying as well as I'm typing this :> So yes, that would work, I think.
comment:3 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Note that if that's non-trivial, we could do it your way (with a variant), but let's have it add the dependency on libgcc.
comment:4 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Replying to jeremyhu:
The goal with the clang toolchains (as opposed to gcc toolchains) is to be as compatible with the host as possible. As such, I don't intend to have -stdlib=libstdc++ refer to the MacPorts-provided libstdc++.
I would be willing to do something like -stdlib=macports-libstdc++ What do you think about that?
That would certainly work for what I need.
I would submit a patch, but I have no idea how to do this.
Replying to jeremyhu:
Note that if that's non-trivial, we could do it your way (with a variant), but let's have it add the dependency on libgcc.
That sounds reasonable as well.
Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Attachment: | Portfile.diff added |
---|
Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Attachment: | Portfile.2.diff added |
---|
comment:5 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Keywords: | haspatch added |
---|
There are now two proposals.
-stdlib=libstdc++
refers to MacPorts libstdc++ if variant if selected-stdlib=macports-libstdc++
refers to MacPorts libstdc++ if variant is selected
For my needs, it makes no difference.
I am new to clang/llvm code, so any feedback would be appreciated.
comment:6 Changed 8 years ago by kencu (Ken)
There is a lot of info on this topic here <https://llvm.org/bugs/show_bug.cgi?id=23529>.
comment:7 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
May I apply one of these patches?
If so, which one is preferred?
Whichever patch is applied, are there any objections to making the new variant a default?
comment:8 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Approach #2 looks fine. Go ahead and push it to llvm-devel but don't make the variant default. Let's solicit feedback from macports-dev, and if folks find it useful, we should bring it back into llvm-3.9 as well.
Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Attachment: | 9001-macports-libstdcxx.diff added |
---|
comment:9 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
comment:10 Changed 8 years ago by mojca (Mojca Miklavec)
Cc: | mojca added |
---|
comment:11 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
If I understand the conversation on the mailing list,
there may be a grudging willingness to try #53330.
#53330, however, depends on this proposed variant being accepted and the default.
Any thoughts on the likelihood of this being accepted?
comment:12 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Sorry to keep pestering about this.
If this patch is not to be accepted or the variant can not be made the default, would anyone mind if I created a subport of clang?
Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Attachment: | patch-macports-libstdcxx.diff added |
---|
Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Attachment: | Portfile.3.diff added |
---|
comment:13 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)
What do you mean by "If this patch is not to be accepted"? I previously said, "Approach #2 looks fine. Go ahead and push it to llvm-devel but don't make the variant default. Let's solicit feedback from macports-dev, and if folks find it useful, we should bring it back into llvm-3.9 as well."
If it turns out to not be too offensive to folks, we can flip it to being default. We won't know that until after you push the change and let it brew.
comment:14 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Oh, it's actually already in. I missed that. So why is this ticket still open?
comment:15 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Replying to jeremyhu:
What do you mean by "If this patch is not to be accepted"?
I simply meant that if the maintainers of clang do not want to maintain this particular patch, creating a subport compiler that was my responsibility would also work.
I do not want to presume to create more work for others.
I previously said, "Approach #2 looks fine. Go ahead and push it to llvm-devel but don't make the variant default.
As you noted, that happened a couple of weeks ago.
Through inertia, it was also copied into clang-4.9.
Let's solicit feedback from macports-dev, and if folks find it useful, we should bring it back into llvm-3.9 as well." If it turns out to not be too offensive to folks, we can flip it to being default. We won't know that until after you push the change and let it brew.
As I mentioned earlier, there was a discussion about the whole proposal a couple of weeks ago.
Replying to jeremyhu:
Oh, it's actually already in. I missed that. So why is this ticket still open?
Unfortunately, for my purposes (#53330), the variant must be default (Portfile1.diff, or Portfile.2.diff) or a subport must be created (Portfile.3.diff).
As llvm is not openmaintainer, I have been hesitant to make changes of this magnitude without explicit permission.
comment:16 follow-up: 19 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Oh, I'm perfectly happy maintaining this patch as part of clang-3.9+.
Unfortunately, for my purposes (#53330), the variant must be default
Ok. Let's make it default then on clang-4.0 and clang-devel. If there's not much resistance, we can remove it as a variant entirely in the future. Sound good?
comment:17 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
comment:18 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
comment:19 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to jeremyhu:
Oh, I'm perfectly happy maintaining this patch as part of clang-3.9+.
Unfortunately, for my purposes (#53330), the variant must be default
Ok. Let's make it default then on clang-4.0 and clang-devel. If there's not much resistance, we can remove it as a variant entirely in the future. Sound good?
Thank you for the help.
The goal with the clang toolchains (as opposed to gcc toolchains) is to be as compatible with the host as possible. As such, I don't intend to have -stdlib=libstdc++ refer to the MacPorts-provided libstdc++.
I would be willing to do something like -stdlib=macports-libstdc++ What do you think about that?