From 2a19bbb57e34ecc9b4590abb3c3154fb13b805bd Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 13 Sep 2026 20:52:41 +0100 Subject: [PATCH] llvm: use ATOMIC64_DEPENDS The libraries depend on libatomic on every architecture, link it only on mips through an open-coded LDFLAGS addition, and still name the removed arc architecture in their dependencies. ATOMIC64_DEPENDS restricts the dependency to the targets whose compiler calls libatomic for 64-bit atomics, and the link flag follows the same symbol, which also covers the ARMv5 targets. Signed-off-by: Daniel Golle --- libs/llvm/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libs/llvm/Makefile b/libs/llvm/Makefile index 17a7da1..d403d7c 100644 --- a/libs/llvm/Makefile +++ b/libs/llvm/Makefile @@ -2,6 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=llvm-project PKG_VERSION:=22.1.5 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION) @@ -89,6 +90,8 @@ else ifeq ($(ARCH),i686) LLVM_TARGETS_TO_BUILD:=X86 else +TARGET_LDFLAGS += $(if $(CONFIG_HAS_ATOMIC64),,-latomic) + ifeq ($(ARCH),x86_64) LLVM_TARGETS_TO_BUILD:=X86 else @@ -106,7 +109,6 @@ ifneq ($(findstring loongarch,$(ARCH)),) else ifneq ($(findstring mips,$(ARCH)),) LLVM_TARGETS_TO_BUILD:=Mips - TARGET_LDFLAGS+=-latomic else ifneq ($(findstring powerpc,$(ARCH)),) LLVM_TARGETS_TO_BUILD:=PowerPC @@ -174,7 +176,7 @@ define Package/llvm CATEGORY:=Development TITLE:=LLVM URL:=https://llvm.org/ - DEPENDS:=@(!arc&&!powerpc64&&!powerpc||BROKEN) + DEPENDS:=@(!powerpc64&&!powerpc||BROKEN) BUILDONLY:=1 endef @@ -187,7 +189,7 @@ define Package/libclang CATEGORY:=Libraries TITLE:=LLVM Clang library URL:=https://llvm.org/ - DEPENDS:=@(!arc&&!powerpc64&&!powerpc||BROKEN) +libatomic +libstdcpp + DEPENDS:=@(!powerpc64&&!powerpc||BROKEN) $(ATOMIC64_DEPENDS) +libstdcpp endef define Package/libclang-cpp @@ -195,7 +197,7 @@ define Package/libclang-cpp CATEGORY:=Libraries TITLE:=LLVM Clang C++ library URL:=https://llvm.org/ - DEPENDS:=@(!arc&&!powerpc64&&!powerpc||BROKEN) +libatomic +libstdcpp + DEPENDS:=@(!powerpc64&&!powerpc||BROKEN) $(ATOMIC64_DEPENDS) +libstdcpp endef define Package/liblto @@ -203,7 +205,7 @@ define Package/liblto CATEGORY:=Libraries TITLE:=LLVM LTO library URL:=https://llvm.org/ - DEPENDS:=@(!arc&&!powerpc64&&!powerpc||BROKEN) +libatomic +libstdcpp + DEPENDS:=@(!powerpc64&&!powerpc||BROKEN) $(ATOMIC64_DEPENDS) +libstdcpp endef define Package/libremarks @@ -211,7 +213,7 @@ define Package/libremarks CATEGORY:=Libraries TITLE:=LLVM diagnostic remarks library URL:=https://llvm.org/ - DEPENDS:=@(!arc&&!powerpc64&&!powerpc||BROKEN) +libatomic +libstdcpp + DEPENDS:=@(!powerpc64&&!powerpc||BROKEN) $(ATOMIC64_DEPENDS) +libstdcpp endef define Host/Prepare