* [Buildroot] [PATCH 1/1] package/llvm-project/clang: link with -latomic if needed
@ 2023-12-08 23:14 Fabrice Fontaine
2026-11-21 18:08 ` Angelo Compagnucci
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2023-12-08 23:14 UTC (permalink / raw)
To: buildroot
Cc: Joseph Kogut, Romain Naour, Daniel Lang, Fabrice Fontaine,
Valentin Korenblit
Fix the following build failure raised since bump to version 15.0.3 in
commit d8291fde5ee19fd475953f41d9c519e817554d6b:
/home/autobuild/autobuild/instance-4/output-1/host/lib/gcc/riscv32-buildroot-linux-gnu/13.2.0/../../../../riscv32-buildroot-linux-gnu/bin/ld: ../../lib/Basic/CMakeFiles/obj.clangBasic.dir/FileManager.cpp.o: in function `.L0 ':
FileManager.cpp:(.text._ZN4llvm17TrackingStatisticppEv[_ZN4llvm17TrackingStatisticppEv]+0x20): undefined reference to `__atomic_fetch_add_8
Fixes:
- http://autobuild.buildroot.org/results/83d059e74b771aad1ed9db80a4f5572361fb3494
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
package/llvm-project/clang/clang.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/package/llvm-project/clang/clang.mk b/package/llvm-project/clang/clang.mk
index 0bafd6461b..82a06a8e59 100644
--- a/package/llvm-project/clang/clang.mk
+++ b/package/llvm-project/clang/clang.mk
@@ -105,6 +105,11 @@ ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
HOST_CLANG_CONF_OPTS += -DGCC_INSTALL_PREFIX:PATH=`realpath --relative-to=$(HOST_DIR)/bin/ $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)`
endif
+# Uses __atomic_fetch_add_8
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+CLANG_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+endif
+
define HOST_CLANG_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
$(Q)cd $(HOST_DIR)/bin; \
rm -f clang-$(CLANG_VERSION_MAJOR).br_real; \
--
2.42.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/llvm-project/clang: link with -latomic if needed
2023-12-08 23:14 [Buildroot] [PATCH 1/1] package/llvm-project/clang: link with -latomic if needed Fabrice Fontaine
@ 2026-11-21 18:08 ` Angelo Compagnucci
0 siblings, 0 replies; 2+ messages in thread
From: Angelo Compagnucci @ 2026-11-21 18:08 UTC (permalink / raw)
To: buildroot
Cc: Fabrice Fontaine, Joseph Kogut, Romain Naour, Daniel Lang,
Valentin Korenblit
Hi Fabrice,
On 09/12/23 00:14, Fabrice Fontaine wrote:
> FileManager.cpp:(.text._ZN4llvm17TrackingStatisticppEv[_ZN4llvm17TrackingStatisticppEv]+0x20): undefined reference to `__atomic_fetch_add_8
I think this patch can be dropped: the problem is fixed upstream.
LLVM commit 20132d8eaa68 ("Link libclangBasic against libatomic when
necessary.") links libclangBasic, where FileManager.cpp is, with
libatomic when the target needs it. It is in LLVM 16.0.0 and later.
Buildroot has it since commit e29dae109a21 ("package/llvm-project: bump
to version 20.1.5"), and the autobuilder shows no clang failure after
it.
Not Applicable: https://patchwork.buildroot.org/project/buildroot/patch/20231208231413.656734-1-fontaine.fabrice@gmail.com/
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 23:14 [Buildroot] [PATCH 1/1] package/llvm-project/clang: link with -latomic if needed Fabrice Fontaine
2026-11-21 18:08 ` Angelo Compagnucci
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox