diff --git binutils-2.28.orig/bfd/acinclude.m4 binutils-2.28/bfd/acinclude.m4 index 0991c2e..4f9c86a 100644 --- binutils-2.28.orig/bfd/acinclude.m4 +++ binutils-2.28/bfd/acinclude.m4 @@ -21,7 +21,7 @@ AC_DEFUN([BFD_BINARY_FOPEN], [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 --git binutils-2.28.orig/bfd/config.bfd binutils-2.28/bfd/config.bfd index 1b28016..8cabb86 100644 --- binutils-2.28.orig/bfd/config.bfd +++ binutils-2.28/bfd/config.bfd @@ -806,7 +806,7 @@ case "${targ}" in targ_archs="$targ_archs bfd_arm_arch" 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_be_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 @@ -859,7 +859,7 @@ case "${targ}" in 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_pei_vec i386_elf32_vec iamcu_elf32_vec" targ_underscore=yes @@ -1431,7 +1431,7 @@ case "${targ}" in targ_selvecs="rs6000_xcoff_vec powerpc_elf32_vec powerpc_boot_vec" targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec" ;; - powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) + powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin* | powerpcle-*-msys*) targ_defvec=powerpc_pe_le_vec targ_selvecs="powerpc_pei_le_vec powerpc_pei_vec powerpc_pe_le_vec powerpc_pe_vec" ;; diff --git binutils-2.28.orig/bfd/configure binutils-2.28/bfd/configure index 9769387..623fee5 100755 --- binutils-2.28.orig/bfd/configure +++ binutils-2.28/bfd/configure @@ -5997,7 +5997,7 @@ else 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, @@ -6339,7 +6339,7 @@ bsdi[45]*) 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' @@ -6919,7 +6919,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8503,7 +8503,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -8585,7 +8585,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -9047,7 +9047,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -9162,7 +9162,7 @@ _LT_EOF 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' @@ -9593,7 +9593,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -10494,14 +10494,14 @@ bsdi[45]*) # 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}`~ @@ -10525,6 +10525,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -11161,7 +11167,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -13805,7 +13811,7 @@ _ACEOF case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; @@ -13981,7 +13987,7 @@ $as_echo "$bfd_cv_ld_as_needed" >&6; } 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*) @@ -14131,7 +14137,10 @@ if test "$enable_shared" = "yes"; then SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" ;; - + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lmsys-2.0 -lkernel32" + ;; # Hack to build or1k-src on OSX or1k*-*-darwin*) SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl" diff --git binutils-2.28.orig/bfd/configure.ac binutils-2.28/bfd/configure.ac index 9a183c1..ea50180 100644 --- binutils-2.28.orig/bfd/configure.ac +++ binutils-2.28/bfd/configure.ac @@ -262,7 +262,10 @@ changequote([,])dnl SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" ;; - + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lmsys-2.0 -lkernel32" + ;; # Hack to build or1k-src on OSX or1k*-*-darwin*) SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl" diff --git binutils-2.28.orig/binutils/configure binutils-2.28/binutils/configure index baddf34..2c2cc2a 100755 --- binutils-2.28.orig/binutils/configure +++ binutils-2.28/binutils/configure @@ -5764,7 +5764,7 @@ else 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, @@ -6106,7 +6106,7 @@ bsdi[45]*) 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' @@ -6686,7 +6686,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8301,7 +8301,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -8383,7 +8383,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -8845,7 +8845,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -8960,7 +8960,7 @@ _LT_EOF 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' @@ -9391,7 +9391,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -10292,14 +10292,14 @@ bsdi[45]*) # 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}`~ @@ -10323,6 +10323,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -10959,7 +10965,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -13643,7 +13649,7 @@ fi case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; @@ -14495,7 +14501,7 @@ do 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" @@ -14505,7 +14511,7 @@ do BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; - i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) + i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-msys* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386" @@ -14527,7 +14533,7 @@ do powerpc*-aix[5-9].*) OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT" ;; - powerpc*-*-pe* | powerpc*-*-cygwin*) + powerpc*-*-pe* | powerpc*-*-cygwin* | powerpc*-*-msys*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC" diff --git binutils-2.28.orig/binutils/configure.ac binutils-2.28/binutils/configure.ac index 2f3fca9..3565bfb 100644 --- binutils-2.28.orig/binutils/configure.ac +++ binutils-2.28/binutils/configure.ac @@ -315,7 +315,7 @@ changequote([,])dnl 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" @@ -326,7 +326,7 @@ changequote([,])dnl BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; changequote(,)dnl - i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) + i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-msys* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then @@ -355,7 +355,7 @@ changequote(,)dnl changequote([,])dnl OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT" ;; - powerpc*-*-pe* | powerpc*-*-cygwin*) + powerpc*-*-pe* | powerpc*-*-cygwin* | powerpc*-*-msys*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' if test -z "$DLLTOOL_DEFAULT"; then DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC" diff --git binutils-2.28.orig/binutils/dllwrap.c binutils-2.28/binutils/dllwrap.c index b34cef1..93931e3 100644 --- binutils-2.28.orig/binutils/dllwrap.c +++ binutils-2.28/binutils/dllwrap.c @@ -78,6 +78,7 @@ static int is_leading_underscore = -1; typedef enum { UNKNOWN_TARGET, CYGWIN_TARGET, + MSYS_TARGET, MINGW_TARGET } target_type; @@ -832,6 +833,8 @@ Creating one, but that may not be what you want")); /* 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 @@ -883,6 +886,10 @@ Creating one, but that may not be what you want")); driver_flags = cygwin_driver_flags; break; + case MSYS_TARGET: + driver_flags = cygwin_driver_flags; + break; + case MINGW_TARGET: driver_flags = mingw32_driver_flags; break; @@ -916,6 +923,10 @@ Creating one, but that may not be what you want")); name_entry = "_cygwin_dll_entry"; break; + case MSYS_TARGET: + name_entry = "_msys_dll_entry"; + break; + case MINGW_TARGET: name_entry = "DllMainCRTStartup"; break; @@ -979,7 +990,7 @@ Creating one, but that may not be what you want")); { 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 --git binutils-2.28.orig/binutils/testsuite/binutils-all/copy-3.d binutils-2.28/binutils/testsuite/binutils-all/copy-3.d index 284aa56..271ee1f 100644 --- binutils-2.28.orig/binutils/testsuite/binutils-all/copy-3.d +++ binutils-2.28/binutils/testsuite/binutils-all/copy-3.d @@ -3,7 +3,7 @@ #objcopy: --set-section-flags .text=alloc,data #name: copy with setting section flags 3 #source: bintest.s -#not-target: *-*-*aout *-*-*coff *-*-cygwin* *-*-darwin *-*-mingw* *-*-go32 *-*-*pe hppa*-*-hpux* m68k-*-netbsd m68k-*-openbsd* ns32k-*-netbsd powerpc-*-aix* rs6000-*-* rx-*-* +#not-target: *-*-*aout *-*-*coff *-*-cygwin* *-*-msys* *-*-darwin *-*-mingw* *-*-go32 *-*-*pe hppa*-*-hpux* m68k-*-netbsd m68k-*-openbsd* ns32k-*-netbsd powerpc-*-aix* rs6000-*-* rx-*-* # The .text # section in PE/COFF has a fixed set of flags and these # cannot be changed. We skip it for them. diff --git binutils-2.28.orig/binutils/testsuite/binutils-all/dlltool.exp binutils-2.28/binutils/testsuite/binutils-all/dlltool.exp index 8ae6510..cb2e020 100644 --- binutils-2.28.orig/binutils/testsuite/binutils-all/dlltool.exp +++ binutils-2.28/binutils/testsuite/binutils-all/dlltool.exp @@ -22,6 +22,7 @@ if {![istarget "i*86-*-*"] if {![istarget "i*86-*-*pe*"] \ && ![istarget "i*86-*-cygwin*"] \ + && ![istarget "i*86-*-msys*"] \ && ![istarget "i*86-*-mingw32*"] \ && ![istarget "arm-*-pe*"] \ && ![istarget "x86_64-*-mingw*"] } { diff --git binutils-2.28.orig/binutils/testsuite/binutils-all/objcopy.exp binutils-2.28/binutils/testsuite/binutils-all/objcopy.exp index 91e0b65..3597c06 100644 --- binutils-2.28.orig/binutils/testsuite/binutils-all/objcopy.exp +++ binutils-2.28/binutils/testsuite/binutils-all/objcopy.exp @@ -555,7 +555,7 @@ strip_test_with_saving_a_symbol # Build a final executable. -if { [istarget *-*-cygwin] || [istarget *-*-mingw*] } { +if { [istarget *-*-cygwin] || [istarget *-*-mingw*] || [istarget *-*-msys*] } { set test_prog "testprog.exe" } else { set test_prog "testprog" @@ -662,6 +662,7 @@ proc copy_executable { prog flags test1 test2 } { setup_xfail "arm*-*-pe" setup_xfail "*-*-mingw*" setup_xfail "*-*-cygwin*" + setup_xfail "*-*-msys*" fail $test1 } diff --git binutils-2.28.orig/binutils/testsuite/binutils-all/windres/windres.exp binutils-2.28/binutils/testsuite/binutils-all/windres/windres.exp index c756283..5dfa1d4 100644 --- binutils-2.28.orig/binutils/testsuite/binutils-all/windres/windres.exp +++ binutils-2.28/binutils/testsuite/binutils-all/windres/windres.exp @@ -19,7 +19,7 @@ # Written by DJ Delorie -if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] && ![istarget "x86_64-*-cygwin"] } { +if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] && ![istarget "x86_64-*-cygwin"] && ![istarget "x86_64-*-msys"] } { verbose "Not a Cygwin/Mingw target" 1 return } diff --git binutils-2.28.orig/binutils/testsuite/lib/binutils-common.exp binutils-2.28/binutils/testsuite/lib/binutils-common.exp index 327db46..df26bfe 100644 --- binutils-2.28.orig/binutils/testsuite/lib/binutils-common.exp +++ binutils-2.28/binutils/testsuite/lib/binutils-common.exp @@ -129,6 +129,7 @@ proc is_aout_format {} { proc is_pecoff_format {} { if { ![istarget *-*-mingw*] && ![istarget *-*-cygwin*] + && ![istarget *-*-msys*] && ![istarget *-*-cegcc*] && ![istarget *-*-pe*] } { return 0 diff --git binutils-2.28.orig/binutils/testsuite/lib/utils-lib.exp binutils-2.28/binutils/testsuite/lib/utils-lib.exp index 61f98e1..f518b22 100644 --- binutils-2.28.orig/binutils/testsuite/lib/utils-lib.exp +++ binutils-2.28/binutils/testsuite/lib/utils-lib.exp @@ -137,7 +137,7 @@ proc default_binutils_assemble_flags { source object asflags } { # Returns target executable extension, if any. # proc exe_ext {} { - if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } { + if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] || [istarget *-*-msys*] } { return ".exe" } else { return "" diff --git binutils-2.28.orig/compile binutils-2.28/compile index a85b723..e88d733 100755 --- binutils-2.28.orig/compile +++ binutils-2.28/compile @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys*/) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff --git binutils-2.28.orig/config/dfp.m4 binutils-2.28/config/dfp.m4 index 5b29089..b03bcf0 100644 --- binutils-2.28.orig/config/dfp.m4 +++ binutils-2.28/config/dfp.m4 @@ -23,7 +23,8 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;; powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \ i?86*-*-elfiamcu | i?86*-*-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 --git binutils-2.28.orig/config/elf.m4 binutils-2.28/config/elf.m4 index 1772a44..2908ffa 100644 --- binutils-2.28.orig/config/elf.m4 +++ binutils-2.28/config/elf.m4 @@ -15,7 +15,7 @@ AC_REQUIRE([AC_CANONICAL_TARGET]) 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 --git binutils-2.28.orig/config/lthostflags.m4 binutils-2.28/config/lthostflags.m4 index bc0f59e..ad977d4 100644 --- binutils-2.28.orig/config/lthostflags.m4 +++ binutils-2.28/config/lthostflags.m4 @@ -13,7 +13,7 @@ AC_DEFUN([ACX_LT_HOST_FLAGS], [ 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 --git binutils-2.28.orig/config/mmap.m4 binutils-2.28/config/mmap.m4 index fba0d9d..df2c778 100644 --- binutils-2.28.orig/config/mmap.m4 +++ binutils-2.28/config/mmap.m4 @@ -42,7 +42,7 @@ else # 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 @@ else # 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 --git binutils-2.28.orig/config/picflag.m4 binutils-2.28/config/picflag.m4 index 2f5b972..997021a 100644 --- binutils-2.28.orig/config/picflag.m4 +++ binutils-2.28/config/picflag.m4 @@ -25,6 +25,8 @@ case "${$2}" in ;; 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 --git binutils-2.28.orig/config/tcl.m4 binutils-2.28/config/tcl.m4 index 4542a4b..209bd8d 100644 --- binutils-2.28.orig/config/tcl.m4 +++ binutils-2.28/config/tcl.m4 @@ -33,7 +33,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ # 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 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ # 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 diff --git binutils-2.28.orig/config.guess binutils-2.28/config.guess index 2e9ad7f..3b7a9c7 100755 --- binutils-2.28.orig/config.guess +++ binutils-2.28/config.guess @@ -891,6 +891,9 @@ EOF amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; + amd64:MSYS*:*:* | x86_64:MSYS*:*:*) + echo x86_64-unknown-msys + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; diff --git binutils-2.28.orig/config.rpath binutils-2.28/config.rpath index 4dea759..4f12c27 100755 --- binutils-2.28.orig/config.rpath +++ binutils-2.28/config.rpath @@ -109,7 +109,7 @@ hardcode_direct=no 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 @@ if test "$with_gnu_ld" = yes; then 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 @@ else ;; 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 @@ case "$host_os" in ;; bsdi4*) ;; - cygwin* | mingw* | pw32*) + cygwin* | msys* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) diff --git binutils-2.28.orig/configure binutils-2.28/configure index f6d12b8..5037ecb 100755 --- binutils-2.28.orig/configure +++ binutils-2.28/configure @@ -3036,7 +3036,7 @@ fi # Configure extra directories which are host specific case "${host}" in - *-cygwin*) + *-cygwin* | *-msys*) configdirs="$configdirs libtermcap" ;; esac @@ -3556,7 +3556,7 @@ esac # 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* | *-*-aix*) +*-*-darwin* | *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-aix*) unsupported_languages="$unsupported_languages go" ;; esac @@ -3569,7 +3569,7 @@ if test x$enable_libgo = x; then # PR 46986 noconfigdirs="$noconfigdirs target-libgo" ;; - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) noconfigdirs="$noconfigdirs target-libgo" ;; *-*-aix*) @@ -3843,7 +3843,7 @@ case "${target}" in 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. @@ -3987,7 +3987,7 @@ case "${host}" in 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; } @@ -6138,7 +6138,7 @@ fi 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) @@ -6156,7 +6156,7 @@ if test $target_elf = yes; then : else if test x"$default_enable_lto" = x"yes" ; then case $target in - *-apple-darwin9* | *-cygwin* | *-mingw* | *djgpp*) ;; + *-apple-darwin9* | *-cygwin* | *-msys* | *-mingw* | *djgpp*) ;; # On other non-ELF platforms, LTO has yet to be validated. *) enable_lto=no ;; esac @@ -6167,7 +6167,7 @@ else # 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 @@ -6177,7 +6177,7 @@ else # 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 @@ -7048,7 +7048,7 @@ rm -f conftest* 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 @@ -7556,7 +7556,7 @@ case " $target_configdirs " in 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 --git binutils-2.28.orig/configure.ac binutils-2.28/configure.ac index 7a87f17..6df32d3 100644 --- binutils-2.28.orig/configure.ac +++ binutils-2.28/configure.ac @@ -409,7 +409,7 @@ AC_ARG_ENABLE(compressed_debug_sections, # Configure extra directories which are host specific case "${host}" in - *-cygwin*) + *-cygwin* | *-msys*) configdirs="$configdirs libtermcap" ;; esac @@ -892,7 +892,7 @@ esac # 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* | *-*-aix*) +*-*-darwin* | *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-aix*) unsupported_languages="$unsupported_languages go" ;; esac @@ -905,7 +905,7 @@ if test x$enable_libgo = x; then # PR 46986 noconfigdirs="$noconfigdirs target-libgo" ;; - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) noconfigdirs="$noconfigdirs target-libgo" ;; *-*-aix*) @@ -1179,7 +1179,7 @@ case "${target}" in 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. @@ -1323,7 +1323,7 @@ case "${host}" in i[[3456789]]86-*-msdosdjgpp*) host_makefile_frag="config/mh-djgpp" ;; - *-cygwin*) + *-cygwin* | *-msys*) ACX_CHECK_CYGWIN_CAT_WORKS host_makefile_frag="config/mh-cygwin" ;; @@ -1817,7 +1817,7 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always. build_lto_plugin=yes ],[if test x"$default_enable_lto" = x"yes" ; then case $target in - *-apple-darwin9* | *-cygwin* | *-mingw* | *djgpp*) ;; + *-apple-darwin9* | *-cygwin* | *-msys* | *-mingw* | *djgpp*) ;; # On other non-ELF platforms, LTO has yet to be validated. *) enable_lto=no ;; esac @@ -1828,7 +1828,7 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always. # 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 @@ -1838,7 +1838,7 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always. # 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 ]) @@ -2652,7 +2652,7 @@ rm -f conftest* 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 @@ -3155,7 +3155,7 @@ case " $target_configdirs " in 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 --git binutils-2.28.orig/gas/configure binutils-2.28/gas/configure index ce7091e..ea823a8 100755 --- binutils-2.28.orig/gas/configure +++ binutils-2.28/gas/configure @@ -5525,7 +5525,7 @@ else 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, @@ -5867,7 +5867,7 @@ bsdi[45]*) 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' @@ -6447,7 +6447,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8062,7 +8062,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -8144,7 +8144,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -8606,7 +8606,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -8721,7 +8721,7 @@ _LT_EOF 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' @@ -9152,7 +9152,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -10053,14 +10053,14 @@ bsdi[45]*) # 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}`~ @@ -10084,6 +10084,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -10720,7 +10726,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -13939,7 +13945,7 @@ case "${need_libm}" in 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*) @@ -14531,7 +14537,7 @@ _ACEOF case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; diff --git binutils-2.28.orig/gas/configure.tgt binutils-2.28/gas/configure.tgt index 711d537..b641c46 100644 --- binutils-2.28.orig/gas/configure.tgt +++ binutils-2.28/gas/configure.tgt @@ -272,7 +272,7 @@ case ${generic_target} in 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 --git binutils-2.28.orig/gas/testsuite/gas/all/gas.exp binutils-2.28/gas/testsuite/gas/all/gas.exp index 8f97ed8..e0663e3 100644 --- binutils-2.28.orig/gas/testsuite/gas/all/gas.exp +++ binutils-2.28/gas/testsuite/gas/all/gas.exp @@ -173,8 +173,8 @@ case $target_triplet in { # 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" @@ -328,6 +328,7 @@ if { ([istarget *-*-coff*] && ![istarget arm*-*-coff] && ![istarget *c4x*-*-co || [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*] \ @@ -376,6 +377,7 @@ case $target_triplet in { 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 --git binutils-2.28.orig/gas/testsuite/gas/i386/i386.exp binutils-2.28/gas/testsuite/gas/i386/i386.exp index 10fe71c..c04eb63 100644 --- binutils-2.28.orig/gas/testsuite/gas/i386/i386.exp +++ binutils-2.28/gas/testsuite/gas/i386/i386.exp @@ -461,7 +461,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] # This is a PE specific test. if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"] - || [istarget "*-*-mingw*"] + || [istarget "*-*-mingw*"] || [istarget "*-*-msys*"] } then { run_dump_test "secrel" } diff --git binutils-2.28.orig/gprof/configure binutils-2.28/gprof/configure index 43e0dac..7d42d48 100755 --- binutils-2.28.orig/gprof/configure +++ binutils-2.28/gprof/configure @@ -5440,7 +5440,7 @@ else 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, @@ -5782,7 +5782,7 @@ bsdi[45]*) 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' @@ -6362,7 +6362,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7977,7 +7977,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -8059,7 +8059,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -8521,7 +8521,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -8636,7 +8636,7 @@ _LT_EOF 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' @@ -9067,7 +9067,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -9968,14 +9968,14 @@ bsdi[45]*) # 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}`~ @@ -9999,6 +9999,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -10635,7 +10641,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; diff --git binutils-2.28.orig/ld/configure binutils-2.28/ld/configure index 36af969..830e765 100755 --- binutils-2.28.orig/ld/configure +++ binutils-2.28/ld/configure @@ -6261,7 +6261,7 @@ else 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, @@ -6603,7 +6603,7 @@ bsdi[45]*) 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' @@ -7183,7 +7183,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8799,7 +8799,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -8881,7 +8881,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -9343,7 +9343,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -9458,7 +9458,7 @@ _LT_EOF 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' @@ -9889,7 +9889,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -10790,14 +10790,14 @@ bsdi[45]*) # 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}`~ @@ -10821,6 +10821,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -11457,7 +11463,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -12679,7 +12685,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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' @@ -13648,7 +13654,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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 @@ -14188,7 +14194,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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' ;; *) @@ -14452,14 +14458,14 @@ bsdi[45]*) # 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}`~ @@ -14482,6 +14488,11 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -16959,7 +16970,7 @@ fi case "${host}" in -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-msys* | *-*-windows*) $as_echo "#define USE_BINARY_FOPEN 1" >>confdefs.h ;; diff --git binutils-2.28.orig/ld/configure.host binutils-2.28/ld/configure.host index 7632793..7c632aa 100644 --- binutils-2.28.orig/ld/configure.host +++ binutils-2.28/ld/configure.host @@ -175,6 +175,10 @@ i[3-7]86-pc-interix*) i[3-7]86-*-cygwin* | x86_64-*-cygwin*) HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' ;; + +i[3-7]86-*-msys* | x86_64-*-msys*) + HOSTING_LIBS="$HOSTING_LIBS"' -lmsys-2.0 -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' + ;; i[3-7]86-*-mingw*) #We only support msvcrt.dll, crtid == 2. diff --git binutils-2.28.orig/ld/configure.tgt binutils-2.28/ld/configure.tgt index b85c6bb..1345dfe 100644 --- binutils-2.28.orig/ld/configure.tgt +++ binutils-2.28/ld/configure.tgt @@ -358,7 +358,7 @@ i[3-7]86-*-winnt*) targ_emul=i386pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; i[3-7]86-*-pe) targ_emul=i386pe ; targ_extra_ofiles="deffilep.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 pe-dll.o" ; test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; i[3-7]86-*-mingw32*) targ_emul=i386pe ; @@ -366,7 +366,7 @@ i[3-7]86-*-mingw32*) targ_emul=i386pe ; x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ; targ_extra_emuls=i386pe ; targ_extra_ofiles="deffilep.o pep-dll.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 pep-dll.o pe-dll.o" test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; @@ -676,7 +676,7 @@ powerpcle-*-nto*) targ_emul=elf32lppcnto ;; powerpc-*-rtems*) targ_emul=elf32ppc ;; powerpc-*-macos*) targ_emul=ppcmacos ;; powerpc-*-netware*) targ_emul=ppcnw ;; -powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) +powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin* | powerpcle-*-msys*) targ_emul=ppcpe targ_extra_ofiles="deffilep.o pe-dll.o" ;; powerpc-*-aix[5-9]*) targ_emul=aix5ppc ;; @@ -917,6 +917,10 @@ i[03-9x]86-*-cygwin* | x86_64-*-cygwin*) NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api' ;; +i[03-9x]86-*-msys* | x86_64-*-msys*) + NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api' + ;; + *-*-linux*) ;; diff --git binutils-2.28.orig/ld/emultempl/pe.em binutils-2.28/ld/emultempl/pe.em index 8f41f27..a951862 100644 --- binutils-2.28.orig/ld/emultempl/pe.em +++ binutils-2.28/ld/emultempl/pe.em @@ -176,7 +176,7 @@ EOF # 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 --git binutils-2.28.orig/ld/emultempl/pep.em binutils-2.28/ld/emultempl/pep.em index 8c7ed88..a8e1b83 100644 --- binutils-2.28.orig/ld/emultempl/pep.em +++ binutils-2.28/ld/emultempl/pep.em @@ -7,7 +7,7 @@ else fi case ${target} in - *-*-cygwin*) + *-*-cygwin* | *-*-msys*) move_default_addr_high=1 ;; *) diff --git binutils-2.28.orig/ld/pe-dll.c binutils-2.28/ld/pe-dll.c index ac7c70c..69b4a2f 100644 --- binutils-2.28.orig/ld/pe-dll.c +++ binutils-2.28/ld/pe-dll.c @@ -207,6 +207,7 @@ static const autofilter_entry_type autofilter_symbollist_i386[] = { 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_x86_64 { STRING_COMMA_LEN ("DllMain") }, { STRING_COMMA_LEN ("DllEntryPoint") }, @@ -214,6 +215,9 @@ static const autofilter_entry_type autofilter_symbollist_i386[] = { 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") }, @@ -222,6 +226,10 @@ static const autofilter_entry_type autofilter_symbollist_i386[] = { 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") }, @@ -324,6 +332,7 @@ static const autofilter_entry_type autofilter_liblist[] = { { 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 --git binutils-2.28.orig/ld/testsuite/ld-auto-import/auto-import.exp binutils-2.28/ld/testsuite/ld-auto-import/auto-import.exp index f11c9ef..0715b8b 100644 --- binutils-2.28.orig/ld/testsuite/ld-auto-import/auto-import.exp +++ binutils-2.28/ld/testsuite/ld-auto-import/auto-import.exp @@ -56,7 +56,8 @@ if ![isnative] then {return} # This test can only be run on a couple of platforms. # Square bracket expressions seem to confuse istarget. -if { ![istarget *-pc-cygwin] +if { ![istarget *-pc-cygwin] + && ![istarget *-pc-msys] && ![istarget *-pc-mingw*] } { return } @@ -113,17 +114,26 @@ proc ld_special_link { ld target objects } { set tmpdir tmpdir set SHCFLAG "" -if [istarget *-pc-cygwin] { +if [istarget *-pc-cygwin || istarget *-pc-msys] { # Set some libs needed for cygwin. + if [istarget *-pc-cygwin] { set MYLIBS "-L/usr/lib -lcygwin -L/usr/lib/w32api -lkernel32" - + } else { + 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 [istarget *-pc-cygwin] { 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" } + } else { + if ![ld_special_link "$ld -shared --enable-auto-import -e __msys_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 diff --git binutils-2.28.orig/ld/testsuite/ld-bootstrap/bootstrap.exp binutils-2.28/ld/testsuite/ld-bootstrap/bootstrap.exp index 726b3fe..0bbfcfc 100644 --- binutils-2.28.orig/ld/testsuite/ld-bootstrap/bootstrap.exp +++ binutils-2.28/ld/testsuite/ld-bootstrap/bootstrap.exp @@ -114,7 +114,7 @@ foreach flags $test_flags { # On Cygwin, -lintl may require -liconv when linking statically. set extralibs "" - if { [istarget "*-*-cygwin*"]} { + if { [istarget "*-*-cygwin*"] || [istarget "*-*-msys*"] } { if {"$flags" == "--static"} { set extralibs "-liconv" } @@ -191,6 +191,7 @@ foreach flags $test_flags { if {[istarget "*-*-pe"] || [istarget "*-*-wince"] || [istarget "*-*-cygwin*"] + || [istarget "*-*-msys*"] || [istarget "*-*-winnt*"] || [istarget "*-*-mingw*"] || [istarget "*-*-interix*"] diff --git binutils-2.28.orig/ld/testsuite/ld-cygwin/exe-export.exp binutils-2.28/ld/testsuite/ld-cygwin/exe-export.exp index 4643bac..ef0bff0 100644 --- binutils-2.28.orig/ld/testsuite/ld-cygwin/exe-export.exp +++ binutils-2.28/ld/testsuite/ld-cygwin/exe-export.exp @@ -1,5 +1,5 @@ # Expect script for export table in executables tests -# Copyright (C) 2003-2017 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -23,7 +23,7 @@ # # This test can only be run on a cygwin platforms. -if {![istarget *-pc-cygwin]} { +if {![istarget *-*-cygwin]} && ![istarget *-*-msys*]} { verbose "Not a cygwin target." return } diff --git binutils-2.28.orig/ld/testsuite/ld-fastcall/fastcall.exp binutils-2.28/ld/testsuite/ld-fastcall/fastcall.exp index d6184fa..275d764 100644 --- binutils-2.28.orig/ld/testsuite/ld-fastcall/fastcall.exp +++ binutils-2.28/ld/testsuite/ld-fastcall/fastcall.exp @@ -26,6 +26,7 @@ if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw*"] } { 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 --git binutils-2.28.orig/ld/testsuite/ld-pe/export_dynamic_warning.d binutils-2.28/ld/testsuite/ld-pe/export_dynamic_warning.d index 38759b7..0d3a8df 100644 --- binutils-2.28.orig/ld/testsuite/ld-pe/export_dynamic_warning.d +++ binutils-2.28/ld/testsuite/ld-pe/export_dynamic_warning.d @@ -1,5 +1,5 @@ #name: PE-COFF --export-dynamic warning -#target: *-*-mingw32 *-*-cygwin *-*-pe +#target: *-*-mingw32 *-*-cygwin *-*-msys *-*-pe #ld: --export-dynamic #warning: warning: --export-dynamic is not supported for PE\+? targets, did you mean --export-all-symbols\? diff --git binutils-2.28.orig/ld/testsuite/ld-pe/image_size.d binutils-2.28/ld/testsuite/ld-pe/image_size.d index bd709e6..8973d93 100644 --- binutils-2.28.orig/ld/testsuite/ld-pe/image_size.d +++ binutils-2.28/ld/testsuite/ld-pe/image_size.d @@ -1,7 +1,7 @@ #name: PE-COFF SizeOfImage #ld: -T image_size.t #objdump: -p -#target: *-*-mingw32 *-*-cygwin +#target: *-*-mingw32 *-*-cygwin *-*-msys .*: file format .* #... diff --git binutils-2.28.orig/ld/testsuite/ld-pe/pe-compile.exp binutils-2.28/ld/testsuite/ld-pe/pe-compile.exp index 67a63e2..7ca5162 100644 --- binutils-2.28.orig/ld/testsuite/ld-pe/pe-compile.exp +++ binutils-2.28/ld/testsuite/ld-pe/pe-compile.exp @@ -118,6 +118,7 @@ run_ver_script_test "vers-script-3" 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 --git binutils-2.28.orig/ld/testsuite/ld-pe/pe.exp binutils-2.28/ld/testsuite/ld-pe/pe.exp index 8d20056..5cf9ea5 100644 --- binutils-2.28.orig/ld/testsuite/ld-pe/pe.exp +++ binutils-2.28/ld/testsuite/ld-pe/pe.exp @@ -26,6 +26,7 @@ if {![is_pecoff_format]} { # 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 @@ if {[istarget i*86-*-cygwin*] {"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" "" "" {secrel1.s secrel2.s} {{objdump -s secrel.d}} "secrel.x"} @@ -92,7 +93,7 @@ run_ld_link_tests $pr19803_dll 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 --git binutils-2.28.orig/ld/testsuite/ld-scripts/script.exp binutils-2.28/ld/testsuite/ld-scripts/script.exp index 7a04480..b1f8b96 100644 --- binutils-2.28.orig/ld/testsuite/ld-scripts/script.exp +++ binutils-2.28/ld/testsuite/ld-scripts/script.exp @@ -163,6 +163,10 @@ proc extract_symbol_test { testfile testname } { pass $testname return } + [a-z]*-*-msys$ { + pass $testname + return + } } set extract_syms [run_host_cmd $nm $copyfile] @@ -185,6 +189,7 @@ proc extract_symbol_test { testfile testname } { set flags "" if {[istarget "*-*-pe*"] \ || [istarget "*-*-cygwin*"] \ + || [istarget "*-*-msys*"] \ || [istarget "*-*-mingw*"] \ || [istarget "*-*-winnt*"] \ || [istarget "*-*-nt"] \ diff --git binutils-2.28.orig/ld/testsuite/ld-srec/srec.exp binutils-2.28/ld/testsuite/ld-srec/srec.exp index 49b844c..de3c929 100644 --- binutils-2.28.orig/ld/testsuite/ld-srec/srec.exp +++ binutils-2.28/ld/testsuite/ld-srec/srec.exp @@ -401,7 +401,7 @@ setup_xfail "ia64-*-*" # The S-record linker doesn't support the special PE headers - the PE # emulation tries to write pe-specific information to the PE headers # in the output bfd, but it's not a PE bfd (it's an srec bfd) -setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*" +setup_xfail "*-*-cygwin*" "*-*-msys*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*" setup_xfail "score-*-*" # The S-record linker doesn't support Blackfin ELF FDPIC ABI. @@ -445,7 +445,7 @@ setup_xfail "alpha*-*-elf*" "alpha*-*-linux-*" "alpha*-*-gnu*" setup_xfail "alpha*-*-netbsd*" setup_xfail "hppa*-*-*" "mep-*-*" setup_xfail "ia64-*-*" -setup_xfail "*-*-cygwin*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*" +setup_xfail "*-*-cygwin*" "*-*-msys*" "*-*-mingw*" "*-*-pe*" "*-*-winnt*" setup_xfail "score-*-*" setup_xfail "bfin-*-linux-uclibc" setup_xfail "tile*-*-*" diff --git binutils-2.28.orig/ld/testsuite/lib/ld-lib.exp binutils-2.28/ld/testsuite/lib/ld-lib.exp index cf7886b..770b7e1 100644 --- binutils-2.28.orig/ld/testsuite/lib/ld-lib.exp +++ binutils-2.28/ld/testsuite/lib/ld-lib.exp @@ -419,7 +419,7 @@ proc ld_simple_link_defsyms {} { } # Windows targets need __main, some prefixed with underscore. - if {[istarget *-*-cygwin* ] || [istarget *-*-mingw*]} { + if {[istarget *-*-cygwin* ] || [istarget *-*-mingw*] || [istarget *-*-msys*]} { append flags " --defsym __main=0 --defsym ___main=0" } diff --git binutils-2.28.orig/libiberty/configure binutils-2.28/libiberty/configure index b95e000..7dd261a 100755 --- binutils-2.28.orig/libiberty/configure +++ binutils-2.28/libiberty/configure @@ -5110,6 +5110,8 @@ case "${host}" in ;; 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]*) @@ -6175,7 +6177,7 @@ fi 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 --git binutils-2.28.orig/libiberty/configure.ac binutils-2.28/libiberty/configure.ac index 1aa0c7c..88b980f 100644 --- binutils-2.28.orig/libiberty/configure.ac +++ binutils-2.28/libiberty/configure.ac @@ -550,7 +550,7 @@ AC_SUBST(CHECK) AC_SUBST(target_header_dir) case "${host}" in - *-*-cygwin* | *-*-mingw*) + *-*-cygwin* | *-*-msys* | *-*-mingw*) AC_DEFINE(HAVE_SYS_ERRLIST) AC_DEFINE(HAVE_SYS_NERR) ;; diff --git binutils-2.28.orig/libtool.m4 binutils-2.28/libtool.m4 index 24d13f3..9a37fd7 100644 --- binutils-2.28.orig/libtool.m4 +++ binutils-2.28/libtool.m4 @@ -1491,7 +1491,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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, @@ -1733,7 +1733,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -2204,14 +2204,14 @@ bsdi[[45]]*) # 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}`~ @@ -2235,6 +2235,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -3001,7 +3007,7 @@ bsdi[[45]]*) 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' @@ -3285,7 +3291,7 @@ AC_DEFUN([LT_LIB_M], [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*) @@ -3360,7 +3366,7 @@ case $host_os in aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -3607,7 +3613,7 @@ m4_if([$1], [CXX], [ 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 @@ -3920,7 +3926,7 @@ m4_if([$1], [CXX], [ # 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 @@ -4003,7 +4009,7 @@ m4_if([$1], [CXX], [ 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], [], @@ -4236,7 +4242,7 @@ m4_if([$1], [CXX], [ 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' ;; *) @@ -4288,7 +4294,7 @@ dnl Note also adjust exclude_expsyms for C++ above. 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++. @@ -4403,7 +4409,7 @@ _LT_EOF 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' @@ -4776,7 +4782,7 @@ _LT_EOF _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 @@ -5720,7 +5726,7 @@ if test "$_lt_caught_CXX_error" != yes; then 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 --git binutils-2.28.orig/ltmain.sh binutils-2.28/ltmain.sh index 9503ec8..fe39d14 100644 --- binutils-2.28.orig/ltmain.sh +++ binutils-2.28/ltmain.sh @@ -976,7 +976,7 @@ func_enable_tag () 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 @@ func_mode_compile () # 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 @@ func_mode_install () '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 @@ func_mode_install () # 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 @@ func_mode_install () # 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 @@ extern \"C\" { $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 @@ extern \"C\" { $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 @@ typedef struct { } 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 @@ static const void *lt_preloaded_setup() { # 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 () 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 @@ func_to_host_pathlist () ( 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 @@ main (int argc, char *argv[]) { EOF case "$host" in - *mingw* | *cygwin* ) + *mingw* | *cygwin* | *msys*) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; @@ -4233,7 +4233,7 @@ func_mode_link () { $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 @@ func_mode_link () ;; 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 @@ func_mode_link () -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 @@ func_mode_link () -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 @@ func_mode_link () 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 @@ func_mode_link () 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 @@ func_mode_link () 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 @@ EOF 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 @@ EOF 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 @@ EOF 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 @@ EOF # 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 @@ EOF 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 @@ EOF # 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 --git binutils-2.28.orig/ltoptions.m4 binutils-2.28/ltoptions.m4 index 5ef12ce..5e7bc34 100644 --- binutils-2.28.orig/ltoptions.m4 +++ binutils-2.28/ltoptions.m4 @@ -126,7 +126,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [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) diff --git binutils-2.28.orig/opcodes/configure binutils-2.28/opcodes/configure index be87eb2..4061e80 100755 --- binutils-2.28.orig/opcodes/configure +++ binutils-2.28/opcodes/configure @@ -5719,7 +5719,7 @@ else 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, @@ -6061,7 +6061,7 @@ bsdi[45]*) 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' @@ -6641,7 +6641,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -8226,7 +8226,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -8308,7 +8308,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -8770,7 +8770,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -8885,7 +8885,7 @@ _LT_EOF 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' @@ -9316,7 +9316,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -10217,14 +10217,14 @@ bsdi[45]*) # 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}`~ @@ -10248,6 +10248,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -10884,7 +10890,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; @@ -12381,7 +12387,7 @@ $as_echo "$bfd_cv_ld_as_needed" >&6; } 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*) @@ -12551,6 +12557,10 @@ if test "$enable_shared" = "yes"; then SHARED_LDFLAGS="-no-undefined" SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" ;; + *-*-msys*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lmsys-2.0" + ;; *-*-darwin*) SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" SHARED_DEPENDENCIES="../bfd/libbfd.la" diff --git binutils-2.28.orig/zlib/configure binutils-2.28/zlib/configure index bed9e3e..981719b 100755 --- binutils-2.28.orig/zlib/configure +++ binutils-2.28/zlib/configure @@ -4644,7 +4644,7 @@ else 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, @@ -4986,7 +4986,7 @@ bsdi[45]*) 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' @@ -5566,7 +5566,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | msys* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -7456,7 +7456,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # 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 @@ -7538,7 +7538,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } 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' @@ -8000,7 +8000,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie 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++. @@ -8115,7 +8115,7 @@ _LT_EOF 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' @@ -8552,7 +8552,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 @@ -9456,14 +9456,14 @@ bsdi[45]*) # 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}`~ @@ -9487,6 +9487,12 @@ cygwin* | mingw* | pw32* | cegcc*) 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}' @@ -10126,7 +10132,7 @@ else lt_cv_dlopen_libs= ;; - cygwin*) + cygwin* | msys*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;;