From patchwork Thu Sep 20 15:27:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45046 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31E121B120; Thu, 20 Sep 2018 17:27:50 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D5A481B10E for ; Thu, 20 Sep 2018 17:27:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:27:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="81999811" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 20 Sep 2018 08:27:22 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMEi006738; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRLfB025118; Thu, 20 Sep 2018 16:27:21 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRLng025114; Thu, 20 Sep 2018 16:27:21 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: Jasvinder Singh , Cristian Dumitrescu , Thomas Monjalon , dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:15 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 1/7] linuxapp: build with _GNU_SOURCE defined by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" We use _GNU_SOURCE all over the place, but often times we miss defining it, resulting in broken builds on musl. Rather than fixing every library's and driver's and application's makefile, fix it by simply defining _GNU_SOURCE by default for all Linuxapp builds. Signed-off-by: Anatoly Burakov --- app/meson.build | 9 ++++++++- drivers/bus/pci/linux/Makefile | 2 -- drivers/meson.build | 6 ++++++ drivers/net/softnic/conn.c | 1 - examples/meson.build | 6 ++++++ lib/librte_eal/linuxapp/eal/Makefile | 16 ---------------- lib/meson.build | 6 ++++++ mk/exec-env/linuxapp/rte.vars.mk | 2 ++ test/test/meson.build | 5 +++++ 9 files changed, 33 insertions(+), 20 deletions(-) diff --git a/app/meson.build b/app/meson.build index 99e0b93ec..c9a52a22b 100644 --- a/app/meson.build +++ b/app/meson.build @@ -11,13 +11,20 @@ apps = ['pdump', # for BSD only lib_execinfo = cc.find_library('execinfo', required: false) +default_cflags = machine_args + +# on Linux, specify -D_GNU_SOURCE unconditionally +if host_machine.system() == 'linux' + default_cflags += '-D_GNU_SOURCE' +endif + foreach app:apps build = true name = app allow_experimental_apis = false sources = [] includes = [] - cflags = machine_args + cflags = default_cflags objs = [] # other object files to link against, used e.g. for # instruction-set optimized versions of code diff --git a/drivers/bus/pci/linux/Makefile b/drivers/bus/pci/linux/Makefile index 96ea1d540..90404468b 100644 --- a/drivers/bus/pci/linux/Makefile +++ b/drivers/bus/pci/linux/Makefile @@ -4,5 +4,3 @@ SRCS += pci.c SRCS += pci_uio.c SRCS += pci_vfio.c - -CFLAGS += -D_GNU_SOURCE diff --git a/drivers/meson.build b/drivers/meson.build index 47b4215a3..74fec716d 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -16,6 +16,12 @@ default_cflags = machine_args if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif + +# on Linux, specify -D_GNU_SOURCE unconditionally +if host_machine.system() == 'linux' + default_cflags += '-D_GNU_SOURCE' +endif + foreach class:driver_classes drivers = [] std_deps = [] diff --git a/drivers/net/softnic/conn.c b/drivers/net/softnic/conn.c index 990cf40fc..8b6658088 100644 --- a/drivers/net/softnic/conn.c +++ b/drivers/net/softnic/conn.c @@ -8,7 +8,6 @@ #include #include -#define __USE_GNU #include #include diff --git a/examples/meson.build b/examples/meson.build index 4ee7a1114..70c22eb62 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -22,6 +22,12 @@ default_cflags = machine_args if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif + +# on Linux, specify -D_GNU_SOURCE unconditionally +if host_machine.system() == 'linux' + default_cflags += '-D_GNU_SOURCE' +endif + foreach example: examples name = example build = true diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile index fd92c75c2..bfee453bc 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -85,22 +85,6 @@ SRCS-y += rte_cycles.c CFLAGS_eal_common_cpuflags.o := $(CPUFLAGS_LIST) -CFLAGS_eal.o := -D_GNU_SOURCE -CFLAGS_eal_interrupts.o := -D_GNU_SOURCE -CFLAGS_eal_vfio_mp_sync.o := -D_GNU_SOURCE -CFLAGS_eal_timer.o := -D_GNU_SOURCE -CFLAGS_eal_lcore.o := -D_GNU_SOURCE -CFLAGS_eal_memalloc.o := -D_GNU_SOURCE -CFLAGS_eal_thread.o := -D_GNU_SOURCE -CFLAGS_eal_log.o := -D_GNU_SOURCE -CFLAGS_eal_common_log.o := -D_GNU_SOURCE -CFLAGS_eal_hugepage_info.o := -D_GNU_SOURCE -CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE -CFLAGS_eal_common_options.o := -D_GNU_SOURCE -CFLAGS_eal_common_thread.o := -D_GNU_SOURCE -CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE -CFLAGS_rte_cycles.o := -D_GNU_SOURCE - # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) diff --git a/lib/meson.build b/lib/meson.build index 3acc67e6e..2c7ea436a 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -32,6 +32,12 @@ if cc.has_argument('-Wno-format-truncation') endif enabled_libs = [] # used to print summary at the end + +# on Linux, specify -D_GNU_SOURCE unconditionally +if host_machine.system() == 'linux' + default_cflags += '-D_GNU_SOURCE' +endif + foreach l:libraries build = true name = l diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk index 3129edc8c..91b778fcc 100644 --- a/mk/exec-env/linuxapp/rte.vars.mk +++ b/mk/exec-env/linuxapp/rte.vars.mk @@ -17,6 +17,8 @@ else EXECENV_CFLAGS = -pthread endif +EXECENV_CFLAGS += -D_GNU_SOURCE + EXECENV_LDLIBS = EXECENV_ASFLAGS = diff --git a/test/test/meson.build b/test/test/meson.build index b1dd6eca2..c81fca439 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -242,6 +242,11 @@ if cc.has_argument('-Wno-format-truncation') cflags += '-Wno-format-truncation' endif +# on Linux, specify -D_GNU_SOURCE unconditionally +if host_machine.system() == 'linux' + default_cflags += '-D_GNU_SOURCE' +endif + test_dep_objs = [] compress_test_dep = dependency('zlib', required: false) if compress_test_dep.found() From patchwork Thu Sep 20 15:27:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45048 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3EC5F1B114; Thu, 20 Sep 2018 17:28:46 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D96E25F65 for ; Thu, 20 Sep 2018 17:28:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:28:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="72397106" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga008.fm.intel.com with ESMTP; 20 Sep 2018 08:27:22 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMta006741; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRMfi025129; Thu, 20 Sep 2018 16:27:22 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRMn6025125; Thu, 20 Sep 2018 16:27:22 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:16 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 2/7] pci/vfio: improve musl compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Musl already has PAGE_SIZE defined, and our define clashed with it. Rename our define to SYS_PAGE_SIZE. Bugzilla ID: 36 Signed-off-by: Anatoly Burakov --- drivers/bus/pci/linux/pci_vfio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 686386d6a..85f6c9803 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -35,7 +35,9 @@ #ifdef VFIO_PRESENT +#ifndef PAGE_SIZE #define PAGE_SIZE (sysconf(_SC_PAGESIZE)) +#endif #define PAGE_MASK (~(PAGE_SIZE - 1)) static struct rte_tailq_elem rte_vfio_tailq = { From patchwork Thu Sep 20 15:27:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45044 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06FB21B107; Thu, 20 Sep 2018 17:27:45 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5BEA71B109 for ; Thu, 20 Sep 2018 17:27:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:27:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="74605958" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga007.jf.intel.com with ESMTP; 20 Sep 2018 08:27:22 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMNH006744; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRMgL025137; Thu, 20 Sep 2018 16:27:22 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRMEE025133; Thu, 20 Sep 2018 16:27:22 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:17 +0100 Message-Id: <8b961f4b1ec88c0803231b89125958feae803161.1537456998.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 3/7] fbarray: improve musl compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When built against musl, fcntl.h doesn't silently get included. Fix by including it explicitly. Bugzilla ID: 34 Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_fbarray.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c index ba6c4ae39..ea0735cb8 100644 --- a/lib/librte_eal/common/eal_common_fbarray.c +++ b/lib/librte_eal/common/eal_common_fbarray.c @@ -2,6 +2,7 @@ * Copyright(c) 2017-2018 Intel Corporation */ +#include #include #include #include From patchwork Thu Sep 20 15:27:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45049 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A60F7CE2; Thu, 20 Sep 2018 17:28:57 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 63B325F51 for ; Thu, 20 Sep 2018 17:28:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:28:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="91816797" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 20 Sep 2018 08:27:23 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMRZ006747; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRMwH025144; Thu, 20 Sep 2018 16:27:22 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRMqE025140; Thu, 20 Sep 2018 16:27:22 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:18 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 4/7] eal/hugepage_info: improve musl compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When built against musl, fcntl.h doesn't silently get included. Fix by including it explicitly. Bugzilla ID: 33 Signed-off-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c index 3a7d4b222..0eab1cf71 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include From patchwork Thu Sep 20 15:27:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45045 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 321E01B115; Thu, 20 Sep 2018 17:27:47 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id F13F71B109 for ; Thu, 20 Sep 2018 17:27:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:27:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="74605960" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga007.jf.intel.com with ESMTP; 20 Sep 2018 08:27:23 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMe8006750; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRMe2025151; Thu, 20 Sep 2018 16:27:22 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRMTU025147; Thu, 20 Sep 2018 16:27:22 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:19 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 5/7] mem: improve musl compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When built against musl, fcntl.h doesn't silently get included. Fix by including it explicitly. Bugzilla ID: 31 Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memory.c | 1 + lib/librte_eal/linuxapp/eal/eal_memory.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 0b69804ff..9b5eacc57 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include #include #include #include diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index e3ac24815..256cab526 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -5,6 +5,7 @@ #define _FILE_OFFSET_BITS 64 #include +#include #include #include #include From patchwork Thu Sep 20 15:27:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45043 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC38D7D34; Thu, 20 Sep 2018 17:27:37 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 465D61B0FD for ; Thu, 20 Sep 2018 17:27:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:27:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="85185097" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 20 Sep 2018 08:27:23 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMM5006753; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRM25025158; Thu, 20 Sep 2018 16:27:22 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRMMh025154; Thu, 20 Sep 2018 16:27:22 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:20 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 6/7] string_fns: improve musl compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Musl wraps various string functions such as strlcpy in order to harden them. However, the fortify wrappers are included without including the actual string functions being wrapped, which throws missing definition compile errors. Fix by including string.h in string functions header. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/include/rte_string_fns.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/common/include/rte_string_fns.h b/lib/librte_eal/common/include/rte_string_fns.h index ecd141b85..295844ad2 100644 --- a/lib/librte_eal/common/include/rte_string_fns.h +++ b/lib/librte_eal/common/include/rte_string_fns.h @@ -16,6 +16,7 @@ extern "C" { #endif #include +#include /** * Takes string "string" parameter and splits it at character "delim" From patchwork Thu Sep 20 15:27:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 45042 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57D815F65; Thu, 20 Sep 2018 17:27:31 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 08A1F5F54 for ; Thu, 20 Sep 2018 17:27:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 08:27:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="87868152" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Sep 2018 08:27:23 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w8KFRMDv006756; Thu, 20 Sep 2018 16:27:22 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w8KFRMJe025165; Thu, 20 Sep 2018 16:27:22 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w8KFRMgl025161; Thu, 20 Sep 2018 16:27:22 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: dpdk@stormmq.com, bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 20 Sep 2018 16:27:21 +0100 Message-Id: <5a5540817f3e80cca916f61b9c99ef927dd8d088.1537456998.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 7/7] eal: improve musl compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Musl complains about pthread id being of wrong size, because on musl, pthread_t is a struct pointer, not an unsinged int. Fix the printing code by casting pthread id to unsigned pointer type and adjusting the format specifier to be of appropriate size. Signed-off-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal.c | 4 ++-- lib/librte_eal/linuxapp/eal/eal_thread.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index e59ac6577..1d6a9ac44 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -979,8 +979,8 @@ rte_eal_init(int argc, char **argv) ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset)); - RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%x;cpuset=[%s%s])\n", - rte_config.master_lcore, (int)thread_id, cpuset, + RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%zx;cpuset=[%s%s])\n", + rte_config.master_lcore, (uintptr_t)thread_id, cpuset, ret == 0 ? "" : "..."); RTE_LCORE_FOREACH_SLAVE(i) { diff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c b/lib/librte_eal/linuxapp/eal/eal_thread.c index b496fc711..379773b68 100644 --- a/lib/librte_eal/linuxapp/eal/eal_thread.c +++ b/lib/librte_eal/linuxapp/eal/eal_thread.c @@ -121,8 +121,8 @@ eal_thread_loop(__attribute__((unused)) void *arg) ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset)); - RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%x;cpuset=[%s%s])\n", - lcore_id, (int)thread_id, cpuset, ret == 0 ? "" : "..."); + RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%zx;cpuset=[%s%s])\n", + lcore_id, (uintptr_t)thread_id, cpuset, ret == 0 ? "" : "..."); /* read on our pipe to get commands */ while (1) {