From patchwork Mon Jul 25 12:55:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 15010 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C8CB75594; Mon, 25 Jul 2016 14:56:14 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E3C2C3978 for ; Mon, 25 Jul 2016 14:56:12 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 25 Jul 2016 05:56:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,419,1464678000"; d="scan'208"; a="1028639603" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 25 Jul 2016 05:56:12 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u6PCuAeI026487; Mon, 25 Jul 2016 13:56:10 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u6PCuA8q027823; Mon, 25 Jul 2016 13:56:10 +0100 Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u6PCuAYG027819; Mon, 25 Jul 2016 13:56:10 +0100 X-Authentication-Warning: sivswdev02.ir.intel.com: fyigit set sender to ferruh.yigit@intel.com using -f From: Ferruh Yigit To: dev@dpdk.org Cc: Thomas Monjalon Date: Mon, 25 Jul 2016 13:55:49 +0100 Message-Id: <1469451349-27653-2-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1469451349-27653-1-git-send-email-ferruh.yigit@intel.com> References: <1469451349-27653-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH 2/2] mk: fix FreeBSD clang compile error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" clang version < 3.5 doesn't support -z linker option, and some FreeBSD box still has clang versions < 3.5 as default version. compile error: clang: error: unknown argument: '-z' Fixes: fd591c4c4e35 ("mk: check shared library dependencies") Signed-off-by: Ferruh Yigit --- mk/rte.lib.mk | 6 +++++- mk/toolchain/clang/rte.toolchain-compat.mk | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index 0187ae8..830f81a 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -93,8 +93,12 @@ O_TO_A_DO = @set -e; \ $(O_TO_A) && \ echo $(O_TO_A_CMD) > $(call exe2cmd,$(@)) +ifneq ($(CC_SUPPORTS_Z),false) +NO_UNDEFINED := -z defs +endif + O_TO_S = $(LD) -L$(RTE_SDK_BIN)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \ - -shared $(OBJS-y) -z defs $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB) + -shared $(OBJS-y) $(NO_UNDEFINED) $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB) O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") O_TO_S_DO = @set -e; \ diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk index 03e5a97..b734413 100644 --- a/mk/toolchain/clang/rte.toolchain-compat.mk +++ b/mk/toolchain/clang/rte.toolchain-compat.mk @@ -43,3 +43,7 @@ CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9] CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f1 -d.) CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.) + +ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1) + CC_SUPPORTS_Z := false +endif