Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp21438ybl; Thu, 29 Aug 2019 17:53:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCY6BsNo6Wu19evkmh+RYmydCF7U39R+JYdm+cHrx4eAyMfLCM/XCVksmuJVjXLQSXYDGk X-Received: by 2002:a17:90a:24ed:: with SMTP id i100mr12882335pje.47.1567126387448; Thu, 29 Aug 2019 17:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567126387; cv=none; d=google.com; s=arc-20160816; b=kkitw6UtKxki3pjQhRuVqH4BdNp5KOdXwla5ZpbIP6mgnD3ZYWO11skNetKoDxoVuw uo+Ru2KYRqkfTODtotVIymAGlDXcvPJtTRM64YOsN2dwzI+dcMD3xP07Dz+468iNuMnk 7w+N1JoAHQt1zOAkXxo23GBa1JJFSVf5d0aLuuYuX53CGaePmAZJFLYe1hDLNZnQSWeF WMTSVr8UWtTOgb2m6pM4bbZdtsNRQEYoyCGvWcoSn9yUBCxrxH1Cc/tpG6O0GaheEl9L zX58xVthN7jmkyqx3XJOUoe+wJALfBPgDev9QysfNTVxBAiJEzIuoV/+acv9zf5y2KZb 4L3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=XM+El1wyypVfaXfQc7FxTfECR5DYv9zUGiXmgC/VC5g=; b=L2OEmbhfypLL1QescJnqiwMkPVfkXFGdtNqC2GB+9w0L4KNakOBMkcaQRlyEjJlPpj OZQsl0YhK1D4Cge2ZqawjIWE7Rj4pe6fbDi/V93DxXiv0xAe/AZa7//zHhZjHNgntxCr LBhqFfuVsl8hOWsO5OumjCCiHb4lrLQXwceMQJp5vywmoOMSEonBApPg83Zp314jV3Bd srFx+pjkBU6BNVwGaaPAnhGFg3XKytu6W2ytpSaFUx2x/uTvAL5EGsG/Jwe6qIhf80DA DwbZT2VoPP3lCxo14gHRJengzUnaOIypEAY13750WbNdSBhlQ4FjCZniDULmhhITXDDa Rxjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OmaVkDBx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si3474589pjs.64.2019.08.29.17.52.52; Thu, 29 Aug 2019 17:53:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OmaVkDBx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728108AbfH3Ava (ORCPT + 99 others); Thu, 29 Aug 2019 20:51:30 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35888 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727635AbfH3Auu (ORCPT ); Thu, 29 Aug 2019 20:50:50 -0400 Received: by mail-lj1-f193.google.com with SMTP id u15so4828826ljl.3 for ; Thu, 29 Aug 2019 17:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XM+El1wyypVfaXfQc7FxTfECR5DYv9zUGiXmgC/VC5g=; b=OmaVkDBxJbEbiNuH6B/lkHNi7X3Ced5VCYrN4v0FOemALIxV7B1RR9GTxi+wIA+o7S SBNyfehZvn7LwSQMr71oX1EDAOy9VvdgFs/9kHugoMQYd2qS/DSS2mvw8yXRcG/xHDV5 0mJnXZcKmURGOdcozYB23tdigAAVVt6MHRP2J5RqtdSKEIJwvommRUF3YZCu8WcJ+ZRQ 9xYKzJ+pyiAczzLTKz6YMx84NzIkCgZakeJ1s58kckrg9aSB/Vdpg5FlpqJZCT257v3w UK5VqvNfJ4lXH3Sy/1qHZ5bEXEsMC6tIogRp0+fgccQf0ld0ru8mbbg+8L8dATJfDqle zUkA== 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:in-reply-to :references; bh=XM+El1wyypVfaXfQc7FxTfECR5DYv9zUGiXmgC/VC5g=; b=cpwXuoLkQW1TRo9GnsYBm0V9ifkVhg5AgTnMK6Hpdq0A63z7prt/KKFOwaEOxBfZ8t XfX+6LSbCsSDD4nsglGQY6+3OXXNTnD2PTJ1+e76QrpbbTIMDBfdED0fLWM1v6WIEi0Q yYrZyK/VLoiWiH2fsAHfcCuVwv6aN0ehxcXdVkL8K4JT/cUsqMtz2T8GEDtr0yAAq+x6 pydEz9VBVV/lOagl4lwX49dYUoYQSUTWc6r6DpBp1Gyv6R/Y0yYt9AIoQiQACDgftHRl EEfogrXQ+oGceJU1rSOXKbRZKUQKxuey8fZBVD6OFhNO3ETLZMrVg+zu3gYsTzjZaeD0 hr7w== X-Gm-Message-State: APjAAAXpSXOkQJmxoMtxNu4QNoMDBv4pRNNM6E0NG2HLQh5RtKB/8OTg YdbWcJzOTEbgq5vFXjOtftP1A2xLtso= X-Received: by 2002:a2e:85d4:: with SMTP id h20mr7058874ljj.134.1567126248121; Thu, 29 Aug 2019 17:50:48 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id f19sm628149lfk.43.2019.08.29.17.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 17:50:47 -0700 (PDT) From: Ivan Khoronzhuk To: linux@armlinux.org.uk, ast@kernel.org, daniel@iogearbox.net, yhs@fb.com, davem@davemloft.net, jakub.kicinski@netronome.com, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Ivan Khoronzhuk Subject: [PATCH RFC bpf-next 05/10] samples: bpf: Makefile: use vars from KBUILD_CFLAGS to handle linux headers Date: Fri, 30 Aug 2019 03:50:32 +0300 Message-Id: <20190830005037.24004-6-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> References: <20190830005037.24004-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kernel headers are reused from samples bpf, and autoconf.h is not enough to reflect complete configuration for clang. One of such configurations is __LINUX_ARM_ARCH__ min version used as instruction set selector. In another case an error like "SMP is not supported" for arm and others errors are issued and final object is not correct. --- samples/bpf/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index cdd742c05200..9232efa2b1b3 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -186,6 +186,13 @@ HOSTLDLIBS_map_perf_test += -lrt HOSTLDLIBS_test_overhead += -lrt HOSTLDLIBS_xdpsock += -pthread +# Strip all expet -D options needed to handle linux headers +# for arm it's __LINUX_ARM_ARCH__ and potentially others fork vars +D_OPTIONS = $(shell echo "$(KBUILD_CFLAGS) " | sed 's/[[:blank:]]/\n/g' | \ + sed '/^-D/!d' | tr '\n' ' ') + +CLANG_EXTRA_CFLAGS += $(D_OPTIONS) + # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang LLC ?= llc -- 2.17.1