From: Tom de Vries <tdevries@suse.de>
To: Aditya Kamath1 <Aditya.Kamath1@ibm.com>,
Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org>
Cc: Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>,
Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] Fix AIX build break
Date: Fri, 12 Jan 2024 10:50:04 +0100 [thread overview]
Message-ID: <da839d76-c075-48aa-8841-df6f921e687e@suse.de> (raw)
In-Reply-To: <CH2PR15MB3544BC85F0820D6A2ACB7E91D66F2@CH2PR15MB3544.namprd15.prod.outlook.com>
On 1/12/24 10:20, Aditya Kamath1 wrote:
> Respected community members,
>
> Hi,
>
> Our CI in AIX for GDB has been broken for the last two days with the
> following error.
>
> CXXLD gdb
>
> ld: 0711-317 ERROR: Undefined symbol: _ZTH23deprecated_warning_hook
>
> ld: 0711-317 ERROR: Undefined symbol: ._ZTH23deprecated_warning_hook
>
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
>
> collect2: error: ld returned 8 exit status
>
> gmake: *** [Makefile:2184: gdb] Error 1
>
> These symbols came due to the commit
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=54b815ddb428944a70694e3767a0fadbdd9ca9ea <https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=54b815ddb428944a70694e3767a0fadbdd9ca9ea>
>
I think this is triggered by using thread-local with extern.
I found this commit:
...
commit fece451c2aca57b095e7e4063e342781cf74aa75
Author: Christian Biesinger <cbiesinger@google.com>
Date: Tue Mar 9 08:16:23 2021 -0600
Use RAII to set the per-thread SIGSEGV handler
This avoids using a thread-local extern variable, which causes link
errors
on some platforms, notably Cygwin. But I think this is a better
pattern
even outside of working around linker bugs because it encapsulates
direct
access to the variable inside the class, instead of having a global
extern
variable.
...
which seems related, given that it mentions link errors. Perhaps we can
do something similar here.
Thanks,
- Tom
> The problem in AIX is marking a variable for thread storage as
> thread_local that makes that symbol a weak symbol. The dump output of
> the complaints.o shows this as pasted here:-
>
> # dump -tov -X64 complaints.o | grep _ZTH23deprecated_warning_hook
>
> [32] m 0x00000000 undef 1 weak
> _ZTH23deprecated_warning_hook
>
> [36] m 0x00000000 undef 1 weak
> ._ZTH23deprecated_warning_hook
>
> [3209] m 0x000203d8 .data 1 unamex
> _ZTH23deprecated_warning_hook
>
> Hence in the final stage of compilation while creating the binary gdb,
> the ld error came and the compilation is unsuccessful since the symbol
> is not visible though complaints.c file was successfully compiled.
>
> This patch is a fix for the same where instead of thread_local we used
> __thread and GDB now compiles in AIX. Please find attached the patch.
> (See: 0001-Fix-AIX-build-break.patch).
>
> I want to know your opinion about this. Also, I do not know the impact
> of this change on other targets. If we can do this better, kindly let me
> know.
>
> Have a nice day ahead.
>
> Thanks and regards,
> Aditya.
>
next prev parent reply other threads:[~2024-01-12 9:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 9:20 Aditya Kamath1
2024-01-12 9:50 ` Tom de Vries [this message]
2024-01-12 15:56 ` Tom Tromey
2024-01-15 9:57 ` [RFC] " Aditya Kamath1
2024-01-16 9:42 ` [PATCH] " Aditya Kamath1
2024-01-17 15:09 ` Tom Tromey
-- strict thread matches above, loose matches on Subject: below --
2024-06-09 5:38 Aditya Vidyadhar Kamath
2024-06-09 14:12 ` Simon Marchi
2024-01-17 18:28 Aditya Vidyadhar Kamath
2024-01-17 19:25 ` Tom Tromey
2024-01-19 11:58 ` Aditya Kamath1
2024-01-19 16:25 ` Tom Tromey
2024-01-20 15:03 ` Aditya Kamath1
2024-01-24 0:53 ` Aditya Kamath1
2024-01-25 14:45 ` Aditya Kamath1
2024-01-25 19:53 ` Tom Tromey
2024-01-26 8:37 ` Aditya Kamath1
2024-01-31 0:40 ` Tom Tromey
2024-01-31 9:15 ` Aditya Kamath1
2024-02-01 0:37 ` Tom Tromey
2024-02-01 3:03 ` Aditya Kamath1
2024-02-06 12:36 ` Ciaran Woodward
2024-02-06 14:49 ` Tom Tromey
2024-02-06 15:04 ` Ciaran Woodward
2024-02-06 15:54 ` Aditya Kamath1
2023-08-11 8:49 Aditya Kamath1
2023-08-11 9:43 ` Ulrich Weigand
2023-08-11 9:53 ` Aditya Kamath1
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=da839d76-c075-48aa-8841-df6f921e687e@suse.de \
--to=tdevries@suse.de \
--cc=Aditya.Kamath1@ibm.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.com \
--cc=tom@tromey.com \
/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).