https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126722
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <[email protected]>: https://gcc.gnu.org/g:7cd316dfa1e1b716c2a9288284c1b18736019d45 commit r17-6361-g7cd316dfa1e1b716c2a9288284c1b18736019d45 Author: Zhongteng Gui <[email protected]> Date: Tue Nov 17 21:39:00 2026 +0800 Pass target sysroot flags to bootstrap compiler When --with-build-sysroot is used, most target compiler invocations receive SYSROOT_CFLAGS_FOR_TARGET through XGCC_FLAGS_FOR_TARGET. However, GCC_FOR_TARGET and the post-stage1 C++ compiler are assembled separately, and therefore miss the configured sysroot. Similarly, gnattools constructs its native and rebuild CC and CXX commands directly. Without these flags, configure tests performed in later bootstrap stages can fail to find the target headers or startup files, reporting that the C++ compiler cannot create executables. Native gnattools can also invoke xg++ without the build sysroot when linking its programs, causing the target linker to fail to find crt2.o and default-manifest.o. Add SYSROOT_CFLAGS_FOR_TARGET to GCC_FOR_TARGET and the post-stage1 C++ compiler. Pass XGCC_FLAGS_FOR_TARGET to the compiler commands used by native and rebuilt gnattools. PR bootstrap/126722 / * Makefile.in: Regenerate. * Makefile.tpl (POSTSTAGE1_CXX_EXPORT): Add SYSROOT_CFLAGS_FOR_TARGET. (GCC_FOR_TARGET): Likewise. gnattools/ * Makefile.in (CXX_LFLAGS): Add XGCC_FLAGS_FOR_TARGET.
