Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp657634ybb; Wed, 1 Apr 2020 07:24:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv8bjQZi7OMMFvhMc9NRSlmyGO+HZmozO3IVsZOHrUKVbpHyBaq181iTQIBMmcozl33/XEJ X-Received: by 2002:a9d:58c9:: with SMTP id s9mr15066861oth.99.1585751057248; Wed, 01 Apr 2020 07:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585751057; cv=none; d=google.com; s=arc-20160816; b=PUkP2/8fx48NMgvCoyy0+hP9PralZt7YTGKxKyrHKU842xFhHxO0gDVF1p3PgllFj1 0/jyMYTpDyj2SP86ZNzY3B5WFSN+WTmRuLeD9nBF90c0Jk0y2KJN+ggXZiVSEuESHlEv Oe/pqOk50d7GgBodng+ZHdn0nW5LcClfKqpxGnJ7AcdUhghid9r4F+HYHCJakZwY+Up1 /Pq8E+bh+9VlUF2TLrN4ujAkg3lBEVN1DrVF+5a3SFN64pMB61zBwiopX4nSdWp6EP7T 5mOWai4FPynWeDU+9/0EjyPkXiORBghaLDonwFOQPHLJcrekLG3k/DKe4g6t1xfFvKwg apfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=6PA6evFBA3OhoMmMTkr0x/OR3XEpPNK02N3kYgs/0fY=; b=UqVSYgnQ7CYQa0I9G2tvpADMWXfkTyoB7phf8LTYALy1yjIO9r3GltoDKNZZCRRLwI yeDfjoGmQDeAK49OjNqTc4HUGDVgKeT68eRyQeCH14oc+ktEzC73TAfXFETpKI2wPQJP tccpM3IwUphBhiy82THNrPkxFcCiUVzBqfSJMjQcf2AlTeFjndRpqmCDnJZf0dicf5y/ 1P5zGOAwJSEo5gNneE9ZtoHlziE52ckBjgfToXNzK5oJlFU6yRur+uwnyLGiC9DJzkff aM4qWRLh7UG+IeLV+kPzTny07l9xB/7hHqCbT0EfWnIPl0t9UQRTH1t5jb7rPKGUuEE+ Wzzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bacher09.org header.s=reg header.b=WHb2HyAq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si946319oie.128.2020.04.01.07.24.03; Wed, 01 Apr 2020 07:24:17 -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=@bacher09.org header.s=reg header.b=WHb2HyAq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732975AbgDAOWU (ORCPT + 99 others); Wed, 1 Apr 2020 10:22:20 -0400 Received: from pub.regulars.win ([89.163.144.234]:60018 "EHLO pub.regulars.win" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732205AbgDAOWU (ORCPT ); Wed, 1 Apr 2020 10:22:20 -0400 From: Slava Bacherikov DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bacher09.org; s=reg; t=1585750936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6PA6evFBA3OhoMmMTkr0x/OR3XEpPNK02N3kYgs/0fY=; b=WHb2HyAqpVVozuh8wufIBqW+oj9uTdjbGnGsyEXPc7/TaCXQjFjLlFvyjWIWzbUeFHxjMJ MS+CV9sKgxO+0GYdsxZts5OAsRg+ujd1m5PkErXUf9f4ii1JfPdjUbg2Do8Z+tw3C35aCe C07xU6daqkxWfDHWpYGCzu4ZwMVyA+Q= To: keescook@chromium.org Cc: andriin@fb.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, jannh@google.com, alexei.starovoitov@gmail.com, daniel@iogearbox.net, kernel-hardening@lists.openwall.com, liuyd.fnst@cn.fujitsu.com, Slava Bacherikov , KP Singh Subject: [PATCH v3 bpf] kbuild: fix dependencies for DEBUG_INFO_BTF Date: Wed, 1 Apr 2020 17:20:58 +0300 Message-Id: <20200401142057.453892-1-slava@bacher09.org> In-Reply-To: <202004010033.A1523890@keescook> References: <202004010033.A1523890@keescook> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently turning on DEBUG_INFO_SPLIT when DEBUG_INFO_BTF is also enabled will produce invalid btf file, since gen_btf function in link-vmlinux.sh script doesn't handle *.dwo files. Enabling DEBUG_INFO_REDUCED will also produce invalid btf file, and using GCC_PLUGIN_RANDSTRUCT with BTF makes no sense. Signed-off-by: Slava Bacherikov Reported-by: Jann Horn Reported-by: Liu Yiding Acked-by: KP Singh Acked-by: Andrii Nakryiko Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux") --- lib/Kconfig.debug | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f61d834e02fe..b94227be2d62 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -222,7 +222,9 @@ config DEBUG_INFO_DWARF4 config DEBUG_INFO_BTF bool "Generate BTF typeinfo" - depends on DEBUG_INFO + depends on DEBUG_INFO || COMPILE_TEST + depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED + depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST help Generate deduplicated BTF type information from DWARF debug info. Turning this on expects presence of pahole tool, which will convert