From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: Re: Missing linking test case for pe dll using a def file
Date: Sun, 21 Aug 2022 07:57:27 +0930 [thread overview]
Message-ID: <YwFfzwU1kVrJKlIm@squeak.grove.modra.org> (raw)
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 --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 {
--
Alan Modra
Australia Development Lab, IBM
reply other threads:[~2022-08-20 22:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YwFfzwU1kVrJKlIm@squeak.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).