* [PATCH] Revert to using target_link ind gdb.asm/asm-source.exp
@ 2004-01-19 18:59 Mark Kettenis
2004-01-19 19:15 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2004-01-19 18:59 UTC (permalink / raw)
To: gdb-patches
We have been discussing this repeatedly over the past two years. The
consensus was that using gcc to do the final link isn't appropriate
for this test. This effectively reverts the change made by Corinna in
december 2001, and will probably break the ARM and similar processors.
Adding the right defenitions to the board defenition seems the only
true way to solve the problems.
If nobody objects, I'll commit this next week or so.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.asm/asm-source.exp: Strip -Wl, from link-flags. Don't
append -static to link-flags for *-*-freebsd*, *-*netbsd* and
*-*solaris2*. Remove commented out default settings for
asm-flags. Replace gdb_compile with target_link.
Index: gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.47
diff -u -p -r1.47 asm-source.exp
--- gdb.asm/asm-source.exp 1 Jan 2004 01:13:42 -0000 1.47
+++ gdb.asm/asm-source.exp 19 Jan 2004 18:48:20 -0000
@@ -70,7 +70,7 @@ switch -glob -- [istarget] {
}
"m32r*-*" {
set asm-arch m32r
- append link-flags " -Wl,--whole-archive -lgloss -Wl,--no-whole-archive"
+ append link-flags "--whole-archive -lgloss --no-whole-archive"
}
"m6811-*-*" {
set asm-arch m68hc11
@@ -118,20 +118,6 @@ if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
-# On FreeBSD and NetBSD, the final link will fail because of
-# unresolved symbols. It turns out that libc.so references symbols
-# that are normally provided by crt1.o, which isn't linked in since we
-# specify -nostartfiles. Using -nostdlib doesn't help since
-# target_compile automatically adds -lm. Linking statically avoids
-# this mess.
-#
-# On Solaris, linking dynamically results in a binary that dumps core.
-#
-if {[istarget "*-*-freebsd*"] || [istarget "*-*-netbsd*"]
- || [istarget "*-*-solaris2*"]} then {
- append link-flags " -static"
-}
-
# On NetBSD/ELF we need a special NetBSD-identifying note section.
if { [istarget "*-*-netbsdelf*"]
|| [istarget "x86_64-*-netbsd*"] } then {
@@ -164,7 +150,6 @@ remote_exec build "rm -f ${subdir}/note.
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
if { "${asm-flags}" == "" } {
- #set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
}
@@ -175,11 +160,7 @@ if {[target_assemble ${srcdir}/${subdir}
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-set opts "debug ldflags=-nostartfiles"
-foreach i ${link-flags} {
- append opts " ldflags=$i"
-}
-if { [gdb_compile "asmsrc1.o asmsrc2.o" "${binfile}" executable $opts] != "" } {
+if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert to using target_link ind gdb.asm/asm-source.exp
2004-01-19 18:59 [PATCH] Revert to using target_link ind gdb.asm/asm-source.exp Mark Kettenis
@ 2004-01-19 19:15 ` Andrew Cagney
2004-01-30 21:35 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-01-19 19:15 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
> If nobody objects, I'll commit this next week or so.
Comments, lots of comments. Otherwize, two weeks or so after that,
someone will try to re-instate it ...
Andrew
(and thanks!)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert to using target_link ind gdb.asm/asm-source.exp
2004-01-19 19:15 ` Andrew Cagney
@ 2004-01-30 21:35 ` Mark Kettenis
0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2004-01-30 21:35 UTC (permalink / raw)
To: cagney; +Cc: gdb-patches
Date: Mon, 19 Jan 2004 14:15:02 -0500
From: Andrew Cagney <cagney@gnu.org>
> If nobody objects, I'll commit this next week or so.
Comments, lots of comments. Otherwize, two weeks or so after that,
someone will try to re-instate it ...
You're probably right, so here's what I actually checked in:
Index: testsuite/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.asm/asm-source.exp: Strip -Wl, from link-flags. Don't
append -static to link-flags for *-*-freebsd*, *-*netbsd* and
*-*solaris2*. Remove commented out default settings for
asm-flags. Replace gdb_compile with target_link.
Index: testsuite/gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.47
diff -u -p -r1.47 asm-source.exp
--- testsuite/gdb.asm/asm-source.exp 1 Jan 2004 01:13:42 -0000 1.47
+++ testsuite/gdb.asm/asm-source.exp 30 Jan 2004 21:22:47 -0000
@@ -70,7 +70,7 @@ switch -glob -- [istarget] {
}
"m32r*-*" {
set asm-arch m32r
- append link-flags " -Wl,--whole-archive -lgloss -Wl,--no-whole-archive"
+ append link-flags "--whole-archive -lgloss --no-whole-archive"
}
"m6811-*-*" {
set asm-arch m68hc11
@@ -118,20 +118,6 @@ if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
-# On FreeBSD and NetBSD, the final link will fail because of
-# unresolved symbols. It turns out that libc.so references symbols
-# that are normally provided by crt1.o, which isn't linked in since we
-# specify -nostartfiles. Using -nostdlib doesn't help since
-# target_compile automatically adds -lm. Linking statically avoids
-# this mess.
-#
-# On Solaris, linking dynamically results in a binary that dumps core.
-#
-if {[istarget "*-*-freebsd*"] || [istarget "*-*-netbsd*"]
- || [istarget "*-*-solaris2*"]} then {
- append link-flags " -static"
-}
-
# On NetBSD/ELF we need a special NetBSD-identifying note section.
if { [istarget "*-*-netbsdelf*"]
|| [istarget "x86_64-*-netbsd*"] } then {
@@ -164,7 +150,6 @@ remote_exec build "rm -f ${subdir}/note.
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
if { "${asm-flags}" == "" } {
- #set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
}
@@ -175,11 +160,13 @@ if {[target_assemble ${srcdir}/${subdir}
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-set opts "debug ldflags=-nostartfiles"
-foreach i ${link-flags} {
- append opts " ldflags=$i"
-}
-if { [gdb_compile "asmsrc1.o asmsrc2.o" "${binfile}" executable $opts] != "" } {
+# We deliberately don't use gdb_compile here to link together the
+# assembled object files. Using gdb_compile, and therefore the C
+# compiler, is conceptually wrong, since we're testing raw assembler
+# code here that provides its own startup code. Using target_link
+# also avoids a lot of problems on many systems, most notably on
+# *-*-*bsd* and *-*-solaris2*.
+if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-01-30 21:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19 18:59 [PATCH] Revert to using target_link ind gdb.asm/asm-source.exp Mark Kettenis
2004-01-19 19:15 ` Andrew Cagney
2004-01-30 21:35 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox