From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D397BF94 for ; Mon, 17 Apr 2017 16:36:04 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2017 07:36:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,215,1488873600"; d="scan'208";a="75140349" Received: from sivswdev02.ir.intel.com ([10.237.217.46]) by orsmga002.jf.intel.com with ESMTP; 17 Apr 2017 07:36:01 -0700 From: Ferruh Yigit To: Ferruh Yigit , Thomas Monjalon , Jerin Jacob Cc: dev@dpdk.org Date: Mon, 17 Apr 2017 15:35:58 +0100 Message-Id: <20170417143559.11701-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.8.4 Subject: [dpdk-dev] [PATCH 1/2] mk: fix build for clang 4 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: , X-List-Received-Date: Mon, 17 Apr 2017 14:36:05 -0000 clang 4 gives "taking address of packed member may result in an unaligned pointer value" warnings in a few locations [1]. Disabled "-Waddress-of-packed-member" warning for clang >= 4 [1] build errors: .../lib/librte_eal/common/eal_common_memzone.c:275:25: error: taking address of packed member 'mlock' of class or structure 'rte_mem_config' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] rte_rwlock_write_lock(&mcfg->mlock); ^~~~~~~~~~~ .../lib/librte_ip_frag/rte_ipv4_reassembly.c:139:31: error: taking address of packed member 'src_addr' of class or structure 'ipv4_hdr' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] psd = (unaligned_uint64_t *)&ip_hdr->src_addr; ^~~~~~~~~~~~~~~~ .../lib/librte_vhost/vhost_user.c:1037:34: error: taking address of packed member 'payload' of class or structure 'VhostUserMsg' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] vhost_user_set_vring_num(dev, &msg.payload.state); ^~~~~~~~~~~~~~~~~ Signed-off-by: Ferruh Yigit --- mk/toolchain/clang/rte.vars.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk index 7749b99..af34c10 100644 --- a/mk/toolchain/clang/rte.vars.mk +++ b/mk/toolchain/clang/rte.vars.mk @@ -79,5 +79,10 @@ include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk # workaround clang bug with warning "missing field initializer" for "= {0}" WERROR_FLAGS += -Wno-missing-field-initializers +# disable packed member unalign warnings +ifeq ($(shell test $(CLANG_MAJOR_VERSION) -ge 4 && echo 1), 1) +WERROR_FLAGS += -Wno-address-of-packed-member +endif + export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS -- 2.9.3