diff -Naur binutils-2.37-orig/ar-lib binutils-2.37/ar-lib --- binutils-2.37-orig/ar-lib 2021-11-30 08:19:41.276294300 +0100 +++ binutils-2.37/ar-lib 2021-11-30 08:20:03.101276300 +0100 @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN*|MSYS*) file_conv=cygwin ;; *) diff -Naur binutils-2.37-orig/bfd/acinclude.m4 binutils-2.37/bfd/acinclude.m4 --- binutils-2.37-orig/bfd/acinclude.m4 2021-11-30 08:19:40.652753800 +0100 +++ binutils-2.37/bfd/acinclude.m4 2021-11-30 08:27:31.060649000 +0100 @@ -21,7 +21,7 @@ [AC_REQUIRE([AC_CANONICAL_TARGET]) case "${host}" in changequote(,)dnl -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) changequote([,])dnl AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;; esac])dnl diff -Naur binutils-2.37-orig/bfd/config.bfd binutils-2.37/bfd/config.bfd --- binutils-2.37-orig/bfd/config.bfd 2021-11-30 08:19:40.737367900 +0100 +++ binutils-2.37/bfd/config.bfd 2021-11-30 08:30:09.344982700 +0100 @@ -679,7 +679,7 @@ targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec" want64=true ;; - x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin) + x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | x86_64-*-msys) targ_defvec=x86_64_pe_vec targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_big_vec x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec" want64=true @@ -729,7 +729,7 @@ targ_defvec=i386_elf32_vec targ_selvecs="iamcu_elf32_vec i386_coff_vec" ;; - i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe) + i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-msys* | i[3-7]86-*-winnt | i[3-7]86-*-pe) targ_defvec=i386_pe_vec targ_selvecs="i386_pe_vec i386_pe_big_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec" targ_underscore=yes diff -Naur binutils-2.37-orig/bfd/configure binutils-2.37/bfd/configure --- binutils-2.37-orig/bfd/configure 2021-11-30 08:19:40.674879200 +0100 +++ binutils-2.37/bfd/configure 2021-11-30 08:49:35.744747500 +0100 @@ -5592,7 +5592,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5934,7 +5934,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -6545,7 +6545,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8129,7 +8129,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -8211,7 +8211,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8673,7 +8673,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -8788,7 +8788,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9219,7 +9219,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -10120,14 +10120,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10151,6 +10151,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -10777,7 +10783,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -12904,7 +12910,7 @@ case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; @@ -12983,7 +12989,7 @@ LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -13137,6 +13143,10 @@ SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lcygwin -lkernel32" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lmsys-2.0 -lkernel32" + ;; esac if test -n "$SHARED_LIBADD"; then diff -Naur binutils-2.37-orig/bfd/configure.ac binutils-2.37/bfd/configure.ac --- binutils-2.37-orig/bfd/configure.ac 2021-11-30 08:19:40.768610800 +0100 +++ binutils-2.37/bfd/configure.ac 2021-11-30 08:50:01.708256300 +0100 @@ -317,6 +317,10 @@ SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lcygwin -lkernel32" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lmsys-2.0 -lkernel32" + ;; esac if test -n "$SHARED_LIBADD"; then --- binutils-2.42/binutils/configure.orig 2024-01-29 01:00:00.000000000 +0100 +++ binutils-2.42/binutils/configure 2024-01-30 07:56:22.381185600 +0100 @@ -5344,7 +5344,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5686,7 +5686,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -6302,7 +6302,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7919,7 +7919,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -8001,7 +8001,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8463,7 +8463,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -8578,7 +8578,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9009,7 +9009,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -9910,14 +9910,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -9941,6 +9941,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -10591,7 +10597,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -15676,7 +15682,7 @@ case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; @@ -16229,7 +16235,7 @@ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | all) + i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-msys* | i[3-7]86-*-mingw32** | all) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" @@ -16271,7 +16277,7 @@ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - x86_64-*-mingw* | x86_64-*-cygwin*) + x86_64-*-mingw* | x86_64-*-cygwin* | x86_64-*-msys*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" @@ -16295,7 +16301,7 @@ powerpc*-*-aix* | rs6000-*-aix*) od_vectors="$od_vectors objdump_private_desc_xcoff" ;; - *-*-pe* | *-*-cygwin* | *-*-mingw*) + *-*-pe* | *-*-cygwin* | *-*-msys* | *-*-mingw*) od_vectors="$od_vectors objdump_private_desc_pe" ;; *-*-darwin*) --- binutils-2.42/binutils/configure.ac.orig 2024-01-30 07:51:14.212953500 +0100 +++ binutils-2.42/binutils/configure.ac 2024-01-30 07:53:24.015164500 +0100 @@ -396,7 +396,7 @@ BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; changequote(,)dnl - i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | all) + i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-msys* | i[3-7]86-*-mingw32** | all) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then @@ -441,7 +441,7 @@ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' ;; - x86_64-*-mingw* | x86_64-*-cygwin*) + x86_64-*-mingw* | x86_64-*-cygwin* | x86_64-*-msys*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64" @@ -465,7 +465,7 @@ powerpc*-*-aix* | rs6000-*-aix*) od_vectors="$od_vectors objdump_private_desc_xcoff" ;; - *-*-pe* | *-*-cygwin* | *-*-mingw*) + *-*-pe* | *-*-cygwin* | *-*-msys* | *-*-mingw*) od_vectors="$od_vectors objdump_private_desc_pe" ;; *-*-darwin*) diff -Naur binutils-2.37-orig/binutils/dllwrap.c binutils-2.37/binutils/dllwrap.c --- binutils-2.37-orig/binutils/dllwrap.c 2021-11-30 08:19:29.866519000 +0100 +++ binutils-2.37/binutils/dllwrap.c 2021-11-30 08:55:46.638625700 +0100 @@ -78,6 +78,7 @@ typedef enum { UNKNOWN_TARGET, CYGWIN_TARGET, + MSYS_TARGET, MINGW_TARGET } target_type; @@ -833,6 +834,8 @@ /* Set the target platform. */ if (strstr (target, "cygwin")) which_target = CYGWIN_TARGET; + else if (strstr (target, "msys")) + which_target = MSYS_TARGET; else if (strstr (target, "mingw")) which_target = MINGW_TARGET; else @@ -884,6 +887,10 @@ driver_flags = cygwin_driver_flags; break; + case MSYS_TARGET: + driver_flags = cygwin_driver_flags; + break; + case MINGW_TARGET: driver_flags = mingw32_driver_flags; break; @@ -917,6 +924,10 @@ name_entry = "_cygwin_dll_entry"; break; + case MSYS_TARGET: + name_entry = "_msys_dll_entry"; + break; + case MINGW_TARGET: name_entry = "DllMainCRTStartup"; break; @@ -980,7 +991,7 @@ { dyn_string_append_cstr (step_pre1, " --export-all --exclude-symbol="); dyn_string_append_cstr (step_pre1, - "_cygwin_dll_entry@12,DllMainCRTStartup@12,DllMain@12,DllEntryPoint@12"); + "_cygwin_dll_entry@12,_msys_dll_entry@12,DllMainCRTStartup@12,DllMain@12,DllEntryPoint@12"); } dyn_string_append_cstr (step_pre1, " --output-def "); dyn_string_append_cstr (step_pre1, def_file_name); diff -Naur binutils-2.37-orig/compile binutils-2.37/compile --- binutils-2.37-orig/compile 2021-11-30 08:19:41.276294300 +0100 +++ binutils-2.37/compile 2021-11-30 08:56:44.916376000 +0100 @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -Naur binutils-2.37-orig/config/dfp.m4 binutils-2.37/config/dfp.m4 --- binutils-2.37-orig/config/dfp.m4 2021-11-30 08:19:29.512440500 +0100 +++ binutils-2.37/config/dfp.m4 2021-11-30 08:57:18.166527700 +0100 @@ -23,7 +23,8 @@ powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \ i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \ i?86*-*-mingw* | x86_64*-*-mingw* | \ - i?86*-*-cygwin* | x86_64*-*-cygwin*) + i?86*-*-cygwin* | x86_64*-*-cygwin* | \ + i?86*-*-msys* | x86_64*-*-msys*) enable_decimal_float=yes ;; *) diff -Naur binutils-2.37-orig/config/elf.m4 binutils-2.37/config/elf.m4 --- binutils-2.37-orig/config/elf.m4 2021-11-30 08:19:29.512440500 +0100 +++ binutils-2.37/config/elf.m4 2021-11-30 08:24:01.097546100 +0100 @@ -15,7 +15,7 @@ target_elf=no case $target in - *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ + *-darwin* | *-aix* | *-cygwin* | *-msys* | *-mingw* | *-aout* | *-*coff* | \ *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \ alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux* | \ nvptx-*-none) diff -Naur binutils-2.37-orig/config/lthostflags.m4 binutils-2.37/config/lthostflags.m4 --- binutils-2.37-orig/config/lthostflags.m4 2021-11-30 08:19:29.512440500 +0100 +++ binutils-2.37/config/lthostflags.m4 2021-11-30 08:24:01.097546100 +0100 @@ -13,7 +13,7 @@ AC_REQUIRE([AC_CANONICAL_SYSTEM]) case $host in - *-cygwin* | *-mingw*) + *-cygwin* | *-msys* | *-mingw*) # 'host' will be top-level target in the case of a target lib, # we must compare to with_cross_host to decide if this is a native # or cross-compiler and select where to install dlls appropriately. diff -Naur binutils-2.37-orig/config/mmap.m4 binutils-2.37/config/mmap.m4 --- binutils-2.37-orig/config/mmap.m4 2021-11-30 08:19:29.543684000 +0100 +++ binutils-2.37/config/mmap.m4 2021-11-30 08:57:58.902485900 +0100 @@ -42,7 +42,7 @@ # Systems known to be in this category are Windows (all variants), # VMS, and Darwin. case "$host_os" in - *vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + *vms* | cygwin* | msys* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) gcc_cv_func_mmap_dev_zero=no ;; *) gcc_cv_func_mmap_dev_zero=yes;; @@ -74,7 +74,7 @@ # above for use of /dev/zero. # Systems known to be in this category are Windows, VMS, and SCO Unix. case "$host_os" in - *vms* | cygwin* | pe | mingw* | sco* | udk* ) + *vms* | cygwin* | msys* | pe | mingw* | sco* | udk* ) gcc_cv_func_mmap_anon=no ;; *) gcc_cv_func_mmap_anon=yes;; diff -Naur binutils-2.37-orig/config/picflag.m4 binutils-2.37/config/picflag.m4 --- binutils-2.37-orig/config/picflag.m4 2021-11-30 08:19:29.512440500 +0100 +++ binutils-2.37/config/picflag.m4 2021-11-30 08:58:39.931459700 +0100 @@ -25,6 +25,8 @@ ;; i[[34567]]86-*-cygwin* | x86_64-*-cygwin*) ;; + i[[34567]]86-*-msys* | x86_64-*-msys*) + ;; i[[34567]]86-*-mingw* | x86_64-*-mingw*) ;; i[[34567]]86-*-interix[[3-9]]*) diff -Naur binutils-2.37-orig/config/tcl.m4 binutils-2.37/config/tcl.m4 --- binutils-2.37-orig/config/tcl.m4 2021-11-30 08:19:29.543684000 +0100 +++ binutils-2.37/config/tcl.m4 2021-11-30 08:59:39.824595800 +0100 @@ -33,7 +33,7 @@ # First check to see if --with-tcl was specified. case "${host}" in - *-*-cygwin*) platDir="win" ;; + *-*-cygwin* | *-*-msys*) platDir="win" ;; *) platDir="unix" ;; esac if test x"${with_tclconfig}" != x ; then @@ -165,7 +165,7 @@ # then check for a private Tk library case "${host}" in - *-*-cygwin*) platDir="win" ;; + *-*-cygwin* | *-*-msys*) platDir="win" ;; *) platDir="unix" ;; esac if test x"${ac_cv_c_tkconfig}" = x ; then --- binutils-2.39/config.guess.orig 2022-10-15 10:32:02.910286100 +0200 +++ binutils-2.39/config.guess 2022-10-15 10:32:49.066905700 +0200 @@ -950,6 +950,9 @@ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; + amd64:MSYS*:*:* | x86_64:MSYS*:*:*) + GUESS=x86_64-unknown-msys + ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL diff -Naur binutils-2.37-orig/config.rpath binutils-2.37/config.rpath --- binutils-2.37-orig/config.rpath 2021-11-30 08:19:41.276294300 +0100 +++ binutils-2.37/config.rpath 2021-11-30 08:21:43.459094300 +0100 @@ -109,7 +109,7 @@ hardcode_minus_L=no case "$host_os" in - cygwin* | mingw* | pw32*) + cygwin* | msys* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -149,7 +149,7 @@ ld_shlibs=no fi ;; - cygwin* | mingw* | pw32*) + cygwin* | msys* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -268,7 +268,7 @@ ;; bsdi4*) ;; - cygwin* | mingw* | pw32*) + cygwin* | msys* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -437,7 +437,7 @@ ;; bsdi4*) ;; - cygwin* | mingw* | pw32*) + cygwin* | msys* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) diff -Naur binutils-2.37-orig/configure binutils-2.37/configure --- binutils-2.37-orig/configure 2021-11-30 08:19:41.254169100 +0100 +++ binutils-2.37/configure 2021-11-30 09:02:26.133574100 +0100 @@ -3090,7 +3090,7 @@ # Configure extra directories which are host specific case "${host}" in - *-cygwin*) + *-cygwin* | *-msys*) configdirs="$configdirs libtermcap" ;; esac @@ -3488,7 +3488,7 @@ # Disable the go frontend on systems where it is known to not work. Please keep # this in sync with contrib/config-list.mk. case "${target}" in -*-*-darwin* | *-*-cygwin* | *-*-mingw* | bpf-* ) +*-*-darwin* | *-*-cygwin* | *-*-msys* | *-*-mingw* | bpf-* ) unsupported_languages="$unsupported_languages go" ;; esac @@ -3520,7 +3520,7 @@ # PR 46986 noconfigdirs="$noconfigdirs target-libgo" ;; - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) noconfigdirs="$noconfigdirs target-libgo" ;; esac @@ -3788,7 +3788,7 @@ i[3456789]86-*-mingw*) target_configdirs="$target_configdirs target-winsup" ;; - *-*-cygwin*) + *-*-cygwin* | *-*-msys*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-libgloss" # always build newlib if winsup directory is present. @@ -3936,7 +3936,7 @@ i[3456789]86-*-msdosdjgpp*) host_makefile_frag="config/mh-djgpp" ;; - *-cygwin*) + *-cygwin* | *-msys*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if cat works as expected" >&5 $as_echo_n "checking to see if cat works as expected... " >&6; } @@ -6357,7 +6357,7 @@ target_elf=no case $target in - *-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \ + *-darwin* | *-aix* | *-cygwin* | *-msys* | *-mingw* | *-aout* | *-*coff* | \ *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \ alpha*-dec-osf* | *-interix* | hppa[12]*-*-hpux* | \ nvptx-*-none) @@ -6375,7 +6375,7 @@ else if test x"$default_enable_lto" = x"yes" ; then case $target in - *-apple-darwin[912]* | *-cygwin* | *-mingw* | *djgpp*) ;; + *-apple-darwin[912]* | *-cygwin* | *-msys* | *-mingw* | *djgpp*) ;; # On other non-ELF platforms, LTO has yet to be validated. *) enable_lto=no ;; esac @@ -6386,7 +6386,7 @@ # warn during gcc/ subconfigure; unless you're bootstrapping with # -flto it won't be needed until after installation anyway. case $target in - *-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;; + *-cygwin* | *-msys* | *-mingw* | *-apple-darwin* | *djgpp*) ;; *) if test x"$enable_lto" = x"yes"; then as_fn_error $? "LTO support is not enabled for this target." "$LINENO" 5 fi @@ -6396,7 +6396,7 @@ # Among non-ELF, only Windows platforms support the lto-plugin so far. # Build it unless LTO was explicitly disabled. case $target in - *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;; + *-cygwin* | *-msys* | *-mingw*) build_lto_plugin=$enable_lto ;; *) ;; esac @@ -7360,7 +7360,7 @@ case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; - *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;; + *-*-mingw* | *-*-cygwin | *-*-msys) RPATH_ENVVAR=PATH ;; *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; esac @@ -7894,7 +7894,7 @@ case " $target_configargs " in *" --with-newlib "*) case "$target" in - *-cygwin*) + *-cygwin* | *-msys*) FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include' ;; esac --- binutils-2.42/configure.ac.orig 2024-01-29 01:00:00.000000000 +0100 +++ binutils-2.42/configure.ac 2024-01-30 07:46:38.185503100 +0100 @@ -442,7 +442,7 @@ # Configure extra directories which are host specific case "${host}" in - *-cygwin*) + *-cygwin* | *-msys*) configdirs="$configdirs libtermcap" ;; esac @@ -838,7 +838,7 @@ # Disable the go frontend on systems where it is known to not work. Please keep # this in sync with contrib/config-list.mk. case "${target}" in -*-*-darwin* | *-*-cygwin* | *-*-mingw* | bpf-* ) +*-*-darwin* | *-*-cygwin* | *-*-msys* | *-*-mingw* | bpf-* ) unsupported_languages="$unsupported_languages go" ;; esac @@ -867,7 +867,7 @@ # PR 46986 noconfigdirs="$noconfigdirs target-libgo" ;; - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) noconfigdirs="$noconfigdirs target-libgo" ;; bpf-*-*) @@ -1162,7 +1162,7 @@ i[[3456789]]86-*-mingw*) target_configdirs="$target_configdirs target-winsup" ;; - *-*-cygwin*) + *-*-cygwin* | *-*-msys*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-libgloss" # always build newlib if winsup directory is present. @@ -1318,7 +1318,7 @@ i[[3456789]]86-*-msdosdjgpp*) host_makefile_frag="config/mh-djgpp" ;; - *-cygwin*) + *-cygwin* | *-msys*) ACX_CHECK_CYGWIN_CAT_WORKS host_makefile_frag="config/mh-cygwin" ;; @@ -1928,7 +1928,7 @@ build_lto_plugin=yes ],[if test x"$default_enable_lto" = x"yes" ; then case $target in - *-apple-darwin[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;; + *-apple-darwin[[912]]* | *-cygwin* | *-msys* | *-mingw* | *djgpp*) ;; # On other non-ELF platforms, LTO has yet to be validated. *) enable_lto=no ;; esac @@ -1939,7 +1939,7 @@ # warn during gcc/ subconfigure; unless you're bootstrapping with # -flto it won't be needed until after installation anyway. case $target in - *-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;; + *-cygwin* | *-msys* | *-mingw* | *-apple-darwin* | *djgpp*) ;; *) if test x"$enable_lto" = x"yes"; then AC_MSG_ERROR([LTO support is not enabled for this target.]) fi @@ -1949,7 +1949,7 @@ # Among non-ELF, only Windows platforms support the lto-plugin so far. # Build it unless LTO was explicitly disabled. case $target in - *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;; + *-cygwin* | *-msys* | *-mingw*) build_lto_plugin=$enable_lto ;; *) ;; esac ]) @@ -2958,7 +2958,7 @@ case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; - *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;; + *-*-mingw* | *-*-cygwin | *-*-msys) RPATH_ENVVAR=PATH ;; *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; esac @@ -3527,7 +3527,7 @@ case " $target_configargs " in *" --with-newlib "*) case "$target" in - *-cygwin*) + *-cygwin* | *-msys*) FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include' ;; esac diff -Naur binutils-2.37-orig/gas/configure binutils-2.37/gas/configure --- binutils-2.37-orig/gas/configure 2021-11-30 08:19:40.521276400 +0100 +++ binutils-2.37/gas/configure 2021-11-30 08:48:15.234691500 +0100 @@ -5173,7 +5173,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5515,7 +5515,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -6126,7 +6126,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7741,7 +7741,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -7823,7 +7823,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8285,7 +8285,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -8400,7 +8400,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -8831,7 +8831,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -9732,14 +9732,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -9763,6 +9763,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -10389,7 +10395,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -13537,7 +13543,7 @@ yes) LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -13869,7 +13875,7 @@ case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; diff -Naur binutils-2.37-orig/gas/configure.tgt binutils-2.37/gas/configure.tgt --- binutils-2.37-orig/gas/configure.tgt 2021-11-30 08:19:40.536897600 +0100 +++ binutils-2.37/gas/configure.tgt 2021-11-30 09:04:53.758984100 +0100 @@ -244,7 +244,7 @@ i386-*-msdos*) fmt=aout ;; i386-*-moss*) fmt=elf ;; i386-*-pe) fmt=coff em=pe ;; - i386-*-cygwin*) + i386-*-cygwin* | i386-*-msys*) case ${cpu} in x86_64*) fmt=coff em=pep ;; i*) fmt=coff em=pe ;; diff -Naur binutils-2.37-orig/gas/testsuite/gas/all/gas.exp binutils-2.37/gas/testsuite/gas/all/gas.exp --- binutils-2.37-orig/gas/testsuite/gas/all/gas.exp 2021-11-30 08:19:40.452296100 +0100 +++ binutils-2.37/gas/testsuite/gas/all/gas.exp 2021-11-30 08:32:41.087032400 +0100 @@ -173,8 +173,8 @@ # failures. setup_xfail "bfin-*-*" "i\[3-7\]86-*-*coff" \ "i\[3-7\]86-*-*pe" "i\[3-7\]86-*-go32*" \ - "i\[3-7\]86-*-cygwin*" "i\[3-7\]86-*-mingw*" \ - "x86_64-*-cygwin*" "x86_64-*-mingw*" + "i\[3-7\]86-*-cygwin*" "i\[3-7\]86-*-msys*" "i\[3-7\]86-*-mingw*" \ + "x86_64-*-cygwin*" "x86_64-*-msys*" "x86_64-*-mingw*" run_dump_test redef3 gas_test_error "redef4.s" "" ".set for symbol already used as label" gas_test_error "redef5.s" "" ".set for symbol already defined through .comm" @@ -322,6 +322,7 @@ || [istarget i*86-*-isc*] \ || [istarget i*86-*-go32*] \ || [istarget i*86-*-cygwin*] \ + || [istarget i*86-*-msys*] \ || [istarget x86_64-*-mingw*] \ || [istarget i*86-*-*nt] \ || [istarget i*86-*-interix*] } { @@ -395,6 +396,7 @@ if { ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \ || [istarget "i*86-*-cygwin*"] \ + || [istarget "i*86-*-msys*"] \ || [istarget "i*86-*-mingw32*"] } { gas_test "fastcall.s" "" "" "fastcall labels" } diff -Naur binutils-2.37-orig/gprof/configure binutils-2.37/gprof/configure --- binutils-2.37-orig/gprof/configure 2021-11-30 08:19:40.853224900 +0100 +++ binutils-2.37/gprof/configure 2021-11-30 08:46:42.537482200 +0100 @@ -5075,7 +5075,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5417,7 +5417,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -6028,7 +6028,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7643,7 +7643,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -7725,7 +7725,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8187,7 +8187,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -8302,7 +8302,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -8733,7 +8733,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -9634,14 +9634,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -9665,6 +9665,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -10291,7 +10297,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; diff -Naur binutils-2.37-orig/ld/configure binutils-2.37/ld/configure --- binutils-2.37-orig/ld/configure 2021-11-30 08:19:34.423226900 +0100 +++ binutils-2.37/ld/configure 2021-11-30 08:46:47.738991300 +0100 @@ -5928,7 +5928,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -6270,7 +6270,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -6881,7 +6881,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8497,7 +8497,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -8579,7 +8579,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -9041,7 +9041,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -9156,7 +9156,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9587,7 +9587,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -10488,14 +10488,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10519,6 +10519,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -11145,7 +11151,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -12367,7 +12373,7 @@ esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' @@ -13336,7 +13342,7 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -13876,7 +13882,7 @@ pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) @@ -14140,14 +14146,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -14170,6 +14176,11 @@ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -16302,7 +16313,7 @@ case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; --- binutils-2.40/ld/configure.tgt.orig 2023-01-14 01:00:00.000000000 +0100 +++ binutils-2.40/ld/configure.tgt 2023-01-20 15:35:12.691627700 +0100 @@ -428,7 +428,7 @@ i[3-7]86-*-pe) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; -i[3-7]86-*-cygwin*) targ_emul=i386pe ; +i[3-7]86-*-cygwin* | i[3-7]86-*-msys*) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ; test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; @@ -1049,7 +1049,7 @@ targ_extra_emuls=i386pe ; targ_extra_ofiles="deffilep.o pdb.o pep-dll-x86_64.o pe-dll.o" ;; -x86_64-*-cygwin) targ_emul=i386pep ; +x86_64-*-cygwin | x86_64-*-msys) targ_emul=i386pep ; targ_extra_emuls=i386pe targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o" test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' @@ -1134,7 +1134,7 @@ NATIVE_LIB_DIRS='/lib' ;; -i[03-9x]86-*-cygwin* | x86_64-*-cygwin*) +i[03-9x]86-*-cygwin* | x86_64-*-cygwin* | i[03-9x]86-*-msys* | x86_64-*-msys*) NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api' ;; --- binutils-2.39/ld/emultempl/pe.em.orig 2022-07-08 11:46:48.000000000 +0200 +++ binutils-2.39/ld/emultempl/pe.em 2022-10-18 20:19:55.104221000 +0200 @@ -7,7 +7,7 @@ fi case ${target} in - *-*-cygwin*) + *-*-cygwin* | *-*-msys*) cygwin_behavior=1 ;; *) @@ -188,7 +188,7 @@ # merge_rdata defaults to 0 for cygwin: # http://cygwin.com/ml/cygwin-apps/2013-04/msg00187.html case ${target} in - *-*-cygwin*) + *-*-cygwin* | *-*-msys*) default_auto_import=1 default_merge_rdata=0 ;; diff -Naur binutils-2.37-orig/ld/emultempl/pep.em binutils-2.37/ld/emultempl/pep.em --- binutils-2.37-orig/ld/emultempl/pep.em 2021-11-30 08:19:29.913382800 +0100 +++ binutils-2.37/ld/emultempl/pep.em 2021-11-30 09:08:31.366954100 +0100 @@ -7,7 +7,7 @@ fi case ${target} in - *-*-cygwin*) + *-*-cygwin* | *-*-msys*) move_default_addr_high=1 ;; *) --- binutils-2.40/ld/pe-dll.c.orig 2023-01-14 01:00:00.000000000 +0100 +++ binutils-2.40/ld/pe-dll.c 2023-01-20 15:26:23.296956500 +0100 @@ -209,6 +209,7 @@ { STRING_COMMA_LEN ("_NULL_IMPORT_DESCRIPTOR") }, /* Entry point symbols, and entry hooks. */ { STRING_COMMA_LEN ("cygwin_crt0") }, + { STRING_COMMA_LEN ("msys_crt0") }, #ifdef pe_use_plus { STRING_COMMA_LEN ("DllMain") }, { STRING_COMMA_LEN ("DllEntryPoint") }, @@ -216,6 +217,9 @@ { STRING_COMMA_LEN ("_cygwin_dll_entry") }, { STRING_COMMA_LEN ("_cygwin_crt0_common") }, { STRING_COMMA_LEN ("_cygwin_noncygwin_dll_entry") }, + { STRING_COMMA_LEN ("_msys_dll_entry") }, + { STRING_COMMA_LEN ("_msys_crt0_common") }, + { STRING_COMMA_LEN ("_msys_nonmsys_dll_entry") }, #else { STRING_COMMA_LEN ("DllMain@12") }, { STRING_COMMA_LEN ("DllEntryPoint@0") }, @@ -224,6 +228,10 @@ { STRING_COMMA_LEN ("_cygwin_crt0_common@8") }, { STRING_COMMA_LEN ("_cygwin_noncygwin_dll_entry@12") }, { STRING_COMMA_LEN ("cygwin_attach_dll") }, + { STRING_COMMA_LEN ("_msys_dll_entry@12") }, + { STRING_COMMA_LEN ("_msys_crt0_common@8") }, + { STRING_COMMA_LEN ("_msys_nonmsys_dll_entry@12") }, + { STRING_COMMA_LEN ("msys_attach_dll") }, #endif { STRING_COMMA_LEN ("cygwin_premain0") }, { STRING_COMMA_LEN ("cygwin_premain1") }, @@ -347,6 +355,7 @@ { { STRING_COMMA_LEN ("libcegcc") }, { STRING_COMMA_LEN ("libcygwin") }, + { STRING_COMMA_LEN ("libmsys-2.0") }, { STRING_COMMA_LEN ("libgcc") }, { STRING_COMMA_LEN ("libgcc_s") }, { STRING_COMMA_LEN ("libstdc++") }, diff -Naur binutils-2.37-orig/ld/testsuite/ld-auto-import/auto-import.exp binutils-2.37/ld/testsuite/ld-auto-import/auto-import.exp --- binutils-2.37-orig/ld/testsuite/ld-auto-import/auto-import.exp 2021-11-30 08:19:30.668321600 +0100 +++ binutils-2.37/ld/testsuite/ld-auto-import/auto-import.exp 2021-11-30 08:50:55.788718200 +0100 @@ -174,3 +174,65 @@ fail $msg } } + +if [istarget *-pc-msys] { + # Set some libs needed for msys. + set MYLIBS "-L/usr/lib -lmsys-2.0 -L/usr/lib/w32api -lkernel32" + + # Compile the dll. + if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/dll.c $tmpdir/dll.o] { + fail "compiling shared lib" + } + if ![ld_special_link "$ld -shared --enable-auto-import -e __cygwin_dll_entry@12 --out-implib=$tmpdir/libstandard.dll.a" $tmpdir/dll.dll "$tmpdir/dll.o $MYLIBS"] { + fail "linking shared lib" + } + + # Create symbolic link. + catch "exec ln -fs dll.dll $tmpdir/libsymlinked_dll.dll.a" ln_catch + + # Compile and link the client program. + if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/client.c $tmpdir/client.o] { + fail "compiling client" + } + + # Check linking with import library. + set msg "linking auto-import client using a standard import library" + if [ld_special_link $ld $tmpdir/client-linklib.exe "--enable-auto-import --enable-runtime-pseudo-reloc /lib/crt0.o $tmpdir/client.o -L$tmpdir -lstandard $MYLIBS"] { + pass $msg + } else { + fail $msg + } + + # Check linking directly with dll. + set msg "linking auto-import client using the dll" + if [ld_special_link $ld $tmpdir/client-linkdll.exe "--enable-auto-import --enable-runtime-pseudo-reloc /lib/crt0.o $tmpdir/client.o -L$tmpdir -ldll $MYLIBS"] { + pass $msg + } else { + fail $msg + } + + # Check linking with symlinked dll. + set msg "linking auto-import client using symbolic linked dll" + if [ld_special_link $ld $tmpdir/client-symlinkeddll.exe "--enable-auto-import --enable-runtime-pseudo-reloc /lib/crt0.o $tmpdir/client.o -L$tmpdir -lsymlinked_dll $MYLIBS"] { + pass $msg + } else { + fail $msg + } + + # Check linking with disabled auto-import, this must produce linking error. + set msg "linking with disabled auto-import" + if ![ld_special_link $ld $tmpdir/client-failed.exe "--disable-auto-import --enable-runtime-pseudo-reloc /lib/crt0.o $tmpdir/client.o -L$tmpdir -ldll $MYLIBS"] { + pass $msg + } else { + fail $msg + } + + # Check that the app works - ie that there is output when the applications runs. + set msg "application runtime segfault check" + catch "exec $tmpdir/client-linklib.exe" exec_output + if ![string match "" $exec_output] then { + pass $msg + } else { + fail $msg + } +} diff -Naur binutils-2.37-orig/ld/testsuite/ld-fastcall/fastcall.exp binutils-2.37/ld/testsuite/ld-fastcall/fastcall.exp --- binutils-2.37-orig/ld/testsuite/ld-fastcall/fastcall.exp 2021-11-30 08:19:30.683943200 +0100 +++ binutils-2.37/ld/testsuite/ld-fastcall/fastcall.exp 2021-11-30 08:34:07.572179100 +0100 @@ -26,6 +26,7 @@ if { !([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-opensd*"]) \ && ![istarget "i*86-*-cygwin*"] \ + && ![istarget "i*86-*-msys*"] \ && ![istarget "x86_64-*-mingw*"] \ && ![istarget "i*86-*-mingw*"] } { return diff -Naur binutils-2.37-orig/ld/testsuite/ld-pe/pe-compile.exp binutils-2.37/ld/testsuite/ld-pe/pe-compile.exp --- binutils-2.37-orig/ld/testsuite/ld-pe/pe-compile.exp 2021-11-30 08:19:32.434829300 +0100 +++ binutils-2.37/ld/testsuite/ld-pe/pe-compile.exp 2021-11-30 08:34:36.171916500 +0100 @@ -118,6 +118,7 @@ run_ver_script_test "vers-script-4" if {[istarget i*86-*-cygwin*] + || [istarget i*86-*-msys*] || [istarget i*86-*-pe] || [istarget i*86-*-mingw*] || [istarget x86_64-*-mingw*] } { diff -Naur binutils-2.37-orig/ld/testsuite/ld-pe/pe.exp binutils-2.37/ld/testsuite/ld-pe/pe.exp --- binutils-2.37-orig/ld/testsuite/ld-pe/pe.exp 2021-11-30 08:19:32.450451500 +0100 +++ binutils-2.37/ld/testsuite/ld-pe/pe.exp 2021-11-30 08:35:22.773678100 +0100 @@ -26,6 +26,7 @@ # This test can only be run on PE/COFF platforms that support .secrel32. if {[istarget i*86-*-cygwin*] + || [istarget i*86-*-msys*] || [istarget i*86-*-pe] || [istarget i*86-*-mingw*] || [istarget x86_64-*-mingw*] @@ -40,7 +41,7 @@ {"TLS directory entry" "" "" "" "tlssec.s" {{objdump -p tlssec64.d}} "tlssec.dll"} } - } elseif {[istarget i*86-*-cygwin*] } { + } elseif {[istarget i*86-*-cygwin*] || [istarget i*86-*-msys*] } { set pe_tests { {".secrel32" "--disable-auto-import --disable-reloc-section" "" "" {secrel1.s secrel2.s} {{objdump -s secrel.d}} "secrel.x"} @@ -97,7 +98,7 @@ if {[istarget x86_64-*-mingw*] } { run_dump_test "cfi" -} elseif {[istarget i*86-*-cygwin*] || [istarget i*86-*-mingw*] } { +} elseif {[istarget i*86-*-cygwin*] || [istarget i*86-*-msys*] || [istarget i*86-*-mingw*] } { run_dump_test "cfi32" } diff -Naur binutils-2.37-orig/ld/testsuite/ld-pe/weakdef-1.d binutils-2.37/ld/testsuite/ld-pe/weakdef-1.d --- binutils-2.37-orig/ld/testsuite/ld-pe/weakdef-1.d 2021-11-30 08:19:32.456972500 +0100 +++ binutils-2.37/ld/testsuite/ld-pe/weakdef-1.d 2021-11-30 08:35:41.993086800 +0100 @@ -1,5 +1,5 @@ #source: weakdef-1.s -#target: i*86-*-cygwin* i*86-*-pe i*86-*-mingw* +#target: i*86-*-cygwin* i*86-*-msys* i*86-*-pe i*86-*-mingw* #ld: -e _start --gc-sections #objdump: -d diff -Naur binutils-2.37-orig/libctf/configure binutils-2.37/libctf/configure --- binutils-2.37-orig/libctf/configure 2021-11-30 08:19:29.496823400 +0100 +++ binutils-2.37/libctf/configure 2021-11-30 08:51:35.857766900 +0100 @@ -6133,7 +6133,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -6475,7 +6475,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -7086,7 +7086,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8671,7 +8671,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -8753,7 +8753,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -9215,7 +9215,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -9330,7 +9330,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9761,7 +9761,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -10662,14 +10662,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10693,6 +10693,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -11319,7 +11325,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -13434,6 +13440,10 @@ SHARED_LDFLAGS="-no-undefined" CTF_LIBADD="$CTF_LIBADD -lcygwin" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + CTF_LIBADD="$CTF_LIBADD -lmsys-2.0" + ;; esac fi diff -Naur binutils-2.37-orig/libctf/configure.ac binutils-2.37/libctf/configure.ac --- binutils-2.37-orig/libctf/configure.ac 2021-11-30 08:19:29.496823400 +0100 +++ binutils-2.37/libctf/configure.ac 2021-11-30 08:51:53.235488400 +0100 @@ -204,6 +204,10 @@ SHARED_LDFLAGS="-no-undefined" CTF_LIBADD="$CTF_LIBADD -lcygwin" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + CTF_LIBADD="$CTF_LIBADD -lmsys-2.0" + ;; esac fi AC_SUBST(SHARED_LDFLAGS) diff -Naur binutils-2.37-orig/libiberty/configure binutils-2.37/libiberty/configure --- binutils-2.37-orig/libiberty/configure 2021-11-30 08:19:29.465581600 +0100 +++ binutils-2.37/libiberty/configure 2021-11-30 09:12:30.316655000 +0100 @@ -5323,6 +5323,8 @@ ;; i[34567]86-*-cygwin* | x86_64-*-cygwin*) ;; + i[34567]86-*-msys* | x86_64-*-msys*) + ;; i[34567]86-*-mingw* | x86_64-*-mingw*) ;; i[34567]86-*-interix[3-9]*) @@ -6614,7 +6616,7 @@ case "${host}" in - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) $as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h $as_echo "#define HAVE_SYS_NERR 1" >>confdefs.h diff -Naur binutils-2.37-orig/libiberty/configure.ac binutils-2.37/libiberty/configure.ac --- binutils-2.37-orig/libiberty/configure.ac 2021-11-30 08:19:29.449952600 +0100 +++ binutils-2.37/libiberty/configure.ac 2021-11-30 08:25:44.351678400 +0100 @@ -565,7 +565,7 @@ AC_SUBST(target_header_dir) case "${host}" in - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) AC_DEFINE(HAVE_SYS_ERRLIST) AC_DEFINE(HAVE_SYS_NERR) ;; diff -Naur binutils-2.37-orig/libtool.m4 binutils-2.37/libtool.m4 --- binutils-2.37-orig/libtool.m4 2021-11-30 08:19:41.269789200 +0100 +++ binutils-2.37/libtool.m4 2021-11-30 08:47:49.966774200 +0100 @@ -1521,7 +1521,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -1763,7 +1763,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -2234,14 +2234,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2265,6 +2265,12 @@ m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' @@ -3021,7 +3027,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -3305,7 +3311,7 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3380,7 +3386,7 @@ aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -3627,7 +3633,7 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -3940,7 +3946,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -4023,7 +4029,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -4256,7 +4262,7 @@ pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) @@ -4308,7 +4314,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -4423,7 +4429,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -4796,7 +4802,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -5740,7 +5746,7 @@ esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' diff -Naur binutils-2.37-orig/ltmain.sh binutils-2.37/ltmain.sh --- binutils-2.37-orig/ltmain.sh 2021-11-30 08:19:41.254169100 +0100 +++ binutils-2.37/ltmain.sh 2021-11-30 09:24:23.557793900 +0100 @@ -976,7 +976,7 @@ case $host in - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* ) + *cygwin* | *msys* | *mingw* | *pw32* | *cegcc* | *solaris2* ) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -1453,7 +1453,7 @@ # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) + cygwin* | msys* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac @@ -2279,7 +2279,7 @@ 'exit $?' tstripme="$stripme" case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" @@ -2385,7 +2385,7 @@ # Do a test to see if this is really a libtool program. case $host in - *cygwin* | *mingw*) + *cygwin* | *msys* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result @@ -2460,7 +2460,7 @@ # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in - */usr/bin/install*,*cygwin*) + */usr/bin/install*,*cygwin* | */usr/bin/install*,*msys*) case $file:$destfile in *.exe:*.exe) # this is ok @@ -2595,7 +2595,7 @@ $RM $export_symbols ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols" case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *msys* | *mingw* | *cegcc* ) echo EXPORTS > "$output_objdir/$outputname.def" cat "$export_symbols" >> "$output_objdir/$outputname.def" ;; @@ -2607,7 +2607,7 @@ $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *msys* | *mingw* | *cegcc* ) echo EXPORTS > "$output_objdir/$outputname.def" cat "$nlist" >> "$output_objdir/$outputname.def" ;; @@ -2663,7 +2663,7 @@ } lt_dlsymlist; " case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *msys* | *mingw* | *cegcc* ) echo >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation @@ -2749,7 +2749,7 @@ # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *msys* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` @@ -3192,7 +3192,7 @@ func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` ;; - *cygwin* ) + *cygwin* | *msys*) func_to_host_path_result=`cygpath -w "$1" | $SED -e "$lt_sed_naive_backslashify"` ;; @@ -3265,7 +3265,7 @@ ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` ;; - *cygwin* ) + *cygwin* | *msys*) func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | $SED -e "$lt_sed_naive_backslashify"` ;; @@ -3571,7 +3571,7 @@ { EOF case "$host" in - *mingw* | *cygwin* ) + *mingw* | *cygwin* | *msys*) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; @@ -4233,7 +4233,7 @@ { $opt_debug case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra @@ -4713,7 +4713,7 @@ ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; @@ -4733,7 +4733,7 @@ -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4813,7 +4813,7 @@ -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" @@ -5772,7 +5772,7 @@ if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *msys* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no @@ -5842,7 +5842,7 @@ elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | *msys* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" @@ -6693,7 +6693,7 @@ if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) @@ -7194,7 +7194,7 @@ orig_export_symbols= case $host_os in - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then @@ -7710,7 +7710,7 @@ prog) case $host in - *cygwin*) func_stripname '' '.exe' "$output" + *cygwin* | *msys*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ @@ -7823,7 +7823,7 @@ esac fi case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; @@ -7901,7 +7901,7 @@ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; - *cygwin* | *mingw* ) + *cygwin* | *msys* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi @@ -8029,14 +8029,14 @@ esac # test for cygwin because mv fails w/o .exe extensions case $host in - *cygwin*) + *cygwin* | *msys*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in - *cygwin* | *mingw* ) + *cygwin* | *msys* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result @@ -8343,7 +8343,7 @@ # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + *cygwin*,*lai,yes,no,*.dll | *msys*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then diff -Naur binutils-2.37-orig/ltoptions.m4 binutils-2.37/ltoptions.m4 --- binutils-2.37-orig/ltoptions.m4 2021-11-30 08:19:41.276294300 +0100 +++ binutils-2.37/ltoptions.m4 2021-11-30 08:25:44.351678400 +0100 @@ -126,7 +126,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) --- binutils-2.39/opcodes/configure.orig 2022-08-05 11:54:59.000000000 +0200 +++ binutils-2.39/opcodes/configure 2022-10-15 10:23:42.168951300 +0200 @@ -5588,7 +5588,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5930,7 +5930,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -6541,7 +6541,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8126,7 +8126,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -8208,7 +8208,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8670,7 +8670,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -8785,7 +8785,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9216,7 +9216,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -10117,14 +10117,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10148,6 +10148,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -10774,7 +10780,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -12253,7 +12259,7 @@ LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -12429,6 +12435,10 @@ SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" + ;; *) SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}" SHARED_DEPENDENCIES="../bfd/libbfd.la" --- binutils-2.39/opcodes/configure.ac.orig 2022-10-15 10:19:38.111379400 +0200 +++ binutils-2.39/opcodes/configure.ac 2022-10-15 10:24:12.564239300 +0200 @@ -195,6 +195,10 @@ SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" + ;; *) SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}" SHARED_DEPENDENCIES="../bfd/libbfd.la" diff -Naur binutils-2.37-orig/zlib/configure binutils-2.37/zlib/configure --- binutils-2.37-orig/zlib/configure 2021-11-30 08:19:41.456526700 +0100 +++ binutils-2.37/zlib/configure 2021-11-30 08:47:02.475326900 +0100 @@ -4881,7 +4881,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | msys* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5223,7 +5223,7 @@ lt_cv_file_magic_test_file=/shlib/libc.so ;; -cygwin*) +cygwin* | msys*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' @@ -5834,7 +5834,7 @@ aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7723,7 +7723,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -7805,7 +7805,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8267,7 +8267,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -8382,7 +8382,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -8819,7 +8819,7 @@ export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | msys* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -9723,14 +9723,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,msys* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -9754,6 +9754,12 @@ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; + msys*) + # MSYS DLLs use 'msys-' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' @@ -10383,7 +10389,7 @@ lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;;