aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-08-20 17:21:08 +0930
committerAlan Modra <amodra@gmail.com>2022-08-21 07:53:12 +0930
commit0ade20c5688d328ea91d4822384af46d7f899cb1 (patch)
tree68d45ff345d675a4c44b44331dfdd4674c039097 /ld
parenta6ac3352ac712e5c092c72ff38d2059021d9af72 (diff)
downloadgdb-0ade20c5688d328ea91d4822384af46d7f899cb1.zip
gdb-0ade20c5688d328ea91d4822384af46d7f899cb1.tar.gz
gdb-0ade20c5688d328ea91d4822384af46d7f899cb1.tar.bz2
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.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-pe/pe-run2-def.exp22
1 files 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 ecac9b0..0f8296e 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 {