Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 834571 - sys-devel/clang: postinst should display a warning if built with default-libcxx
Summary: sys-devel/clang: postinst should display a warning if built with default-libcxx
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-04 10:27 UTC by sunsetsergal
Modified: 2022-07-01 22:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sunsetsergal 2022-03-04 10:27:10 UTC
Sorry for the wordy description, but I thought it was necessary to justify my request...

I was having trouble compiling LibreOffice with clang. I found bug 760549 which exactly described my build error, but it's marked as RESOLVED FIXED, which is strange... It also has at least two duplicates.

I read through that bug's comments and the page for clang in the wiki, and I discovered that enabling the default-libcxx USEflag for clang on a system set up to use GCC as the primary compiler is actually a configuration error, because libstdc++ and libc++ are not ABI compatible and the majority of C++ packages one attempts to build with clang will fail to link.

It's conceivable that a user might change this USEflag while experimenting with clang on their system and think it's normal for some pacakges not to compile when using a different compiler. Personally I assumed it was a problem with LibreOffice, because Firefox and Thunderbird also have clang USEflags and are able to build just fine, so I didn't think it could be my own fault. It's also possible that bugs for other packages have been opened because of this USEflag, but I happened to run into the problem with LibreOffice.

Therefore, I think it would be beneficial if sys-devel/clang would display a warning in postinst if the default-libcxx USEflag is enabled and it detects that GCC is the default compiler. This could potentially reduce the number of bugs opened in the tracker that turn out to be caused by configuration errors.

I was indeed able to build LibreOffice with clang after changing the USEflag.

Reproducible: Always

Steps to Reproduce:
1. emerge sys-devel/clang with default-libcxx USEflag on an otherwise mostly sane ~amd64 system
2. (attempt to) emerge app-office/libreoffice
Actual Results:  
See bug 760549.

Expected Results:  
Some package along the line (sys-devel/clang seems like the most proper place) should be able to detect this configuration error and warn the user that things are going to break. Then the user can either change the USEflag or rebuild all C++ packages against libc++ so packages will compile as expected.

Due to the nature of this bug/request I don't believe it's relevant to share my "emerge --info".