GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
loongarch

LoongArch: Fix missing plugin header for cpu-features.h

Fixes a build failure when compiling GCC plugins that include target headers on LoongArch due to a missing header file.

When compiling GCC plugins that include target headers on LoongArch, the build fails because cpu-features.h is not installed. This commit adds the missing header to the list of headers installed with the plugin, resolving the build failure. This ensures that GCC plugins that rely on target-specific CPU features will build correctly on LoongArch.

In Details

The LoongArch backend requires cpu-features.h for target-specific feature detection. This header was not being installed when plugins including target headers were built. This commit adds cpu-features.h to the TM_H variable in t-loongarch, ensuring it's installed during make install-plugin, similar to the approach used for i386-cpuinfo.h on x86.

For Context

GCC plugins are extensions that can be loaded into the compiler to add new features or modify existing ones. These plugins sometimes need to access target-specific information about the CPU, such as supported features. This information is typically provided through header files. This change ensures that when building a plugin for the LoongArch architecture, the necessary header file containing CPU feature definitions is available, preventing build errors.

Filed Under: loongarchpluginbuildheader