[COMMITTED] hppa*64*-*-hpux*: Create dummy milli.a archive for binutils and ld tests
Checks
Commit Message
Tested on x86_64-pc-linux-gnu and hppa64-hp-hpux11.11. Committed
to trunk.
Dave
---
hppa*64*-*-hpux*: Create dummy milli.a archive for binutils and ld tests
On cross builds, this fixes numerous test fails due to the milli.a
archive not being found. On hppa*64*-*-hpux*, this fixes four fails
due to undefined symbols in the HP milli.a archive.
The change to objcopy.exp causes the "objcopy executable (pr25662)"
test to fail. Previously, it didn't run because milli.a wasn't
found.
2026-05-24 John David Anglin <danglin@gcc.gnu.org>
binutils/ChangeLog:
* testsuite/binutils-all/objcopy.exp: Append LDFLAGS to
ldflags for milli.a archive.
* testsuite/config/default.exp: Create dummy milli.a archive
in tmpdir/hppa. Append " -Ltmpdir/hppa" to LDFLAGS.
ld/ChangeLog:
* testsuite/config/default.exp: Likewise.
@@ -1570,6 +1570,11 @@ if { [istarget *-*-cygwin] || [istarget *-*-mingw*] } {
append ldflags " --disable-reloc-section"
}
+# Append LDFLAGS for milli.a archive
+if { [istarget hppa*64*-*-hpux*] } {
+ append ldflags " $LDFLAGS"
+}
+
#xcoff doesn't support arbitrary sections
if { ![is_xcoff_format] } {
objcopy_test "pr25662" $src executable "" $ldflags
@@ -120,6 +120,21 @@ proc link_or_copy { src dst } {
catch "exec cp -fpu ../$src tmpdir/gas/$dst" status
}
+if { [istarget hppa*64-*-hpux*] } {
+ verbose -log "creating dummy milli.a archive"
+ remote_exec host "mkdir -p tmpdir/hppa"
+ set src tmpdir/hppa/empty.s
+ set f [open $src "w"]
+ close $f
+ if [is_remote host] {
+ set src [remote_download host $src]
+ }
+ remote_exec host "$AS -o tmpdir/hppa/empty.o $src"
+ remote_exec host "$AR rc tmpdir/hppa/milli.a tmpdir/hppa/empty.o"
+ append LDFLAGS " -Ltmpdir/hppa"
+ unset f src
+}
+
if {[file isfile gas/as-new[exe_ext]]} then {
link_or_copy gas/as-new[exe_ext] as[exe_ext]
} else {
@@ -552,6 +552,22 @@ if { [istarget alpha*-*-*vms*] } {
unset f src
}
+# Provide dummy milli.a that hppa64-hpux-ld always loads
+if { [istarget hppa*64-*-hpux*] } {
+ verbose -log "creating dummy milli.a archive"
+ remote_exec host "mkdir -p tmpdir/hppa"
+ set src tmpdir/hppa/empty.s
+ set f [open $src "w"]
+ close $f
+ if [is_remote host] {
+ set src [remote_download host $src]
+ }
+ ld_assemble $as $src tmpdir/hppa/empty.o
+ ar_simple_create $ar {} tmpdir/hppa/milli.a tmpdir/hppa/empty.o
+ append LDFLAGS " -Ltmpdir/hppa"
+ unset f src
+}
+
set plug_opt ""
if { [check_compiler_available] } {
set plugin_names {