Patchwork : Add configure and required host/target definitions for new cygwin x64 target

login
register
mail settings
Submitter Kai Tietz
Date March 22, 2013, 9:56 a.m.
Message ID <CAEwic4bW=GNvCEfhPmguH7xOdNts_WcBu5+GZoiZpwZ+SYv+OQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/229953/
State New
Headers show

Comments

Kai Tietz - March 22, 2013, 9:56 a.m.
Hi,

this patch adds required configure changes for new cygwin x64 target.

ChangeLog gcc/

	* config.build: Add support for cygwin x64 target.
	* config.gcc: Likewise.
	* config.host: Likewise.
	* configure.ac: Likewise
	* configure: Regenerated.

ChangeLog config/
	* dfp.m4: Add support for cygwin x64 target.
	* picflag.m4: Likewise.

ChangeLog libstdc++-v3/

	* crossconfig.m4: Add support for cygwin x64 target.
	* configure: Regenerated.

ChangeLog libgcc/

	* config.host: Add support for cygwin x64 target.
	* configure: Regenerated.

ChangeLog libiberty/

	* configure: Regenerated.

ChangeLog libada/

	* configure: Regenerated.

ChangeLog libdecnumber/

	* configure: Regenerated.

Tested for i686-pc-cygwin, x86_64-pc-cygwin, and x86_64-w64-mingw32.
Ok for apply?

Regards,
Kai

t-dfprules i386/t-chkstk"
+	;;
 i[34567]86-*-mingw*)
 	extra_parts="crtbegin.o crtend.o crtfastmath.o"
 	case ${target_thread_file} in
@@ -589,7 +606,7 @@ i[34567]86-*-mingw*)
 		md_unwind_header=i386/w32-unwind.h
 	fi
 	# Shared libgcc DLL install dir depends on cross/native build.
-	if test x${build} = x${host} ; then
+	if test x${host} = x${target} ; then
 		tmake_dlldir_file="i386/t-dlldir"
 	else
 		tmake_dlldir_file="i386/t-dlldir-x"
@@ -1143,7 +1160,8 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \
   i[34567]86-*-linux* | x86_64-*-linux* | \
   i[34567]86-*-gnu* | \
   i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \
-  i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw* | \
+  i[34567]86-*-cygwin* | x86_64-*-cygwin* | \
+  i[34567]86-*-mingw* | x86_64-*-mingw* | \
   i[34567]86-*-freebsd* | x86_64-*-freebsd* | \
   i[34567]86-*-openbsd* | x86_64-*-openbsd*)
   	tmake_file="${tmake_file} t-softfp-tf"
Dave Korn - March 23, 2013, 12:29 a.m.
On 22/03/2013 09:56, Kai Tietz wrote:
> Hi,
> 
> this patch adds required configure changes for new cygwin x64 target.

> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac	(Revision 196898)
> +++ gcc/configure.ac	(Arbeitskopie)
> @@ -3623,7 +3623,7 @@ changequote([,])dnl
>  	# wrappers to aid in interposing and redirecting operators new, delete,
>  	# etc., as per n2800 #17.6.4.6 [replacement.functions].  Check if we
>  	# are configuring for a version of Cygwin that exports the wrappers.
> -	if test x$host = x$target; then
> +	if test x$host = x$target && test x$host_cpu = xi686; then
>  	  AC_CHECK_FUNC([__wrap__Znaj],[gcc_ac_cygwin_dll_wrappers=yes],[gcc_ac_cygwin_dll_wrappers=no])
>  	else
>  	  # Can't check presence of libc functions during cross-compile, so

  Rather than just bailing on x86_64, shouldn't this code check for the
presence of one of the 64-bit versions of the C++ wrapper functions such as
__wrap__Znam instead?

