From patchwork Fri May 7 17:07:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1475606 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nIQSmhC3; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FcH2H72pVz9sXS for ; Sat, 8 May 2021 03:07:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 77F67615EC; Fri, 7 May 2021 17:07:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Io7c74sb0XUC; Fri, 7 May 2021 17:07:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id D57D361608; Fri, 7 May 2021 17:07:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7DFB61BF30A for ; Fri, 7 May 2021 17:07:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6D10484448 for ; Fri, 7 May 2021 17:07:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id du9T8UrWfzvC for ; Fri, 7 May 2021 17:07:43 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by smtp1.osuosl.org (Postfix) with ESMTPS id C8AEA84447 for ; Fri, 7 May 2021 17:07:42 +0000 (UTC) Received: by mail-wr1-x42c.google.com with SMTP id d4so9974000wru.7 for ; Fri, 07 May 2021 10:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7dH2za5T5kdDpbFwcOPuVv76YUm8ujJD0B3sc1kJJU8=; b=nIQSmhC3/9lxgC2Xz0lnqs/hrtCLV8pxJ0TsAEcYbx2JGt4Ds+mXveFn9T7asEPFjI 2nbFA4c1+ejy92phNkWWDr61SJSKeoNZPQu4pqYkV113nHECOXCAJrSAqc96DEZphCJS 6dPAaoIh+xrQuANGzVKlrEBVMdty7xf4iEUKaGalD8mZtpZTtNwuqWHopav7U598EF8U Sh3TIXRa43UK9FO+UZdRoB2zC4Jsdt45sELWHNRWgd+oXMs9JKGGjOaEAROndTzucmS7 GzmVKfGYGgHjTdDMGgFz8afMkcMpWWkAiN5+XEYXMxHUE62o37hOboI2Wxu/o5ngpouF BXBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7dH2za5T5kdDpbFwcOPuVv76YUm8ujJD0B3sc1kJJU8=; b=Zn5tmQUBjDX1orNgYReFeUEojEEEsSzM1QKduhGtUIYdyS1uwQjGBtjsdjimlDsCpH rigYRjIWJNCzOjxSAdj2oSdHiR0BHnAVENFyKrarVUxclVpUEo/KVdvbIlwo6GbhtNj5 +x6If3NJc745FWrIxp8A8hbio9TMAAZczMLkf54JLXge+63gBtRrAd8uvAbPnlwFM3af fjZS/RJyOAK4lcprKJ6xeGQ57asIrW5bk3QE4+/LScvPn3VKP+BZWtw0pfupuC+F3ShN MnTICQXdzNtOlJml4v8IoVqHUtLHjCIlofUdOiXaC5vSVpvytt0d6I9Vgp9SsteQ138z ZOSA== X-Gm-Message-State: AOAM532W9G59kbJoep/QP6Y2mmI7GqiJThS/EL62lHqI9nlxp47ezUdV G+7vGOTmawUowbed5KFqB/vtYuYis64= X-Google-Smtp-Source: ABdhPJzauM+51AmAVwU6xjFRknBbAMu9PV8GLV1o4SqMMGeKPw1zbqtXcziMYQmsh9hBsyf0QUZWSQ== X-Received: by 2002:a5d:4602:: with SMTP id t2mr13611190wrq.190.1620407260809; Fri, 07 May 2021 10:07:40 -0700 (PDT) Received: from kali.home (lfbn-ren-1-1383-171.w86-229.abo.wanadoo.fr. [86.229.230.171]) by smtp.gmail.com with ESMTPSA id a21sm14287441wmj.34.2021.05.07.10.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 10:07:40 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Fri, 7 May 2021 19:07:01 +0200 Message-Id: <20210507170701.2301276-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/numactl: add -latomic to numa.pc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre-Jean Texier , Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Instead of passing -latomic through LDFLAGS as done in commit 4ed540ddf59bec4b389be44d7f42820d2466904f, properly check for it in configure.ac and add it to numa.pc or numactl users won't be able to get it Signed-off-by: Fabrice Fontaine --- .../0002-link-with-latomic-if-needed.patch | 52 +++++++++++++++++++ package/numactl/numactl.mk | 4 -- 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 package/numactl/0002-link-with-latomic-if-needed.patch diff --git a/package/numactl/0002-link-with-latomic-if-needed.patch b/package/numactl/0002-link-with-latomic-if-needed.patch new file mode 100644 index 0000000000..6dff0cb233 --- /dev/null +++ b/package/numactl/0002-link-with-latomic-if-needed.patch @@ -0,0 +1,52 @@ +From e0de0d9e981ddb53bdeb4a4b9dc43046c9ff4ff9 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Thu, 6 May 2021 23:08:36 +0200 +Subject: [PATCH] link with -latomic if needed + +numactl unconditionally uses __atomic_fetch_and but some architectures +(e.g. sparc) needs to link with -latomic to be able to use it. So check +if -latomic is needed and update numa.pc accordingly + +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/numactl/numactl/commit/e0de0d9e981ddb53bdeb4a4b9dc43046c9ff4ff9] +--- + Makefile.am | 1 + + configure.ac | 2 ++ + numa.pc.in | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/Makefile.am b/Makefile.am +index 44d0d76..34f6815 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -151,6 +151,7 @@ SED_PROCESS = \ + -e 's,@exec_prefix\@,$(exec_prefix),g' \ + -e 's,@libdir\@,$(libdir),g' \ + -e 's,@includedir\@,$(includedir),g' \ ++ -e 's,@LIBS\@,$(LIBS),g' \ + < $< > $@ || rm $@ + + %.pc: %.pc.in Makefile +diff --git a/configure.ac b/configure.ac +index 659a765..e3b0eb3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -24,6 +24,8 @@ AM_CONDITIONAL([HAVE_TREE_VECTORIZE], [test x"${tree_vectorize}" = x"true"]) + + AC_CONFIG_FILES([Makefile]) + ++AC_SEARCH_LIBS([__atomic_fetch_and_1], [atomic]) ++ + # GCC tries to be "helpful" and only issue a warning for unrecognized + # attributes. So we compile the test with Werror, so that if the + # attribute is not recognized the compilation fails +diff --git a/numa.pc.in b/numa.pc.in +index 8a0f202..cc04d50 100644 +--- a/numa.pc.in ++++ b/numa.pc.in +@@ -8,3 +8,4 @@ Description: NUMA policy library + Version: @VERSION@ + Cflags: -I${includedir} + Libs: -L${libdir} -lnuma ++Libs.Private: @LIBS@ diff --git a/package/numactl/numactl.mk b/package/numactl/numactl.mk index 3364f6c5c3..cf9c759693 100644 --- a/package/numactl/numactl.mk +++ b/package/numactl/numactl.mk @@ -12,8 +12,4 @@ NUMACTL_INSTALL_STAGING = YES NUMACTL_AUTORECONF = YES NUMACTL_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -fPIC" -ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) -NUMACTL_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -latomic" -endif - $(eval $(autotools-package))