public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109815] New: AIX: Combining -static-libstdc++ and -pthread causes a TLS-related link error
@ 2023-05-11 15:38 cameron.heide at betasystems dot com
  2023-05-11 15:42 ` [Bug target/109815] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: cameron.heide at betasystems dot com @ 2023-05-11 15:38 UTC (permalink / raw)
  To: gcc-bugs

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-15 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11 15:38 [Bug c++/109815] New: AIX: Combining -static-libstdc++ and -pthread causes a TLS-related link error cameron.heide at betasystems dot com
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

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