public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] Re: Missing linking test case for pe dll using a def file
@ 2022-08-20 22:26 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-08-20 22:26 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0ade20c5688d328ea91d4822384af46d7f899cb1

commit 0ade20c5688d328ea91d4822384af46d7f899cb1
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Aug 20 17:21:08 2022 +0930

    Re: Missing linking test case for pe dll using a def file
    
    Fixes this when cross-compiling from x86_64-linux
    x86_64-w64-mingw32  +FAIL: compiling shared lib fastcall/stdcall
    
            * testsuite/ld-pe/pe-run2-def.exp (test_direct2_link_dll_def):
            Use CC_FOR_TARGET and CFLAGS_FOR_TARGET rather than CC and CFLAGS.

Diff:
---
 ld/testsuite/ld-pe/pe-run2-def.exp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/ld/testsuite/ld-pe/pe-run2-def.exp b/ld/testsuite/ld-pe/pe-run2-def.exp
index ecac9b01a2b..0f8296e2e41 100644
--- a/ld/testsuite/ld-pe/pe-run2-def.exp
+++ b/ld/testsuite/ld-pe/pe-run2-def.exp
@@ -64,27 +64,27 @@ if { ![check_compiler_available] } {
 set tmpdir tmpdir
 
 proc test_direct2_link_dll_def {} {
-    global CC
-    global CFLAGS
+    global CC_FOR_TARGET
+    global CFLAGS_FOR_TARGET
     global srcdir
     global subdir
     global tmpdir
 
     # Compile the dll.
-    if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/direct2_dll.c $tmpdir/direct2_dll.o ] {
+    if ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET" $srcdir/$subdir/direct2_dll.c $tmpdir/direct2_dll.o ] {
 	fail "compiling shared lib fastcall/stdcall"
-    } elseif ![ld_link "$CC -shared -Wl,--enable-stdcall-fixup -Wl,--kill-at " $tmpdir/direct2_dll.dll "$tmpdir/direct2_dll.o $srcdir/$subdir/direct2_dll.def" ] {
+    } elseif ![ld_link "$CC_FOR_TARGET -shared -Wl,--enable-stdcall-fixup -Wl,--kill-at " $tmpdir/direct2_dll.dll "$tmpdir/direct2_dll.o $srcdir/$subdir/direct2_dll.def" ] {
 	fail "linking shared lib (.dll) fastcall/stdcall"
-    } elseif ![ld_link "$CC -shared -Wl,--enable-stdcall-fixup -Wl,--kill-at " $tmpdir/direct2_dll.sl "$tmpdir/direct2_dll.o $srcdir/$subdir/direct2_dll.def" ] {
+    } elseif ![ld_link "$CC_FOR_TARGET -shared -Wl,--enable-stdcall-fixup -Wl,--kill-at " $tmpdir/direct2_dll.sl "$tmpdir/direct2_dll.o $srcdir/$subdir/direct2_dll.def" ] {
 	fail "linking shared lib (.sl) fastcall/stdcall"
     } else {
 	# Compile and link the client program.
-	if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/direct2_client.c $tmpdir/direct2_client.o ] {
+	if ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET" $srcdir/$subdir/direct2_client.c $tmpdir/direct2_client.o ] {
 	    fail "compiling client fastcall/stdcall"
 	} else {
 	    # Check linking to import library.
 	    set msg "linking client (.dll) fastcall/stdcall"
-	    if [ld_link "$CC $CFLAGS -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_dll.exe \
+	    if [ld_link "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_dll.exe \
 	      "$tmpdir/direct2_client.o -L$tmpdir -ldirect2_dll" ] {
 		pass $msg
 	    } else {
@@ -93,7 +93,7 @@ proc test_direct2_link_dll_def {} {
 
 	    # Check linking directly to direct2_dll.dll.
 	    set msg "linking client (.dll) fastcall/stdcall"
-	    if [ld_link "$CC $CFLAGS -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_dll.exe \
+	    if [ld_link "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_dll.exe \
 	      "$tmpdir/direct2_client.o $tmpdir/direct2_dll.dll" ] {
 		pass $msg
 	    } else {
@@ -102,7 +102,7 @@ proc test_direct2_link_dll_def {} {
 
 	    # Check linking directly to direct2_dll.sl.
 	    set msg "linking client (.sl) fastcall/stdcall"
-	    if [ld_link "$CC $CFLAGS -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_sl.exe \
+	    if [ld_link "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_sl.exe \
 	      "$tmpdir/direct2_client.o $tmpdir/direct2_dll.sl" ] {
 		pass $msg
 	    } else {
@@ -113,7 +113,7 @@ proc test_direct2_link_dll_def {} {
 	    # Create symbolic link.
 	    catch "exec ln -fs direct2_dll.dll $tmpdir/libdirect2_dll.dll.a" ln_catch
 	    set msg "linking client (symlink -> .dll) fastcall/stdcall"
-	    if [ld_link "$CC $CFLAGS -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_symlink_dll.exe \
+	    if [ld_link "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_symlink_dll.exe \
 	      "$tmpdir/direct2_client.o $tmpdir/libdirect2_dll.dll.a" ] {
 	        pass $msg
 	    } else {
@@ -124,7 +124,7 @@ proc test_direct2_link_dll_def {} {
 	    # Create symbolic link.
 	    catch "exec ln -fs direct2_dll.sl $tmpdir/libdirect2_sl.dll.a" ln_catch
 	    set msg "linking client (symlink -> .sl) fastcall/stdcall"
-	    if [ld_link "$CC $CFLAGS -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_symlink_sl.exe \
+	    if [ld_link "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -Wl,--enable-stdcall-fixup -Wl,--enable-auto-import" $tmpdir/direct2_client_symlink_sl.exe \
 	      "$tmpdir/direct2_client.o $tmpdir/libdirect2_sl.dll.a" ] {
 		pass $msg
 	    } else {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-20 22:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-20 22:26 [binutils-gdb] Re: Missing linking test case for pe dll using a def file Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).