https://bugzilla.redhat.com/show_bug.cgi?id=2121894
Bug ID: 2121894 Summary: builtins.h requires mpc.h from libmpc-devel Product: Fedora Version: 36 Hardware: x86_64 OS: Linux Status: NEW Component: cross-gcc Severity: medium Assignee: dhowells@redhat.com Reporter: elliott@hpe.com QA Contact: extras-qa@fedoraproject.org CC: dan@danny.cz, dhowells@redhat.com, epel-packagers-sig@lists.fedoraproject.org, lkundrak@v3.sk Target Milestone: --- Classification: Fedora
Description of problem: Cross compiles of the linux kernel 6.0-rc1 allmodconfig fail for arm, arm64, mips, powerpc, and s390.
This originates in scripts/gcc-plugins/Kconfig, which has this entry:
menuconfig GCC_PLUGINS bool "GCC plugins" depends on HAVE_GCC_PLUGINS depends on CC_IS_GCC depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h) default y depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h)
arch/sparc/Kconfig does not include select HAVE_GCC_PLUGINS but all the others do.
The -print-file-name tests passes for all the cross-compilers, but does not for native x86:
$ gcc -print-file-name=plugin plugin $ powerpc64-linux-gnu-gcc -print-file-name=plugin /usr/lib/gcc/powerpc64-linux-gnu/12/plugin $ aarch64-linux-gnu-gcc -print-file-name=plugin /usr/lib/gcc/aarch64-linux-gnu/12/plugin
$ find /usr/lib/gcc -name plugin-version.h /usr/lib/gcc/s390x-linux-gnu/12/plugin/include/plugin-version.h /usr/lib/gcc/aarch64-linux-gnu/12/plugin/include/plugin-version.h /usr/lib/gcc/powerpc64-linux-gnu/12/plugin/include/plugin-version.h /usr/lib/gcc/sparc64-linux-gnu/12/plugin/include/plugin-version.h /usr/lib/gcc/arm-linux-gnueabi/12/plugin/include/plugin-version.h /usr/lib/gcc/mips64-linux-gnu/12/plugin/include/plugin-version.h
so the .x86 .config file only gets: CONFIG_HAVE_GCC_PLUGINS=y
while the others get that, CONFIG_GCC_PLUGINS, and a several specific plugins: build-arm64/.config:CONFIG_HAVE_GCC_PLUGINS=y build-arm64/.config:CONFIG_GCC_PLUGINS=y build-arm64/.config:CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y build-arm64/.config:CONFIG_GCC_PLUGIN_STACKLEAK=y build-arm64/.config:CONFIG_GCC_PLUGIN_RANDSTRUCT=y
build-arm/.config:CONFIG_HAVE_GCC_PLUGINS=y build-arm/.config:CONFIG_GCC_PLUGINS=y build-arm/.config:CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y build-arm/.config:CONFIG_GCC_PLUGIN_RANDSTRUCT=y
build-mips/.config:CONFIG_HAVE_GCC_PLUGINS=y build-mips/.config:CONFIG_GCC_PLUGINS=y build-mips/.config:CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y build-mips/.config:CONFIG_GCC_PLUGIN_RANDSTRUCT=y
build-powerpc/.config:CONFIG_HAVE_GCC_PLUGINS=y build-powerpc/.config:CONFIG_GCC_PLUGINS=y build-powerpc/.config:CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y build-powerpc/.config:CONFIG_GCC_PLUGIN_RANDSTRUCT=y
build-s390/.config:CONFIG_HAVE_GCC_PLUGINS=y build-s390/.config:CONFIG_GCC_PLUGINS=y build-s390/.config:CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y build-s390/.config:CONFIG_GCC_PLUGIN_RANDSTRUCT=y
build-x86/.config:CONFIG_HAVE_GCC_PLUGINS=y
A header included by each of the plugins, scripts/gcc-plugins/gcc-common.h, includes a GCC header file called builtins.h that includes <mpc.h>, which does not exist anywhere on my system. That causes errors early in the build on all of those architectures.
Version-Release number of selected component (if applicable): gcc-[each architecture]-linux-gnu 12.1.1
How reproducible: 100%
Steps to Reproduce: Example for arm 32-bit:
1. make ARCH=arm O=build-arm CROSS_COMPILE=arm-linux-gnu- allmodconfig 2. make ARCH=arm O=build-arm CROSS_COMPILE=arm-linux-gnu- -j 55
Actual results: For each "GCC plugin", an error like this terminates the make:
In file included from ../scripts/gcc-plugins/gcc-common.h:95, from ../scripts/gcc-plugins/latent_entropy_plugin.c:78: /usr/lib/gcc/aarch64-linux-gnu/12/plugin/include/builtins.h:23:10: fatal error: mpc.h: No such file or directory 23 | #include <mpc.h> | ^~~~~~~ compilation terminated.
Expected results: no errors
Additional info: That mpc.h file is provided by the libmpc-devel package.
1. Please add a dependency for the libmpc-devel package from each gcc cross-compiler package that includes a builtins.h file
2. Please investigate whether the native gcc package not having plugins is correct, despite the kernel x86 allmodconfig expecting them by specifying CONFIG_HAVE_GCC_PLUGINS=y