@@ -184,6 +184,14 @@ fn libgccjit_built_path(install_dir: &Path) -> PathBuf {
184
184
}
185
185
186
186
fn 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
+
187
195
let Meta { stamp : _, out_dir, install_dir, root } = metadata;
188
196
189
197
t ! ( fs:: create_dir_all( out_dir) ) ;
@@ -210,18 +218,13 @@ fn build_gcc(metadata: &Meta, builder: &Builder<'_>, target: TargetSelection) {
210
218
let mut configure_cmd = command ( src_dir. join ( "configure" ) ) ;
211
219
configure_cmd
212
220
. 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" )
219
221
. arg ( "--enable-host-shared" )
220
222
. arg ( "--enable-languages=c,jit,lto" )
221
223
. arg ( "--enable-checking=release" )
222
224
. arg ( "--disable-bootstrap" )
223
225
. arg ( "--disable-multilib" )
224
226
. arg ( format ! ( "--prefix={}" , install_dir. display( ) ) ) ;
227
+
225
228
let cc = builder. build . cc ( target) . display ( ) . to_string ( ) ;
226
229
let cc = builder
227
230
. build
0 commit comments