Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 943129 - sys-libs/compiler-rt-19.1.3-r1 - /.../atomic.c: error: implicit declaration of function _c11_atomic_store
Summary: sys-libs/compiler-rt-19.1.3-r1 - /.../atomic.c: error: implicit declaration o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 911340
  Show dependency tree
 
Reported: 2024-11-09 10:51 UTC by Toralf Förster
Modified: 2024-11-10 17:48 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,19.46 KB, text/plain)
2024-11-09 10:51 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,79.02 KB, text/plain)
2024-11-09 10:52 UTC, Toralf Förster
Details
environment (environment,155.86 KB, text/plain)
2024-11-09 10:52 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.21 KB, application/x-xz)
2024-11-09 10:52 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,19.89 KB, application/x-xz)
2024-11-09 10:52 UTC, Toralf Förster
Details
logs.tar.xz (logs.tar.xz,81.16 KB, application/x-xz)
2024-11-09 10:52 UTC, Toralf Förster
Details
qlist-info.txt (qlist-info.txt,181.70 KB, text/plain)
2024-11-09 10:52 UTC, Toralf Förster
Details
sys-libs:compiler-rt-19.1.3-r1:20241109-104218.log (sys-libs:compiler-rt-19.1.3-r1:20241109-104218.log,153.42 KB, text/plain)
2024-11-09 10:52 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,34.30 KB, application/x-xz)
2024-11-09 10:52 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-11-09 10:51:58 UTC
too long lines were shrinked:

[109/318] /usr/bin/x86_64-pc-linux-gnu-gcc -DVISIBILITY_HIDDEN   -DNDEBUG -O2 -pipe -march=native -fno-diagnostics-color -Wall -Wno-unused-parameter -fno-diagnostics-color -m32 -fno-lto -Werror=array-bounds -Werror=uninitialized -Werror=shadow -Werror=empty-body -Werror=sizeof-pointer-memaccess -Wer
[110/318] /usr/bin/x86_64-pc-linux-gnu-gcc -DVISIBILITY_HIDDEN   -DNDEBUG -O2 -pipe -march=native -fno-diagnostics-color -Wall -Wno-unused-parameter -fno-diagnostics-color -m32 -fno-lto -Werror=array-bounds -Werror=uninitialized -Werror=shadow -Werror=empty-body -Werror=sizeof-pointer-memaccess -Wer
[111/318] /usr/bin/x86_64-pc-linux-gnu-gcc -DVISIBILITY_HIDDEN   -DNDEBUG -O2 -pipe -march=native -fno-diagnostics-color -Wall -Wno-unused-parameter -fno-diagnostics-color -m32 -fno-lto -Werror=array-bounds -Werror=uninitialized -Werror=shadow -Werror=empty-body -Werror=sizeof-pointer-memaccess -Wer
FAILED: lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/atomic.c.o 
/usr/bin/x86_64-pc-linux-gnu-gcc -DVISIBILITY_HIDDEN   -DNDEBUG -O2 -pipe -march=native -fno-diagnostics-color -Wall -Wno-unused-parameter -fno-diagnostics-color -m32 -fno-lto -Werror=array-bounds -Werror=uninitialized -Werror=shadow -Werror=empty-body -Werror=sizeof-pointer-memaccess -Werror=sizeof
/var/tmp/portage/sys-libs/compiler-rt-19.1.3-r1/work/compiler-rt/lib/builtins/atomic.c: In function unlock:
/var/tmp/portage/sys-libs/compiler-rt-19.1.3-r1/work/compiler-rt/lib/builtins/atomic.c:110:3: error: implicit declaration of function __c11_atomic_store; did you mean __atomic_store? [-Wimplicit-function-declaration]
  110 |   __c11_atomic_store(l, 0, __ATOMIC_RELEASE);
      |   ^~~~~~~~~~~~~~~~~~

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_test-20241107-130503

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-14 *
clang version 19.1.3
llvm-config: 19.1.3
Python 3.12.7
go version go1.23.2 linux/amd64
Available Ruby profiles:
  [1]   ruby32 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.79.0
  [2]   rust-bin-1.82.0 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 21.0.5_p11 [openjdk-bin-21]
*)	Eclipse Temurin JDK 8.432_p06 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8  system-vm
  [2]   openjdk-bin-21 

The Glorious Glasgow Haskell Compilation System, version 9.2.8

  HEAD of ::gentoo
commit 53077633bcf79d74ab25227baf9c2912c6ffdcc5
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Nov 9 10:18:54 2024 +0000

    2024-11-09 10:18:53 UTC

