@@ -291,6 +291,22 @@ envopt() {
291291 fi
292292}
293293
294+ to_llvm_triple () {
295+ case $1 in
296+ i686-w64-mingw32) echo i686-pc-windows-gnu ;;
297+ x86_64-w64-mingw32) echo x86_64-pc-windows-gnu ;;
298+ * ) echo $1 ;;
299+ esac
300+ }
301+
302+ to_gnu_triple () {
303+ case $1 in
304+ i686-pc-windows-gnu) echo i686-w64-mingw32 ;;
305+ x86_64-pc-windows-gnu) echo x86_64-w64-mingw32 ;;
306+ * ) echo $1 ;;
307+ esac
308+ }
309+
294310msg " looking for configure programs"
295311need_cmd cmp
296312need_cmd mkdir
@@ -350,37 +366,40 @@ case $CFG_OSTYPE in
350366 # instead, msys defines $MSYSTEM which is MINGW32 on i686 and
351367 # MINGW64 on x86_64.
352368 CFG_CPUTYPE=i686
353- CFG_OSTYPE=w64-mingw32
369+ CFG_OSTYPE=pc-windows-gnu
354370 if [ " $MSYSTEM " = MINGW64 ]
355371 then
356372 CFG_CPUTYPE=x86_64
357- CFG_OSTYPE=w64-mingw32
358373 fi
359374 ;;
360375
376+ MSYS* )
377+ CFG_OSTYPE=pc-windows-gnu
378+ ;;
379+
361380# Thad's Cygwin identifers below
362381
363382# Vista 32 bit
364383 CYGWIN_NT-6.0)
365- CFG_OSTYPE=pc-mingw32
384+ CFG_OSTYPE=pc-windows-gnu
366385 CFG_CPUTYPE=i686
367386 ;;
368387
369388# Vista 64 bit
370389 CYGWIN_NT-6.0-WOW64)
371- CFG_OSTYPE=w64-mingw32
390+ CFG_OSTYPE=pc-windows-gnu
372391 CFG_CPUTYPE=x86_64
373392 ;;
374393
375394# Win 7 32 bit
376395 CYGWIN_NT-6.1)
377- CFG_OSTYPE=pc-mingw32
396+ CFG_OSTYPE=pc-windows-gnu
378397 CFG_CPUTYPE=i686
379398 ;;
380399
381400# Win 7 64 bit
382401 CYGWIN_NT-6.1-WOW64)
383- CFG_OSTYPE=w64-mingw32
402+ CFG_OSTYPE=pc-windows-gnu
384403 CFG_CPUTYPE=x86_64
385404 ;;
386405
@@ -466,7 +485,6 @@ opt llvm-assertions 1 "build LLVM with assertions"
466485opt debug 1 " build with extra debug fun"
467486opt ratchet-bench 0 " ratchet benchmarks"
468487opt fast-make 0 " use .gitmodules as timestamp for submodule deps"
469- opt mingw-cross 0 " cross-compile for win32 using mingw"
470488opt ccache 0 " invoke gcc/clang via ccache to reuse object files between builds"
471489opt local-rust 0 " use an installed rustc rather than downloading a snapshot"
472490opt llvm-static-stdcpp 0 " statically link to libstdc++ for LLVM"
@@ -487,7 +505,6 @@ valopt llvm-root "" "set LLVM root"
487505valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
488506valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
489507valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path"
490- valopt mingw32-cross-path " " " MinGW32 cross compiler path"
491508
492509# Many of these are saved below during the "writing configuration" step
493510# (others are conditionally saved).
@@ -501,12 +518,18 @@ valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
501518valopt_nosave mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
502519valopt_nosave release-channel " dev" " the name of the release channel to build"
503520
521+ # Temporarily support old triples until buildbots get updated
522+ CFG_BUILD=$( to_llvm_triple $CFG_BUILD )
523+ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
524+ CFG_HOST=$( to_llvm_triple $CFG_HOST )
525+ CFG_TARGET=$( to_llvm_triple $CFG_TARGET )
526+
504527# On windows we just store the libraries in the bin directory because
505528# there's no rpath. This is where the build system itself puts libraries;
506529# --libdir is used to configure the installation directory.
507530# FIXME: This needs to parameterized over target triples. Do it in platform.mk
508531CFG_LIBDIR_RELATIVE=lib
509- if [ " $CFG_OSTYPE " = " pc-mingw32 " ] || [ " $CFG_OSTYPE " = " w64-mingw32 " ]
532+ if [ " $CFG_OSTYPE " = " pc-windows-gnu " ]
510533then
511534 CFG_LIBDIR_RELATIVE=bin
512535fi
632655fi
633656
634657BIN_SUF=
635- if [ " $CFG_OSTYPE " = " pc-mingw32 " ] || [ " $CFG_OSTYPE " = " w64-mingw32 " ]
658+ if [ " $CFG_OSTYPE " = " pc-windows-gnu " ]
636659then
637660 BIN_SUF=.exe
638661fi
@@ -1100,12 +1123,15 @@ do
11001123
11011124 if [ ${do_reconfigure} -ne 0 ]
11021125 then
1103- msg " configuring LLVM for $t "
1126+ # LLVM's configure doesn't recognize the new Windows triples yet
1127+ gnu_t=$( to_gnu_triple $t )
1128+
1129+ msg " configuring LLVM for $gnu_t "
11041130
11051131 LLVM_TARGETS=" --enable-targets=x86,x86_64,arm,mips"
1106- LLVM_BUILD=" --build=$t "
1107- LLVM_HOST=" --host=$t "
1108- LLVM_TARGET=" --target=$t "
1132+ LLVM_BUILD=" --build=$gnu_t "
1133+ LLVM_HOST=" --host=$gnu_t "
1134+ LLVM_TARGET=" --target=$gnu_t "
11091135
11101136 # Disable unused LLVM features
11111137 LLVM_OPTS=" $LLVM_DBG_OPTS $LLVM_ASSERTION_OPTS --disable-docs --enable-bindings=none"
11191145 # (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
11201146 # Also note that pthreads works badly on mingw-w64 systems: #8996
11211147 case " $CFG_BUILD " in
1122- (* -mingw32 )
1148+ (* -windows- * )
11231149 LLVM_OPTS=" $LLVM_OPTS --disable-pthreads"
11241150 ;;
11251151 esac
@@ -1269,6 +1295,7 @@ putvar CFG_HOST
12691295putvar CFG_TARGET
12701296putvar CFG_LIBDIR_RELATIVE
12711297putvar CFG_DISABLE_MANAGE_SUBMODULES
1298+ putvar CFG_ANDROID_CROSS_PATH
12721299putvar CFG_MANDIR
12731300
12741301# Avoid spurious warnings from clang by feeding it original source on
0 commit comments