From patchwork Fri Oct 11 00:28:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175894 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp41933ill; Thu, 10 Oct 2019 17:29:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOhBmOToy8WGaymjcvtaW9SYcjQmt+En3krZS+8nNr7UFNZMFMkgvapGfcGUVx/DntQoGi X-Received: by 2002:aa7:c303:: with SMTP id l3mr10974422edq.234.1570753749929; Thu, 10 Oct 2019 17:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570753749; cv=none; d=google.com; s=arc-20160816; b=d5aK2okw9vvxSPRzNp9CRvJwt8oHHqfbu4qXoRLu57tkk9QgfQ68s6zkFF0NZWP+v5 8zhd6Ih5+hY80+ryvS5qi3Yu6UPS6XY5HnbrFSYj3gs8dnB9agA2/KXpuXTVlgM9Tdu+ NWULhw25De++/5RnnlcOGlHwXn2sdo7LAwLURWO/GIzcaS75blaNBtNv2ymNvl+dw9oy 0iYmA9a851FZ3XK41GU8oLdqSNSe49wEoslsii59oxP4NobcCCz8hfhkEGveVJjeskZ/ VFxSG6aHoNHZbmN8/iQEFWYyQBCjmWpQlH73ltGVloOabEhNfz0dII8xxSoEC5f7YAus ATkQ== 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=03GhUEVVPKzA4TMKrHg2hN3Csg5CX1o2irsu+gSocso=; b=sdAiTrLxmyOBNHde4Biyci9tVxDfpaSBGW9aqqTAmcw2fIe4RyjJ7Jzab9f25iZiKO PE39XAE69yj3jO8IK5Kdo5dtMuw21/G6vMfatOUhnm15Py60XwcV0vMYiJzuTZ5kq5FN epgoCeOpA0awKAwLfEH1QMZNjr4/UiVEHP757Y78XdCW6GZ5H9oXoCeaDixXYiJw7QXn U0fbk9Ogo2aQ6IueiR06q8y+LZ/tTz6Yj39mJ9/sBGzxnaGymxO0WjTWQ6eF7sUXjVTJ JOlehOmXdthj5I0S+BfupozLDFtSUsBfCKXQvgsblbzncLnU/vIdxdCsDEf+S79fsQHY p7YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lgPdUOsd; 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 q13si4316695eju.46.2019.10.10.17.29.09; Thu, 10 Oct 2019 17:29:09 -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=lgPdUOsd; 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 S1727925AbfJKA3H (ORCPT + 22 others); Thu, 10 Oct 2019 20:29:07 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42479 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727695AbfJKA2g (ORCPT ); Thu, 10 Oct 2019 20:28:36 -0400 Received: by mail-lf1-f68.google.com with SMTP id c195so5709976lfg.9 for ; Thu, 10 Oct 2019 17:28:33 -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=03GhUEVVPKzA4TMKrHg2hN3Csg5CX1o2irsu+gSocso=; b=lgPdUOsdWvm3NrU+k0qDkNxtB02GwhSc5KwzTrCweHYaxGN3NwSL194iDLlMKbHnkv HQsLrmFRtK/MtY3s/t6lnF+dn79c9z+krOQUQchJEDuQ1x5wj40QtHKQGOOzwMr6pRkZ m5Vkk9C5vFXa/NWObQzlISQO4YdbJs44MBjE2Xjous5QWHXDZlr5DcIOTBFHkyeEGG61 WF5Q7LTNZe3DrJVHzyS/VSxTW8rou+w2JR/RdhCDReKxj3Ac/8BRWjvZzNJle1gTsy0r gvhuogyNpORJ/IMHS8eJ+Y6UViz1GyjAt2gUp2tjQrsb1BfdiOFJaLYy7NLhBHyRChj0 y2Pw== 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=03GhUEVVPKzA4TMKrHg2hN3Csg5CX1o2irsu+gSocso=; b=Z55REVOcbJQPNMFU+LI6jVZes/kxzgG8NZIAQHWhErPV7UfOFI67pHeTp1OL3Bqpmf i+DgiENvbwkky9USSM/xi8uLh+i/UFeAonKOEBf4tB8brB4Nyyi9a8OKqvoYr23IB91N rN8Jd1mblAhT9gVnilULh77RjfCy1BqkHh81sg0GIRrnZKYs2t3l54JFF+b7FrZ4dXo5 jRjzsSLMUjcouDiDDt7iANlJiGAC+zELC+p26HZ5EOH83zMlRLVG+3Rud52jDxXiBmdX gsdjatMlE4PmewtlwfA66qnKZTFjZqaujseWOO/9jGIiu0pPKjZUmvzVjx3HlFYKXs+z Gt1Q== X-Gm-Message-State: APjAAAVEwQXQv1i5+2PNAN/kcR1Ntcvdyu4cTDPt70xw3zSuu/y0FAg9 Rx2p4A1sOw0BMLXnv82/9KnHzw== X-Received: by 2002:ac2:43d9:: with SMTP id u25mr7678515lfl.142.1570753713044; Thu, 10 Oct 2019 17:28:33 -0700 (PDT) Received: from localhost.localdomain (88-201-94-178.pool.ukrtel.net. [178.94.201.88]) by smtp.gmail.com with ESMTPSA id 126sm2367010lfh.45.2019.10.10.17.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:28:32 -0700 (PDT) From: Ivan Khoronzhuk To: 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-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, ilias.apalodimas@linaro.org, sergei.shtylyov@cogentembedded.com, Ivan Khoronzhuk Subject: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS Date: Fri, 11 Oct 2019 03:28:02 +0300 Message-Id: <20191011002808.28206-10-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011002808.28206-1-ivan.khoronzhuk@linaro.org> References: <20191011002808.28206-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While compiling natively, the host's cflags and ldflags are equal to ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it should have own, used for target arch. While verification, for arm, arm64 and x86_64 the following flags were used always: -Wall -O2 -fomit-frame-pointer -Wmissing-prototypes -Wstrict-prototypes So, add them as they were verified and used before adding Makefile.target and lets omit "-fomit-frame-pointer" as were proposed while review, as no sense in such optimization for samples. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 91bfb421c278..57a15ff938a6 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -176,8 +176,10 @@ BPF_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR) TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR) endif -TPROGS_LDLIBS := $(KBUILD_HOSTLDLIBS) -TPROGS_CFLAGS += $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) +TPROGS_CFLAGS += -Wall -O2 +TPROGS_CFLAGS += -Wmissing-prototypes +TPROGS_CFLAGS += -Wstrict-prototypes + TPROGS_CFLAGS += -I$(objtree)/usr/include TPROGS_CFLAGS += -I$(srctree)/tools/lib/bpf/ TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/