Skip to content
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

pkg-config build broken on clang 15+ and gcc 14+ #1200

Open
fuhry opened this issue May 3, 2024 · 4 comments
Open

pkg-config build broken on clang 15+ and gcc 14+ #1200

fuhry opened this issue May 3, 2024 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fuhry
Copy link

fuhry commented May 3, 2024

Background (what is pkg-config?)

pkg-config 0.29.2 (the latest release as of this writing) bundles an ancient version of glib 2.36 (released in August 2013) to workaround the pkg-config/glib circular dependency. It should be noted that pkg-config itself is not well-maintained, with the last major release having been in 2015 and the last point release in 2017, however it remains an important dependency of virtually all build systems as a standardized way to transform dependency names into CFLAGS, LDFLAGS, etc.

Note that glib is not to be confused with GNU libc, often abbreviated to glibc.

The issue

glib 2.36 performed implicit integer conversion for its atomic pointer arithmetic functions, using g(s)size (which is aliased to (u)long) instead of (u)intptr. This was a warning in most compilers for many years but was upgraded to an error with clang 15 and gcc 14. This was addressed in upstream glib in Dec 2022.

Patch and next steps

I've published a patch to the upstream pkg-config mailing list. (GitHub unfortunately is refusing to allow me to attach the .patch file here, despite claiming that .patch is a permitted file extension.) Depending on how quickly the maintainers process it, it may be advisable to bring this patch into rules_foreign_cc in advance of the upstream pkg-config release to unblock builds with newer clang and gcc.

Direct link to the patch (original filename: pkg-config-builtin-glib-int-conversion.patch)

Supply chain integrity / who am I

(In light of the xz thing)

My keybase provides positive proof linking my GitHub account, the domain of my email address, and the PGP key used to sign the patch, the latter of which is also the PGP key I use on GitHub. I am on the same team as @ravenblackx at @dropbox; they are an envoy maintainer and can vouch for me if necessary.

@jez
Copy link

jez commented May 13, 2024

Related: #1186

@achernya
Copy link

See also #1065

@jsharpe
Copy link
Collaborator

jsharpe commented May 16, 2024

If someone wants to put together a PR to patch the pkg-config build with the provided patch then this is something I'd happily merge.

@jsharpe jsharpe added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 10, 2024
@fuhry
Copy link
Author

fuhry commented Jun 13, 2024

@jsharpe I added such a patch to my envoyproxy AUR package last month. I don't have the free time to turn this into a rules_foreign_cc PR right this moment, but this patch should be able to be integrated with minimal effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants