public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cameron.heide at betasystems dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/109815] New: AIX: Combining -static-libstdc++ and -pthread causes a TLS-related link error
Date: Thu, 11 May 2023 15:38:11 +0000	[thread overview]
Message-ID: <bug-109815-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109815

            Bug ID: 109815
           Summary: AIX: Combining -static-libstdc++ and -pthread causes a
                    TLS-related link error
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cameron.heide at betasystems dot com
  Target Milestone: ---

With GCC 12.3 on AIX 7.1, trying to link even a trivial program with both the
'-static-libstdc++' and '-pthread' flags causes a link error:

test.cpp:
    int main() { return 0; }

-bash-5.1$ g++12 -static-libstdc++ -pthread -o test test.cpp
ld: 0711-550 SEVERE ERROR: Object
/IMPORT/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc12.3/bin/../lib/gcc/powerpc-ibm-aix7.1.5.0/12.3.0/../../../pthread/libstdc++.a[libstdc++.so.6]
cannot be processed.
        RLD at address 0x2b093 for section 7 (.dwinfo) references a
thread-local
        variable, but a TLS-related reference type was not used.
collect2: error: ld returned 12 exit status

Either flag by itself works; it is just the combination of the two that fails.
This combination also worked with GCC 11.3 and only started failing with GCC
12, with the same GCC configuration flags. (I haven't had a chance to try GCC
13 yet.)

The GCC configuration flags are pretty basic:

-bash-5.1$ gcc12 -v
Using built-in specs.
COLLECT_GCC=gcc12
COLLECT_LTO_WRAPPER=/IMPORT/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc12.3/bin/../libexec/gcc/powerpc-ibm-aix7.1.5.0/12.3.0/lto-wrapper
Target: powerpc-ibm-aix7.1.5.0
Configured with: ../gcc-12.3.0/configure
--prefix=/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc12.3
--with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++
--disable-nls --enable-threads --enable-bootstrap
--with-gmp=/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc-libs
--with-mpfr=/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc-libs
--with-mpc=/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc-libs
--with-isl=/home/zNTMAKE/betadev/arch/powerpc-aix7.1/gcc-libs
Thread model: aix
Supported LTO compression algorithms: zlib
gcc version 12.3.0 (GCC)

             reply	other threads:[~2023-05-11 15:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 15:38 cameron.heide at betasystems dot com [this message]
2023-05-11 15:42 ` [Bug target/109815] " pinskia at gcc dot gnu.org
2023-05-29 20:44 ` John.Parke at alebra dot com
2023-08-15 14:06 ` cameron.heide at betasystems dot com
2023-08-15 21:09 ` John.Parke at alebra dot com

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-109815-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: 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).