emerge -qpvO =sys-libs/compiler-rt-19.1.3-r1
[ebuild     U ] sys-libs/compiler-rt-19.1.3-r1 [19.1.3] USE="-clang -debug -test -verify-sig" ABI_X86="32 (64)"
Comment 1 Toralf Förster gentoo-dev 2024-11-09 10:51:59 UTC
Created attachment 908249 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-11-09 10:52:00 UTC
Created attachment 908250 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2024-11-09 10:52:01 UTC
Created attachment 908251 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2024-11-09 10:52:02 UTC
Created attachment 908252 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2024-11-09 10:52:03 UTC
Created attachment 908253 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-11-09 10:52:04 UTC
Created attachment 908254 [details]
logs.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-11-09 10:52:05 UTC
Created attachment 908255 [details]
qlist-info.txt
Comment 8 Toralf Förster gentoo-dev 2024-11-09 10:52:07 UTC
Created attachment 908256 [details]
sys-libs:compiler-rt-19.1.3-r1:20241109-104218.log
Comment 9 Toralf Förster gentoo-dev 2024-11-09 10:52:07 UTC
Created attachment 908257 [details]
temp.tar.xz
Comment 10 mojyack 2024-11-09 12:00:50 UTC
Maybe we should enable the builtin only when compiled with clang, like freebsd does.
https://github.com/gentoo/gentoo/pull/39168#issuecomment-2463963941
Comment 11 vadorovsky 2024-11-09 12:06:07 UTC
Trying to reproduce the issue right now, but if we confirm that's happening only with GCC, then I would lean towards having the USE flag and enabling it in LLVM profiles.
Comment 12 mojyack 2024-11-10 03:56:46 UTC
(In reply to vadorovsky from comment #11)
> Trying to reproduce the issue right now, but if we confirm that's happening
> only with GCC, then I would lean towards having the USE flag and enabling it
> in LLVM profiles.

Just curious, why is just using tc-is-clang not sufficient?
Comment 13 Xavier Miller 2024-11-10 09:46:05 UTC
same error with sys-libs/compiler-rt-18.1.8-r2:18
Comment 14 vadorovsky 2024-11-10 11:36:59 UTC
(In reply to mojyack from comment #12)
> (In reply to vadorovsky from comment #11)
> > Trying to reproduce the issue right now, but if we confirm that's happening
> > only with GCC, then I would lean towards having the USE flag and enabling it
> > in LLVM profiles.
> 
> Just curious, why is just using tc-is-clang not sufficient?

I think it'd be actually sufficient.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-10 11:37:37 UTC
The argument against it would be that mutating the image based on the compiler used like this might be undesirable, but given the special case of what the package is and what the atomic stuff is for, it should be fine.
Comment 16 vadorovsky 2024-11-10 12:21:06 UTC
Just noticed that there is a `clang` USE flag already in compiler-rt ebuilds already, which is used to enforce clang usage on GCC systems. It can be disabled on LLVM profiles. I think it would be the best to just guard `-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=OFF` with it.

Let me test it. I'll make a PR once I confirm it works.
Comment 17 vadorovsky 2024-11-10 12:21:48 UTC
(In reply to vadorovsky from comment #16)
> Just noticed that there is a `clang` USE flag already in compiler-rt ebuilds
> already, which is used to enforce clang usage on GCC systems. It can be
> disabled on LLVM profiles. I think it would be the best to just guard
> `-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=OFF` with it.
> 
> Let me test it. I'll make a PR once I confirm it works.

It **CAN'T** be disabled on LLVM profiles, sorry for the typo
Comment 18 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-11-10 13:06:37 UTC
I think it'd be confusing to have this dependent on USE=clang that serves another purpose.  Perhaps we should add IUSE=atomic that requires USE=clang.
Comment 19 Larry the Git Cow gentoo-dev 2024-11-10 17:42:44 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=066df5677a706878b18665db183c72bac6302030

commit 066df5677a706878b18665db183c72bac6302030
Author:     Michal Rostecki <vadorovsky@protonmail.com>
AuthorDate: 2024-11-10 12:06:29 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2024-11-10 17:42:41 +0000

    sys-libs/compiler-rt: Provide `atomic-builtins` IUSE flag
    
    Atomic builtins fail to build with GCC. Furthermore, they are not needed
    on systems with GCC, because libatomic can be used on them. Atomic
    builtins are mostly useful on LLVM-based systems.
    
    Guard them behind the `atomic-builtins` IUSE flag. That flag depends on
    `clang`.
    
    Bug: https://bugs.gentoo.org/943129
    Signed-off-by: Michal Rostecki <vadorovsky@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/39260
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 sys-libs/compiler-rt/compiler-rt-15.0.7-r2.ebuild   |  5 +++--
 sys-libs/compiler-rt/compiler-rt-16.0.6-r6.ebuild   |  5 +++--
 sys-libs/compiler-rt/compiler-rt-17.0.6-r2.ebuild   |  5 +++--
 sys-libs/compiler-rt/compiler-rt-18.1.8-r2.ebuild   |  5 +++--
 sys-libs/compiler-rt/compiler-rt-19.1.3-r1.ebuild   |  5 +++--
 sys-libs/compiler-rt/compiler-rt-20.0.0.9999.ebuild |  5 +++--
 sys-libs/compiler-rt/metadata.xml                   | 11 +++++++++--
 7 files changed, 27 insertions(+), 14 deletions(-)