public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mfarazma.ext at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100641] New: Link error when using extern thread_local variables on AIX Date: Mon, 17 May 2021 19:19:19 +0000 [thread overview] Message-ID: <bug-100641-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100641 Bug ID: 100641 Summary: Link error when using extern thread_local variables on AIX Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mfarazma.ext at gmail dot com Target Milestone: --- Declaring a variable as "extern thread_local" in a C++ program leads to: "ERROR: Undefined symbol: TLS init function for ..." during linking. To reproduce: file `0.cc`: ``` extern thread_local int foo; int main(){ return foo; } ``` file `1.cc`: ``` thread_local int foo = 1; ``` Then compile with `g++ 0.cc 1.cc` which produces this error: ``` ld: 0711-317 ERROR: Undefined symbol: TLS init function for foo ld: 0711-317 ERROR: Undefined symbol: .TLS init function for foo ld: 0711-317 ERROR: Undefined symbol: __get_tpointer ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: error: ld returned 8 exit status ```
next reply other threads:[~2021-05-17 19:19 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-17 19:19 mfarazma.ext at gmail dot com [this message] 2021-05-17 19:21 ` [Bug c++/100641] " mfarazma.ext at gmail dot com 2022-03-20 21:59 ` [Bug target/100641] " hstong at ca dot ibm.com 2024-04-06 5:39 ` pinskia at gcc dot gnu.org
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=bug-100641-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).