Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
To: buildroot@buildroot.org
Cc: Sergey Romanov <svromanov@salutedevices.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Sergey Romanov <svromanov@sberdevices.ru>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>
Subject: [Buildroot] [PATCH v3 1/2] package/ck: new package
Date: Sat, 21 Nov 2026 19:02:18 +0100	[thread overview]
Message-ID: <20261121180219.3583305-1-angelo.compagnucci@gmail.com> (raw)
In-Reply-To: <20231117094429.30820-1-svromanov@salutedevices.com>

From: Sergey Romanov <svromanov@sberdevices.ru>

Concurrency primitives, safe memory reclamation
mechanisms and non-blocking data structures
for the research, design and implementation
of high performance concurrent systems.

https://github.com/concurrencykit/ck.git

Signed-off-by: Sergey Romanov <svromanov@salutedevices.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
Changes v2 -> v3:
  - bump to version 0.7.2
  - move the package to the "Other" libraries menu: ck is a library
  - do not force -march=armv6k or -march=armv7-a: Buildroot already
    passes the CPU flags. Instead, exclude arm1136j-s and arm1136jf-s,
    the only ARMv6 cores without the ARMv6K instructions that ck needs
  - exclude i486: the configure script stops on it, ck needs at least
    an i586
  - pass --disable-sse on 32-bit x86 CPUs without SSE2: else the
    configure script adds -msse -msse2
  - give --platform the name ck knows: powerpc64le is ppc64le for ck.
    --platform sets the memory model of the target in ck_md.h
  - pass AR to make: the configure script does not set it, so the
    static library was made with the ar of the host
  - keep TARGET_LDFLAGS instead of replacing them, and drop -m64: the
    x86_64 toolchain already builds 64-bit code
  - build only the libraries that the configuration asks for: shared,
    static or both
  - simplify the .mk file: one variable for the profile, and the
    configure options inline. Explain why the configure script needs
    --profile
  - help text: link to the project page, not the git URL
  - DEVELOPERS: add Angelo Compagnucci too
  - rebase on master

Supersedes v2: https://patchwork.buildroot.org/project/buildroot/patch/20231117094429.30820-2-svromanov@salutedevices.com/

 DEVELOPERS           |  4 +++
 package/Config.in    |  1 +
 package/ck/Config.in | 22 ++++++++++++++
 package/ck/ck.hash   |  3 ++
 package/ck/ck.mk     | 72 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)
 create mode 100644 package/ck/Config.in
 create mode 100644 package/ck/ck.hash
 create mode 100644 package/ck/ck.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 1d2960f9b3..5812ce6484 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -227,6 +227,7 @@ F:	board/sipeed/lichee_rv_dock/
 F:	configs/sipeed_lichee_rv*
 F:	docs/website/
 F:	package/apparmor/
+F:	package/ck/
 F:	package/corkscrew/
 F:	package/cups/
 F:	package/cups-filters/
@@ -3100,6 +3101,9 @@ F:	package/rtl8189fs/
 F:	package/wpa_supplicant/
 F:	package/xr819-xradio/
 
+N:	Sergey Romanov <svromanov@salutedevices.com>
+F:	package/ck/
+
 N:	Sergio Prado <sergio.prado@e-labworks.com>
 F:	package/aoetools/
 F:	package/asn1c/
diff --git a/package/Config.in b/package/Config.in
index 49659b007e..199f8b0bc7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2172,6 +2172,7 @@ menu "Other"
 	source "package/catch2/Config.in"
 	source "package/cctz/Config.in"
 	source "package/cereal/Config.in"
+	source "package/ck/Config.in"
 	source "package/llvm-project/clang/Config.in"
 	source "package/cmocka/Config.in"
 	source "package/llvm-project/compiler-rt/Config.in"
