From patchwork Wed Oct 9 20:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 175684 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1264149ill; Wed, 9 Oct 2019 13:41:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9KB0dTaxMmnMeXLG47zXnebu9ZTqsLH6p/cUHTfgkAbQgMO50xG/kjhh6OlTyFVkLTTFp X-Received: by 2002:a05:6402:6c6:: with SMTP id n6mr4878293edy.292.1570653719290; Wed, 09 Oct 2019 13:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570653719; cv=none; d=google.com; s=arc-20160816; b=wOBGQbkEi00tglTHO2drP59he+KaLSOh7U6OTVitISkYKsZz2F+/kZhjvjKlEnvuky 8qZ4hegBASOcQVSo2OC4ZMlTgV9xBqGk6z7lqqq7SCrpgJNehDuqJbVEfyDKHPIm1zhR 7wseMqnv1dOghMVf9n3E1G6V1yuIAydOQ7DWupWOviXVu9M2xSWvzKQpxsDtLgIC1AB0 HEL16dNgJ9yRJGhl2EvoSK0T9YZvfslXhVN6aBAD5viwziDLIC7BskAcd3H+orVh6hYc AfNgRZgl8xjg7j/uY1WSNfNGWKwAtZ7yRhY5ZyFE/1ELuo2Whu9w+yu4f5CTGSGWuKCQ 5OwA== 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=OsXgBugq9yBTYp2TWj7gghCrTtBB47X9YeLV9E3YhNo=; b=Rsu0KuVmZlDWnR2gxjydrXYOpLDxvAg2C77/a5YhowcpxQxCu0Q/SRHb5msxvN2RcM R8x7CZygOp8SubrowuvSyPq/iOA1uJsS7yCdTWHDdDSXZvESdrNaj5cGX74rdNcrnYL0 ievWaX5aBhowQmF75lVyHOFxXW54rNLy+hwLX2mSLkuM/hwanisw70ZG8qEJzU1gcYXf fmhixXp4bhSpyV4fMUvdTRVbF2nih8iL70QihDc5iKgfFhcOmaZoYOdvf693MVdkP5hW AJQsF+UEzwcS6Kjzs16MxpCmZW0m7Uz7KIX7kGZX3BUFV43axMPYXmn3iqDp+QeNvpqA 18sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XKt173H8; 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 i33si2126486eda.205.2019.10.09.13.41.59; Wed, 09 Oct 2019 13:41:59 -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=XKt173H8; 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 S1732127AbfJIUl4 (ORCPT + 26 others); Wed, 9 Oct 2019 16:41:56 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38747 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732056AbfJIUly (ORCPT ); Wed, 9 Oct 2019 16:41:54 -0400 Received: by mail-lj1-f195.google.com with SMTP id b20so3880560ljj.5 for ; Wed, 09 Oct 2019 13:41:52 -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=OsXgBugq9yBTYp2TWj7gghCrTtBB47X9YeLV9E3YhNo=; b=XKt173H8wj8IKIt4DSevJv+kXD2QtQYilXS8zfwcM9SF+6OorOJJ3SmvoU7IACx3N5 ZD4/UL/3p86LvvBJV/yGSkWEyRdtqTpfMBJxpHO+ck6akQ2JdmFtBmoy7w3Ci0j5MNfD 7iatnjl5O8In1S22aDEa0gNv47xnsUTG4FhY67C5Wp4Yde6cgVue2NsEVNcETOtarJDt PE5ipS2g0wOPpz4f84UV0CtrbwKOFXWdySlA/CO/sr6CDtBjDHIjVYO8596kQW+ndpi1 XOrbcWeIxekD8aI7aComYtS7I2L5V6w7+5MYsOTBISOvFA2UYk/Xr5Y4IpEQMDDqn4ym q65w== 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=OsXgBugq9yBTYp2TWj7gghCrTtBB47X9YeLV9E3YhNo=; b=omnRr5soxJIauJzipNQVVdETn/ngq6Qk9CEwpr3PXh80mhR/eCHeNKRRJSEQOklZNS 7tBAJdEWhA0MKINuIohEF/sY+Bg/GrqxtC81cpWDujmAbEgv791DajZsMz1gcHofUnK2 aJrbL55wG6GMEJDP6D/0pwrPmf0pcMP9/Z80A2VPreJSHQz3BXXxnS+TIjsIAJ+7qmhs IVFOybyKJv7MOXvchbg3MXe0MeNnhhDnVYJDrnj3ARQv3mGSuGrXDzB+1BFfa4eHNXl0 8nLUU6Vua3kNQkEF0VNhfzyu3KtR++1htLSAwf6+PvcVUVCSvSzG9kp58TfUJM0MfOuo Cu5g== X-Gm-Message-State: APjAAAX5OGoqjIFjMASuQ+Lnnnf3cvVPBU1cl+Inh8g+Yhvh79YQlPR+ OZ8EObD6vGLQeN/9mRWavKKrpg== X-Received: by 2002:a2e:9958:: with SMTP id r24mr3544709ljj.61.1570653712166; Wed, 09 Oct 2019 13:41:52 -0700 (PDT) Received: from localhost.localdomain (168-200-94-178.pool.ukrtel.net. [178.94.200.168]) by smtp.gmail.com with ESMTPSA id h3sm730871ljf.12.2019.10.09.13.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 13:41:51 -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 v4 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS Date: Wed, 9 Oct 2019 23:41:28 +0300 Message-Id: <20191009204134.26960-10-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191009204134.26960-1-ivan.khoronzhuk@linaro.org> References: <20191009204134.26960-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/