Page MenuHomeFreeBSD

pkgconf: fix the build with GCC 14
ClosedPublic

Authored by khorben on Apr 23 2026, 1:07 AM.
Tags
None
Referenced Files
F158238032: D56591.id176506.diff
Sat, May 30, 4:59 AM
Unknown Object (File)
Tue, May 26, 1:23 PM
Unknown Object (File)
Tue, May 26, 1:15 PM
Unknown Object (File)
Mon, May 25, 8:03 PM
Unknown Object (File)
Mon, May 25, 8:00 PM
Unknown Object (File)
Mon, May 25, 11:09 AM
Unknown Object (File)
Mon, May 25, 11:06 AM
Unknown Object (File)
Fri, May 22, 8:03 AM
Subscribers

Details

Summary

Building pkgconf with GCC 14 currently fails with:

cc1: error: '-Wno-error=incompatible-pointer-types-discards-qualifiers': no option '-Wincompatible-pointer-types-discards-qualifiers'

Fixes: b8352da33f34 ("pkgconf: import into the base system")
Sponsored by: The FreeBSD Foundation

Test Plan
# pkg install amd64-gcc14
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        amd64-binutils: 2.44,1
        amd64-gcc14: 14.2.0_1

Number of packages to be installed: 2

The process will require 209 MiB more space.
47 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching amd64-binutils-2.44,1: 100%  2553 KiB   2.6 MB/s    00:01
[2/2] Fetching amd64-gcc14-14.2.0_1: 100%    44 MiB   5.8 MB/s    00:08
Checking integrity... done (0 conflicting)
[1/2] Installing amd64-binutils-2.44,1...
[1/2] Extracting amd64-binutils-2.44,1: 100%
[2/2] Installing amd64-gcc14-14.2.0_1...
[2/2] Extracting amd64-gcc14-14.2.0_1: 100%
# exit
$ make CROSS_TOOLCHAIN=amd64-gcc14 buildworld buildkernel
[...]
$ rm -fr /usr/obj
$ make buildworld buildkernel
[...]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This works, but I would consider an alternate approach potentially, like using WARNS?= 3 in the Makefiles and removing all of the -W flags.

lib/libpkgconf/Makefile
14–16

This is the only other change I recommend making.

Alternatively, you could remove all of these -W CFLAGS and use WARNS?= 3 instead.

usr.bin/bomtool/Makefile
12

This is the same thing (it looks like the flag doesn't exist in gcc).

Disable stricter warnings for the moment for libpkgconf, bomtool(1), and pkgconf(1) as suggested by ngie. Thanks!

The latest update (with WARNS?=3) built correctly with clang; I am still testing with GCC 14.

The latest update (with WARNS?=3) built correctly with clang; I am still testing with GCC 14.

It built correctly with GCC 14 as well.

The latest update (with WARNS?=3) built correctly with clang; I am still testing with GCC 14.

It built correctly with GCC 14 as well.

Are you happy with this version @ngie?

@khorben : yes! Sorry for not accepting this sooner!

This revision is now accepted and ready to land.Apr 25 2026, 4:03 PM
This revision was automatically updated to reflect the committed changes.