diff --git a/package/ck/Config.in b/package/ck/Config.in
new file mode 100644
index 0000000000..273e58c398
--- /dev/null
+++ b/package/ck/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_CK_ARCH_SUPPORTS
+	bool
+	# ck needs the ARMv6K instructions
+	default y if BR2_arm && !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5 && \
+		!BR2_ARM_CPU_ARMV7M && !BR2_arm1136j_s && !BR2_arm1136jf_s
+	default y if BR2_aarch64
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_s390x
+	default y if BR2_sparc_v9
+	# ck needs at least an i586 (cmpxchg8b)
+	default y if BR2_i386 && !BR2_x86_i486
+	default y if BR2_x86_64
+
+config BR2_PACKAGE_CK
+	bool "concurrency kit"
+	depends on BR2_PACKAGE_CK_ARCH_SUPPORTS
+	help
+	  Concurrency primitives, safe memory reclamation mechanisms
+	  and non-blocking data structures for the research, design and
+	  implementation of high performance concurrent systems.
+
+	  https://github.com/concurrencykit/ck
diff --git a/package/ck/ck.hash b/package/ck/ck.hash
new file mode 100644
index 0000000000..ba99f24c59
--- /dev/null
+++ b/package/ck/ck.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  568ebe0bc1988a23843fce6426602e555b7840bf6714edcdf0ed530214977f1b  ck-0.7.2.tar.gz
+sha256  21a861f554f8f97047815e63ff5cbd57707b4c53dc1dd1b0f2dd43e6ca193464  LICENSE
diff --git a/package/ck/ck.mk b/package/ck/ck.mk
new file mode 100644
index 0000000000..28bc937eac
--- /dev/null
+++ b/package/ck/ck.mk
@@ -0,0 +1,72 @@
+################################################################################
+#
+# ck
+#
+################################################################################
+
+CK_VERSION = 0.7.2
+CK_SITE = $(call github,concurrencykit,ck,$(CK_VERSION))
+CK_LICENSE = Apache-2.0
+CK_LICENSE_FILES = LICENSE
+
+CK_INSTALL_STAGING = YES
+
+# ck names of the target architecture: --platform sets the memory model
+# in ck_md.h, --profile selects build/ck.build.<profile>.
+CK_PLATFORM = $(if $(BR2_powerpc64le),ppc64le,$(BR2_ARCH))
+CK_PROFILE = $(strip \
+	$(if $(BR2_arm),arm) \
+	$(if $(BR2_aarch64),aarch64) \
+	$(if $(BR2_powerpc),ppc) \
+	$(if $(BR2_powerpc64)$(BR2_powerpc64le),ppc64) \
+	$(if $(BR2_s390x),s390x) \
+	$(if $(BR2_sparc_v9),sparcv9) \
+	$(if $(BR2_i386),x86) \
+	$(if $(BR2_x86_64),x86_64))
+
+# On 32-bit x86, the configure script adds -msse -msse2 unless told not to
+ifeq ($(BR2_i386):$(BR2_X86_CPU_HAS_SSE2),y:)
+CK_CONF_OPTS += --disable-sse
+endif
+
+CK_CFLAGS = $(TARGET_CFLAGS) -std=gnu99
+CK_LDFLAGS = $(TARGET_LDFLAGS)
+ifeq ($(BR2_STATIC_LIBS),)
+CK_CFLAGS += -fPIC
+CK_LDFLAGS += -Wl,-soname,libck.so.0 -shared -fPIC
+endif
+
+# The configure script runs a test program to find the compiler, which
+# does not work when cross-compiling. With --profile, it skips that
+# test, but it does not set the compiler and linker flags, nor the
+# libraries to build: set them here.
+define CK_CONFIGURE_CMDS
+	cd $(@D) && \
+		$(TARGET_CONFIGURE_OPTS) \
+		LD="$(TARGET_CC)" \
+		CFLAGS="$(CK_CFLAGS)" \
+		LDFLAGS="$(CK_LDFLAGS)" \
+		ALL_LIBS="$(if $(BR2_STATIC_LIBS),,libck.so) $(if $(BR2_SHARED_LIBS),,libck.a)" \
+		INSTALL_LIBS="$(if $(BR2_STATIC_LIBS),,install-so) $(if $(BR2_SHARED_LIBS),,install-lib)" \
+		PTHREAD_CFLAGS="-pthread" \
+		./configure \
+			--prefix=/usr \
+			--platform=$(CK_PLATFORM) \
+			--profile=$(CK_PROFILE) \
+			$(CK_CONF_OPTS)
+endef
+
+# AR is not set by the configure script
+define CK_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) AR="$(TARGET_AR)"
+endef
+
+define CK_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+define CK_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-11-21 18:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 21:51 [Buildroot] [RFC PATCH v1 0/2] Added package: 'sysbench' and its dependency: 'ck' Sergey Romanov via buildroot
2023-05-25 21:51 ` [Buildroot] [RFC PATCH v1 1/2] package/ck: new package Sergey Romanov via buildroot
2023-08-25 21:33   ` Thomas Petazzoni via buildroot
2023-11-17  9:44     ` [Buildroot] [RFC PATCH v2 0/2] Added package: 'sysbench' and its dependency: 'ck' Sergey Romanov via buildroot
2023-11-17  9:44       ` [Buildroot] [RFC PATCH v2 1/2] package/ck: new package Sergey Romanov via buildroot
2023-11-17  9:44       ` [Buildroot] [RFC PATCH v2 2/2] package/sysbench: " Sergey Romanov via buildroot
2026-11-21 18:02       ` Angelo Compagnucci [this message]
2026-11-21 18:02         ` [Buildroot] [PATCH v3 " Angelo Compagnucci
2023-05-25 21:51 ` [Buildroot] [RFC PATCH v1 " Sergey Romanov via buildroot
2023-08-25 21:37   ` Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261121180219.3583305-1-angelo.compagnucci@gmail.com \
    --to=angelo.compagnucci@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=svromanov@salutedevices.com \
    --cc=svromanov@sberdevices.ru \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox