https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108734
Bug ID: 108734 Summary: powerpc: False Detection of __atomic_*_8 Builtins Product: gcc Version: 11.3.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: rmclure at linux dot ibm.com CC: bergner at gcc dot gnu.org Target Milestone: --- Created attachment 54440 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54440&action=edit False positive with __has_builtin Using built-in specs. COLLECT_GCC=powerpc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/powerpc-linux-gnu/12/lto-wrapper Target: powerpc-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 12.2.0-3ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=release --without-target-system-zlib --with-libphobos-druntime-only=yes --enable-secureplt --disable-softfloat --with-cpu=default32 --disable-softfloat --enable-targets=powerpc-linux,powerpc64-linux --enable-multiarch --disable-werror --with-long-double-128 --enable-multilib --enable-checking=release --build=powerpc64le-linux-gnu --host=powerpc64le-linux-gnu --target=powerpc-linux-gnu --program-prefix=powerpc-linux-gnu- --includedir=/usr/powerpc-linux-gnu/include Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1) The attached program should compile on 32-bit systems, built with `powerpc-linux-gnu-gcc fail.c -o fail`. Instead, __has_builtin(__atomic_store_8) evaluates to true, and we get a linker error. ``` /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/ld: /tmp/ccJ9g2pV.o: in function `main': fail.c:(.text+0x24): undefined reference to `__atomic_store_8' collect2: error: ld returned 1 exit status ```