> Index: libgcc/config.host
> ===================================================================
> --- libgcc/config.host	(Revision 196898)
> +++ libgcc/config.host	(Arbeitskopie)
> @@ -564,13 +564,30 @@ i[34567]86-*-cygwin*)
>  		tmake_eh_file="i386/t-dw2-eh"
>  	fi
>  	# Shared libgcc DLL install dir depends on cross/native build.
> -	if test x${build} = x${host} ; then
> +	if test x${host} = x${target} ; then

  I don't get this.  We're compiling a target library, so only build and host
are correct to use, AIUI; $target may still be set by accident, but it's not
meaningful when building a target lib.

>  	# Shared libgcc DLL install dir depends on cross/native build.
> -	if test x${build} = x${host} ; then
> +	if test x${host} = x${target} ; then

  Same here.

    cheers,
      DaveK
Kai Tietz - March 23, 2013, 12:41 a.m.
2013/3/23 Dave Korn <dave.korn.cygwin@gmail.com>:
> On 22/03/2013 09:56, Kai Tietz wrote:
>> Hi,
>>
>> this patch adds required configure changes for new cygwin x64 target.
>
>> Index: gcc/configure.ac
>> ===================================================================
>> --- gcc/configure.ac  (Revision 196898)
>> +++ gcc/configure.ac  (Arbeitskopie)
>> @@ -3623,7 +3623,7 @@ changequote([,])dnl
>>       # wrappers to aid in interposing and redirecting operators new, delete,
>>       # etc., as per n2800 #17.6.4.6 [replacement.functions].  Check if we
>>       # are configuring for a version of Cygwin that exports the wrappers.
>> -     if test x$host = x$target; then
>> +     if test x$host = x$target && test x$host_cpu = xi686; then
>>         AC_CHECK_FUNC([__wrap__Znaj],[gcc_ac_cygwin_dll_wrappers=yes],[gcc_ac_cygwin_dll_wrappers=no])
>>       else
>>         # Can't check presence of libc functions during cross-compile, so
>
>   Rather than just bailing on x86_64, shouldn't this code check for the
> presence of one of the 64-bit versions of the C++ wrapper functions such as
> __wrap__Znam instead?

Sure, this should be a follow-up patch.  For now we should get initial
version into repository.  There are some other places we need to visit
later, too.

>> Index: libgcc/config.host
>> ===================================================================
>> --- libgcc/config.host        (Revision 196898)
>> +++ libgcc/config.host        (Arbeitskopie)
>> @@ -564,13 +564,30 @@ i[34567]86-*-cygwin*)
>>               tmake_eh_file="i386/t-dw2-eh"
>>       fi
>>       # Shared libgcc DLL install dir depends on cross/native build.
>> -     if test x${build} = x${host} ; then
>> +     if test x${host} = x${target} ; then
>
>   I don't get this.  We're compiling a target library, so only build and host
> are correct to use, AIUI; $target may still be set by accident, but it's not
> meaningful when building a target lib.

Well, I think the idea here was that cygwin installs anyway
(especially for candian-cross AFAIR) into native (bin/) location.
That's a kludge.

Actual the x64 mingw hunk is wrong, and I notice that for 32-bit
default mingw we install for cross into wrong location.

>>       # Shared libgcc DLL install dir depends on cross/native build.
>> -     if test x${build} = x${host} ; then
>> +     if test x${host} = x${target} ; then
>
>   Same here.
>
>     cheers,
>       DaveK
>

