gcc: use -idirafter for libc headers (#44081)

GCC C++ headers like cstdlib use `#include_next <stdlib.h>` to wrap libc
headers. We're using `-isystem` for libc, which puts those headers too
early in the search path. `-idirafter` fixes this so `include_next`
works.
This commit is contained in:
Harmen Stoppels 2024-05-08 20:45:04 +02:00
parent 965bb4d3c0
commit 5e9c702fa7

View file

@ -1172,7 +1172,7 @@ def _post_buildcache_install_hook(self):
os.path.exists(os.path.join(header_dir, h))
for h in libc.package_class.representative_headers
):
relocation_args.append(f"-isystem {header_dir}")
relocation_args.append(f"-idirafter {header_dir}")
else:
tty.warn(
f"Cannot relocate {specs_file} include directories, "