* [PATCH] ld: depend on libctf
@ 2021-01-26 19:55 Nick Alcock
2021-01-26 22:44 ` Stephen Casner
2021-01-27 10:41 ` [PATCH] ld: depend on libctf Nick Clifton
0 siblings, 2 replies; 11+ messages in thread
From: Nick Alcock @ 2021-01-26 19:55 UTC (permalink / raw)
To: binutils
Since ld may depend on libctf (if present), and libctf may be relinked
by the installation process, libctf must be installed before ld is,
or the relink may fail if it calls on symbols or symbol versions that do
not exist in any libctf already present on the system. (If none is
present, the copy in the build tree will be automatically used, but
if one *is* present, it may take precedence and break things.)
(This is a maybe- dependency, so it will work even if libctf is
disabled.)
ChangeLog
2021-01-26 Nick Alcock <nick.alcock@oracle.com>
PR 27250
* Makefile.def: Add install-libctf dependency to install-ld.
* Makefile.in: Regenerated.
---
ChangeLog | 5 +++++
Makefile.def | 1 +
Makefile.in | 1 +
3 files changed, 7 insertions(+)
If people agree, I'll put this into master and the 2.36 branch
directly, and also get it into GCC. It can leave you with a broken
system linker... :(
diff --git a/ChangeLog b/ChangeLog
index b6853d4abed..134df097543 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-26 Nick Alcock <nick.alcock@oracle.com>
+
+ * Makefile.def: Add install-libctf dependency to install-ld.
+ * Makefile.in: Regenerated.
+
2021-01-12 Mike Frysinger <vapier@gentoo.org>
* src-release.sh (do_proto_toplev): Rewrite indentation.
diff --git a/Makefile.def b/Makefile.def
index cc429aa8628..b45e580da5b 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -448,6 +448,7 @@ dependencies = { module=all-binutils; on=all-intl; };
dependencies = { module=all-binutils; on=all-gas; };
dependencies = { module=all-binutils; on=all-libctf; };
dependencies = { module=all-ld; on=all-libctf; };
+dependencies = { module=install-ld; on=install-libctf; };
// We put install-opcodes before install-binutils because the installed
// binutils might be on PATH, and they might need the shared opcodes
diff --git a/Makefile.in b/Makefile.in
index a817b7268a0..0a64fc10e5b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52170,6 +52170,7 @@ all-stage3-ld: maybe-all-stage3-libctf
all-stage4-ld: maybe-all-stage4-libctf
all-stageprofile-ld: maybe-all-stageprofile-libctf
all-stagefeedback-ld: maybe-all-stagefeedback-libctf
+install-ld: maybe-install-libctf
install-binutils: maybe-install-opcodes
install-strip-binutils: maybe-install-strip-opcodes
install-opcodes: maybe-install-bfd
--
2.30.0.252.gc27e85e57d
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ld: depend on libctf
2021-01-26 19:55 [PATCH] ld: depend on libctf Nick Alcock
@ 2021-01-26 22:44 ` Stephen Casner
2021-01-26 23:08 ` Stephen Casner
2021-01-27 13:09 ` Nick Alcock
2021-01-27 10:41 ` [PATCH] ld: depend on libctf Nick Clifton
1 sibling, 2 replies; 11+ messages in thread
From: Stephen Casner @ 2021-01-26 22:44 UTC (permalink / raw)
To: Nick Alcock; +Cc: binutils
On Tue, 26 Jan 2021, Nick Alcock via Binutils wrote:
> Since ld may depend on libctf (if present), and libctf may be relinked
> by the installation process, libctf must be installed before ld is,
> or the relink may fail if it calls on symbols or symbol versions that do
> not exist in any libctf already present on the system. (If none is
> present, the copy in the build tree will be automatically used, but
> if one *is* present, it may take precedence and break things.)
I need to investigate complaints about the pdp11 port in a recent
commit but make of the full binutils ran into errors shown below
related to CTF when linking objdump. I have now cloned a fresh copy
of binutils and applied your patch, but still get these errors. In
case it is informative, here is my configure command:
/Users/casner/src/gnu/binutils/configure --target=pdp11-aout --prefix=/usr/local
-- Steve
ld: warning: ignoring file ../libctf/.libs/libctf.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture x86_64:
"_ctf_archive_iter", referenced from:
_dump_bfd in objdump.o
"_ctf_bfdopen_ctfsect", referenced from:
_dump_bfd in objdump.o
"_ctf_close", referenced from:
_dump_bfd in objdump.o
"_ctf_dict_close", referenced from:
_dump_bfd in objdump.o
"_ctf_dict_open", referenced from:
_dump_bfd in objdump.o
"_ctf_dump", referenced from:
_dump_ctf_archive_member in objdump.o
"_ctf_errmsg", referenced from:
_dump_bfd in objdump.o
_dump_ctf_errs in objdump.o
_dump_ctf_archive_member in objdump.o
"_ctf_errno", referenced from:
_dump_ctf_archive_member in objdump.o
"_ctf_errwarning_next", referenced from:
_dump_ctf_errs in objdump.o
"_ctf_import", referenced from:
_dump_ctf_archive_member in objdump.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ld: depend on libctf
2021-01-26 22:44 ` Stephen Casner
@ 2021-01-26 23:08 ` Stephen Casner
2021-01-27 2:47 ` Stephen Casner
2021-01-27 13:09 ` Nick Alcock
1 sibling, 1 reply; 11+ messages in thread
From: Stephen Casner @ 2021-01-26 23:08 UTC (permalink / raw)
To: Nick Alcock; +Cc: binutils
Looking more closely at the error message I just mentioned...
> ld: warning: ignoring file ../libctf/.libs/libctf.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
That doesn't make any sense because macOS-x86_64 = macOS-x86_64. Does
building with clang no longer work? Since the library file was
ignored, it's no surprise that there were symbols not found.
-- Steve
> Undefined symbols for architecture x86_64:
> "_ctf_archive_iter", referenced from:
> _dump_bfd in objdump.o
> "_ctf_bfdopen_ctfsect", referenced from:
> _dump_bfd in objdump.o
> "_ctf_close", referenced from:
> _dump_bfd in objdump.o
> "_ctf_dict_close", referenced from:
> _dump_bfd in objdump.o
> "_ctf_dict_open", referenced from:
> _dump_bfd in objdump.o
> "_ctf_dump", referenced from:
> _dump_ctf_archive_member in objdump.o
> "_ctf_errmsg", referenced from:
> _dump_bfd in objdump.o
> _dump_ctf_errs in objdump.o
> _dump_ctf_archive_member in objdump.o
> "_ctf_errno", referenced from:
> _dump_ctf_archive_member in objdump.o
> "_ctf_errwarning_next", referenced from:
> _dump_ctf_errs in objdump.o
> "_ctf_import", referenced from:
> _dump_ctf_archive_member in objdump.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ld: depend on libctf
2021-01-26 23:08 ` Stephen Casner
@ 2021-01-27 2:47 ` Stephen Casner
0 siblings, 0 replies; 11+ messages in thread
From: Stephen Casner @ 2021-01-27 2:47 UTC (permalink / raw)
To: Nick Alcock; +Cc: binutils
It seems I am stuck, so if any of you have advice I would appreciate
it.
Switching to gcc10 did not help because the problem is ld. I have the
MacPorts binutils package installed (2.34 is latest), but I see that
does not include ld. The ld that I have is:
auge57> ld -v
@(#)PROGRAM:ld PROJECT:ld64-530
BUILD 18:57:17 Dec 13 2019
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 11.0.0, (clang-1100.0.33.17) (static support for 23, runtime is 23)
TAPI support using: Apple TAPI version 11.0.0 (tapi-1100.0.11)
I have the binutils sources, of course, in order to build the pdp11
cross, but I can't build the native ld, either. Is a binary for macOS
10.14 available somewhere?
-- Steve
On Tue, 26 Jan 2021, Stephen Casner wrote:
> Looking more closely at the error message I just mentioned...
>
> > ld: warning: ignoring file ../libctf/.libs/libctf.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
>
> That doesn't make any sense because macOS-x86_64 = macOS-x86_64. Does
> building with clang no longer work? Since the library file was
> ignored, it's no surprise that there were symbols not found.
>
> -- Steve
>
> > Undefined symbols for architecture x86_64:
> > "_ctf_archive_iter", referenced from:
> > _dump_bfd in objdump.o
> > "_ctf_bfdopen_ctfsect", referenced from:
> > _dump_bfd in objdump.o
> > "_ctf_close", referenced from:
> > _dump_bfd in objdump.o
> > "_ctf_dict_close", referenced from:
> > _dump_bfd in objdump.o
> > "_ctf_dict_open", referenced from:
> > _dump_bfd in objdump.o
> > "_ctf_dump", referenced from:
> > _dump_ctf_archive_member in objdump.o
> > "_ctf_errmsg", referenced from:
> > _dump_bfd in objdump.o
> > _dump_ctf_errs in objdump.o
> > _dump_ctf_archive_member in objdump.o
> > "_ctf_errno", referenced from:
> > _dump_ctf_archive_member in objdump.o
> > "_ctf_errwarning_next", referenced from:
> > _dump_ctf_errs in objdump.o
> > "_ctf_import", referenced from:
> > _dump_ctf_archive_member in objdump.o
> > ld: symbol(s) not found for architecture x86_64
> > clang: error: linker command failed with exit code 1 (use -v to see invocation)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ld: depend on libctf
2021-01-26 22:44 ` Stephen Casner
2021-01-26 23:08 ` Stephen Casner
@ 2021-01-27 13:09 ` Nick Alcock
[not found] ` <alpine.OSX.2.21.9999.2101281249300.22380@auge.attlocal.net>
1 sibling, 1 reply; 11+ messages in thread
From: Nick Alcock @ 2021-01-27 13:09 UTC (permalink / raw)
To: Stephen Casner; +Cc: binutils
On 26 Jan 2021, Stephen Casner said:
> /Users/casner/src/gnu/binutils/configure --target=pdp11-aout --prefix=/usr/local
>
> -- Steve
>
> ld: warning: ignoring file ../libctf/.libs/libctf.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
I think this is your problem, whatever is causing it:
> Undefined symbols for architecture x86_64:
> "_ctf_archive_iter", referenced from:
> _dump_bfd in objdump.o
> "_ctf_bfdopen_ctfsect", referenced from:
> _dump_bfd in objdump.o
... these symbols all exist, and are in the ignored libctf.a.
Is it seriously warning it's building for arch X but attempting to link
with file built for, uh, the same arch X?
I've never seen this bug and since I don't own anything running MacOS,
and as far as I'm aware there is no way to run a MacOS system under
emulation legally, I'm not sure how I can help here other than to
vaguely point in directions you've already figured out.
I di a test build using clang+lld instead of the GNU toolchain, but
that's not it. Something else is wrong. (That test build did show up a
genuine bug, so it was a good use of time. Not one important enough to
fix on the release branch.)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ld: depend on libctf
2021-01-26 19:55 [PATCH] ld: depend on libctf Nick Alcock
2021-01-26 22:44 ` Stephen Casner
@ 2021-01-27 10:41 ` Nick Clifton
2021-01-27 11:08 ` Nick Alcock
1 sibling, 1 reply; 11+ messages in thread
From: Nick Clifton @ 2021-01-27 10:41 UTC (permalink / raw)
To: Nick Alcock, binutils
Hi Nick,
> ChangeLog
> 2021-01-26 Nick Alcock <nick.alcock@oracle.com>
>
> PR 27250
> * Makefile.def: Add install-libctf dependency to install-ld.
> * Makefile.in: Regenerated.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ld: depend on libctf
2021-01-27 10:41 ` [PATCH] ld: depend on libctf Nick Clifton
@ 2021-01-27 11:08 ` Nick Alcock
0 siblings, 0 replies; 11+ messages in thread
From: Nick Alcock @ 2021-01-27 11:08 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
On 27 Jan 2021, Nick Clifton spake thusly:
>> ChangeLog
>> 2021-01-26 Nick Alcock <nick.alcock@oracle.com>
>>
>> PR 27250
>> * Makefile.def: Add install-libctf dependency to install-ld.
>> * Makefile.in: Regenerated.
>
> Approved - please apply.
Pushed, to both 2.36 and trunk. Sorry for the brief appearance of a
phantom 'upstream/binutils-2_36-branch': I'm sure everyone can guess
just what mistake I made, for about the millionth time.
I think I'll wrap some scripting around 'git push' so it's harder to do
that... I've done it one time too many and this time on an upstream that
matters.
The change is heading up to GCC too.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-02-02 21:09 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 19:55 [PATCH] ld: depend on libctf Nick Alcock
2021-01-26 22:44 ` Stephen Casner
2021-01-26 23:08 ` Stephen Casner
2021-01-27 2:47 ` Stephen Casner
2021-01-27 13:09 ` Nick Alcock
[not found] ` <alpine.OSX.2.21.9999.2101281249300.22380@auge.attlocal.net>
[not found] ` <alpine.OSX.2.21.9999.2101282211150.22380@auge.attlocal.net>
[not found] ` <87r1m3le5t.fsf@esperi.org.uk>
[not found] ` <alpine.OSX.2.21.9999.2101310756330.7314@auge.attlocal.net>
[not found] ` <alpine.OSX.2.21.9999.2102012344570.18983@auge.attlocal.net>
2021-02-02 16:29 ` libctf, gdbsupport: intl/ problems with --with-included-gettext (was Re: [PATCH] ld: depend on libctf) Nick Alcock
2021-02-02 19:41 ` Stephen Casner
2021-02-02 19:47 ` Nick Alcock
2021-02-02 21:08 ` Stephen Casner
2021-01-27 10:41 ` [PATCH] ld: depend on libctf Nick Clifton
2021-01-27 11:08 ` Nick Alcock
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).