Cheers,
Kai
Dave Korn - March 23, 2013, 1:10 a.m.
On 23/03/2013 00:41, Kai Tietz wrote:
> 2013/3/23 Dave Korn <dave.korn.cygwin@gmail.com>:
>> On 22/03/2013 09:56, Kai Tietz wrote:
>>> Hi,
>>>
>>> this patch adds required configure changes for new cygwin x64 target.
>>> Index: gcc/configure.ac
>>> ===================================================================
>>> --- gcc/configure.ac  (Revision 196898)
>>> +++ gcc/configure.ac  (Arbeitskopie)
>>> @@ -3623,7 +3623,7 @@ changequote([,])dnl
>>>       # wrappers to aid in interposing and redirecting operators new, delete,
>>>       # etc., as per n2800 #17.6.4.6 [replacement.functions].  Check if we
>>>       # are configuring for a version of Cygwin that exports the wrappers.
>>> -     if test x$host = x$target; then
>>> +     if test x$host = x$target && test x$host_cpu = xi686; then
>>>         AC_CHECK_FUNC([__wrap__Znaj],[gcc_ac_cygwin_dll_wrappers=yes],[gcc_ac_cygwin_dll_wrappers=no])
>>>       else
>>>         # Can't check presence of libc functions during cross-compile, so
>>   Rather than just bailing on x86_64, shouldn't this code check for the
>> presence of one of the 64-bit versions of the C++ wrapper functions such as
>> __wrap__Znam instead?
> 
> Sure, this should be a follow-up patch.  For now we should get initial
> version into repository.  There are some other places we need to visit
> later, too.

  Ok, fair enough.

>>> Index: libgcc/config.host
>>> ===================================================================
>>> --- libgcc/config.host        (Revision 196898)
>>> +++ libgcc/config.host        (Arbeitskopie)
>>> @@ -564,13 +564,30 @@ i[34567]86-*-cygwin*)
>>>               tmake_eh_file="i386/t-dw2-eh"
>>>       fi
>>>       # Shared libgcc DLL install dir depends on cross/native build.
>>> -     if test x${build} = x${host} ; then
>>> +     if test x${host} = x${target} ; then
>>   I don't get this.  We're compiling a target library, so only build and host
>> are correct to use, AIUI; $target may still be set by accident, but it's not
>> meaningful when building a target lib.
> 
> Well, I think the idea here was that cygwin installs anyway
> (especially for candian-cross AFAIR) into native (bin/) location.
> That's a kludge.

  Eh?  The whole point of this bit is to avoid installing into the native
location in any kind of cross build.  This was the fix for PR40125; the libgcc
equivalent of $srcdir/config/lthostflags.m4.

    cheers,
      DaveK

Patch

Index: gcc/config.build
===================================================================
--- gcc/config.build	(Revision 196898)
+++ gcc/config.build	(Arbeitskopie)
@@ -60,7 +60,7 @@  case $build in
     # IBM 360/370/390 Architecture
     build_xm_defines='FATAL_EXIT_CODE=12'
     ;;
-  i[34567]86-*-cygwin* )
+  i[34567]86-*-cygwin* | x86_64-*-cygwin* )
     build_xm_file=i386/xm-cygwin.h
     build_exeext=.exe
     ;;
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(Revision 196898)
+++ gcc/config.gcc	(Arbeitskopie)
@@ -1452,6 +1452,22 @@  i[34567]86-*-cygwin*)
 	fi
 	use_gcc_stdint=wrap
 	;;
+x86_64-*-cygwin*)
+	need_64bit_isa=yes
+	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h
i386/cygming.h i386/cygwin.h i386/cygwin-w64.h i386/cygwin-stdint.h"
+	xm_file=i386/xm-cygwin.h
+	tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
+	target_gtfiles="\$(srcdir)/config/i386/winnt.c"
+	extra_options="${extra_options} i386/cygming.opt"
+	extra_objs="winnt.o winnt-stubs.o"
+	c_target_objs="${c_target_objs} msformat-c.o"
+	cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
+	if test x$enable_threads = xyes; then
+		thread_file='posix'
+	fi
+	use_gcc_stdint=wrap
+	tm_defines="${tm_defines} TARGET_CYGWIN64=1"
+	;;
 i[34567]86-*-mingw* | x86_64-*-mingw*)
 	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h
i386/cygming.h"
 	xm_file=i386/xm-mingw32.h
Index: gcc/config.host
===================================================================
--- gcc/config.host	(Revision 196898)
+++ gcc/config.host	(Arbeitskopie)
@@ -214,7 +214,7 @@  case ${host} in
         ;;
     esac
     ;;
