-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Libiconv in build inputs leads to subtly broken cflags on Linux #19895
Comments
My fear with |
I'm inclined to side with @copumpkin here, I don't want to resurrect An alternative to @copumpkin's suggestion (I'm not sure how difficult that would be) would be to include |
@gridaphobe from the old PR:
|
We don't have to be bound by glibc's decisions though, which I think is what you're getting at in your 2nd paragraph:
We could say that a libc should provide certain things, excluding libiconv, and then hide the relevant symbols in glibc to make it compliant. I don't have a strong opinion on a large vs small standard libc, but it really does seem more sane to me than dealing with a complex chain of conditionals in each package that might be bundled with glibc. |
OK, to make it "no big deal" to have glibc as a build input, we probably want some nix-support file that the cc-wrapper setup hook checks to disable adding the |
Or we could override |
Does that solve the original problem? If so, it sounds pretty clean! |
It should, yeah. |
See #19919. Will create a jobset. |
#19919 merged into staging |
cherry-picked the commit and tested against my branch -> ok for me, fixed the original problem! |
glibc
includesiconv
functions so we used to havelibiconvOrNull
to avoid a spurious build input on systems that haveglibc
as their libc. We removed this in #6166 (for good reason, IMO) and now just havelibiconv
as an alias forglibc
on those systems. Unfortunately, includingglibc
as a build input puts its include headers on the search path withisystem
instead of just using theidirafter
baked into the cc wrapper, which means glibc's headers are no longer searched last in the list as desired. This leads to the bug referenced in #19834 (see discussion on #19859 ), and in general will cause problems for anything that builds with libc++, depends on libiconv, and references<cmath>
on glibc systems.I'm not sure the best solution here. We could ignore instances of the c library our compiler is built with in build inputs, we could have some logic in glibc's setup hook to tell it to add
idirafter
instead ofisystem
, we could bring backlibiconvOrNull
or something like it... None of these seem obviously good or obviously awful. Thoughts?The text was updated successfully, but these errors were encountered: