This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch binutils] Handle Win64 calling convention in ld-plugin tests
- From: Alan Modra <amodra at gmail dot com>
- To: Stephen Kitt <steve at sk2 dot org>
- Cc: binutils at sourceware dot org
- Date: Thu, 28 Aug 2014 14:50:51 +0930
- Subject: Re: [patch binutils] Handle Win64 calling convention in ld-plugin tests
- Authentication-results: sourceware.org; auth=none
- References: <20140824085956 dot 6ec58021 at sk2 dot org>
On Sun, Aug 24, 2014 at 08:59:56AM -0700, Stephen Kitt wrote:
> Hi,
>
> Currently the ld-plugin tests expect to find ___main, which fails when
> targetting Win64. (The calling convention there specifies no additional
> underscores.) The following patch adjusts the defsym in ld-lib.exp for this
> case; this allows the testsuite to pass on x86_64-w64-mingw32.
>
> Regards,
>
> Stephen
>
>
> diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
> index e4084e1..4efec65 100644
> --- a/ld/testsuite/lib/ld-lib.exp
> +++ b/ld/testsuite/lib/ld-lib.exp
> @@ -410,10 +410,14 @@ proc ld_simple_link_defsyms {} {
> append flags " --defsym __gccmain=0"
> }
>
> - # Windows targets need __main, prefixed with underscore.
> - if {[istarget *-*-cygwin* ] || [istarget *-*-mingw*]} {
> + # Windows 32-bit targets need __main, prefixed with underscore.
> + if {[istarget *-*-cygwin* ] || [istarget i*86-*-mingw*]} {
> append flags " --defsym ___main=0"
> }
> + # Windows 64-bit targets need __main, not prefixed
> + if {[istarget x86_64-*-mingw*]} {
> + append flags " --defsym __main=0"
> + }
>
> # PowerPC EABI code calls __eabi.
> if {[istarget powerpc*-*-eabi*] || [istarget powerpc*-*-rtems*]} {
I see there is a configure option --enable-leading-mingw64-underscores,
so can you check that the following works?
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index e4084e1..292a873 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -410,9 +410,9 @@ proc ld_simple_link_defsyms {} {
append flags " --defsym __gccmain=0"
}
- # Windows targets need __main, prefixed with underscore.
+ # Windows targets need __main, some prefixed with underscore.
if {[istarget *-*-cygwin* ] || [istarget *-*-mingw*]} {
- append flags " --defsym ___main=0"
+ append flags " --defsym __main=0 --defsym ___main=0"
}
# PowerPC EABI code calls __eabi.
--
Alan Modra
Australia Development Lab, IBM