-  i[34567]86-*-cygwin*)
+  i[34567]86-*-cygwin* | x86_64-*-cygwin*)
     host_xm_file=i386/xm-cygwin.h
     out_host_hook_obj=host-cygwin.o
     host_xmake_file="${host_xmake_file} i386/x-cygwin"
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(Revision 196898)
+++ gcc/configure.ac	(Arbeitskopie)
@@ -3623,7 +3623,7 @@  changequote([,])dnl
 	# wrappers to aid in interposing and redirecting operators new, delete,
 	# etc., as per n2800 #17.6.4.6 [replacement.functions].  Check if we
 	# are configuring for a version of Cygwin that exports the wrappers.
-	if test x$host = x$target; then
+	if test x$host = x$target && test x$host_cpu = xi686; then
 	  AC_CHECK_FUNC([__wrap__Znaj],[gcc_ac_cygwin_dll_wrappers=yes],[gcc_ac_cygwin_dll_wrappers=no])
 	else
 	  # Can't check presence of libc functions during cross-compile, so
Index: config/dfp.m4
===================================================================
--- config/dfp.m4	(Revision 196898)
+++ config/dfp.m4	(Arbeitskopie)
@@ -23,7 +23,7 @@  Valid choices are 'yes', 'bid', 'dpd', and 'no'.])
     powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
     i?86*-*-gnu* | \
     i?86*-*-mingw* | x86_64*-*-mingw* | \
-    i?86*-*-cygwin*)
+    i?86*-*-cygwin* | x86_64*-*-cygwin*)
       enable_decimal_float=yes
       ;;
     *)
Index: config/picflag.m4
===================================================================
--- config/picflag.m4	(Revision 196898)
+++ config/picflag.m4	(Arbeitskopie)
@@ -17,8 +17,10 @@  case "${$2}" in
     hppa*64*-*-hpux*)
 	# PIC is the default for 64-bit PA HP-UX.
 	;;
-    i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*)
+    i[[34567]]86-*-cygwin* | x86_64-*-cygwin*)
 	;;
+    i[[34567]]86-*-mingw* | x86_64-*-mingw*)
+	;;
     i[[34567]]86-*-interix[[3-9]]*)
 	# Interix 3.x gcc -fpic/-fPIC options generate broken code.
 	# Instead, we relocate shared libraries at runtime.
Index: libgcc/config.host
===================================================================
--- libgcc/config.host	(Revision 196898)
+++ libgcc/config.host	(Arbeitskopie)
@@ -564,13 +564,30 @@  i[34567]86-*-cygwin*)
 		tmake_eh_file="i386/t-dw2-eh"
 	fi
 	# Shared libgcc DLL install dir depends on cross/native build.
-	if test x${build} = x${host} ; then
+	if test x${host} = x${target} ; then
 		tmake_dlldir_file="i386/t-dlldir"
 	else
 		tmake_dlldir_file="i386/t-dlldir-x"
 	fi
 	tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file}
i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm
i386/t-chkstk t-dfprules"
 	;;
+x86_64-*-cygwin*)
+	extra_parts="crtbegin.o crtend.o crtfastmath.o"
+	# This has to match the logic for DWARF2_UNWIND_INFO in
gcc/config/i386/cygming.h
+	if test x$enable_sjlj_exceptions = xyes; then
+		tmake_eh_file="i386/t-sjlj-eh"
+	else
+		tmake_eh_file="i386/t-seh-eh"
+	fi
+	# Shared libgcc DLL install dir depends on cross/native build.
+	if test x${host} = x${target} ; then
+		tmake_dlldir_file="i386/t-dlldir"
+	else
+		tmake_dlldir_file="i386/t-dlldir-x"
+	fi
+	# FIXME - dj - t-chkstk used to be in here, need a 64-bit version of that
+	tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file}
i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm