diff -ur a/SCons/Tools/crossmingw.py b/SCons/Tools/crossmingw.py
--- a/SCons/Tools/crossmingw.py	2019-10-07 00:15:14.000000000 +0800
+++ b/SCons/Tools/crossmingw.py	2024-05-24 23:18:35.732513500 +0800
@@ -80,7 +80,7 @@
         prefixes.insert(0, prefix)
     for prefix in prefixes:
         # First search in the SCons path and then the OS path:
-        if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):
+        if env.WhereIs(prefix + 'cc') or SCons.Util.WhereIs(prefix + 'cc'):
             return prefix
 
     return ''
@@ -142,7 +142,7 @@
     mingw_prefix = find(env)
 
     if mingw_prefix:
-        dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc'))
+        dir = os.path.dirname(env.WhereIs(mingw_prefix + 'cc') or SCons.Util.WhereIs(mingw_prefix + 'cc'))
 
         # The mingw bin directory must be added to the path:
         path = env['ENV'].get('PATH', [])
@@ -159,25 +159,25 @@
         SCons.Tool.Tool(tool)(env)
 
     #... but a few things differ:
-    env['CC'] = mingw_prefix + 'gcc'
+    env['CC'] = mingw_prefix + 'cc'
     env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
-    env['CXX'] = mingw_prefix + 'g++'
+    env['CXX'] = mingw_prefix + 'c++'
     env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
     env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
     env['SHLINKCOM']   = shlib_action
     env.Append(SHLIBEMITTER = [shlib_emitter])
-    env['LINK'] = mingw_prefix + 'g++'
-    env['AS'] = mingw_prefix + 'as'
-    env['AR'] = mingw_prefix + 'ar'
-    env['RANLIB'] = mingw_prefix + 'ranlib'
+    env['LINK'] = mingw_prefix + 'c++'
+    env['AS'] = mingw_prefix + 'cc' + ' -c'
+    env['AR'] = 'ar'
+    env['RANLIB'] = 'ranlib'
     env['WIN32DEFPREFIX']        = ''
     env['WIN32DEFSUFFIX']        = '.def'
     env['SHOBJSUFFIX'] = '.o'
     env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
 
-    env['RC'] = mingw_prefix + 'windres'
+    env['RC'] = 'windres'
     env['RCFLAGS'] = SCons.Util.CLVar('')
-    env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS ${INCPREFIX}${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
+    env['RCCOM'] = '$RC $_CPPINCFLAGS ${INCPREFIX}${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
     env['BUILDERS']['RES'] = res_builder
     
     # Some setting from the platform also have to be overridden:
