@@ -184,6 +184,14 @@ fn libgccjit_built_path(install_dir: &Path) -> PathBuf {
184184}
185185
186186fn build_gcc ( metadata : & Meta , builder : & Builder < ' _ > , target : TargetSelection ) {
187+ if builder. build . cc_tool ( target) . is_like_clang ( )
188+ || builder. build . cxx_tool ( target) . is_like_clang ( )
189+ {
190+ panic ! (
191+ "Attempting to build GCC using Clang, which is known to misbehave. Please use GCC as the host C/C++ compiler. "
192+ ) ;
193+ }
194+
187195 let Meta { stamp : _, out_dir, install_dir, root } = metadata;
188196
189197 t ! ( fs:: create_dir_all( out_dir) ) ;
@@ -210,18 +218,13 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) {
210218 let mut configure_cmd = command ( src_dir. join ( "configure" ) ) ;
211219 configure_cmd
212220 . current_dir ( out_dir)
213- // On CI, we compile GCC with Clang.
214- // The -Wno-everything flag is needed to make GCC compile with Clang 19.
215- // `-g -O2` are the default flags that are otherwise used by Make.
216- // FIXME(kobzol): change the flags once we have [gcc] configuration in config.toml.
217- . env ( "CXXFLAGS" , "-Wno-everything -g -O2" )
218- . env ( "CFLAGS" , "-Wno-everything -g -O2" )
219221 . arg ( "--enable-host-shared" )
220222 . arg ( "--enable-languages=c,jit,lto" )
221223 . arg ( "--enable-checking=release" )
222224 . arg ( "--disable-bootstrap" )
223225 . arg ( "--disable-multilib" )
224226 . arg ( format ! ( "--prefix={}" , install_dir. display( ) ) ) ;
227+
225228 let cc = builder. build . cc ( target) . display ( ) . to_string ( ) ;
226229 let cc = builder
227230 . build
0 commit comments