Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2146032ybb; Thu, 2 Apr 2020 14:08:07 -0700 (PDT) X-Google-Smtp-Source: APiQypJTc8XdIc1VbiR5/UGm0S78z1GBNbtef7pvSNWyAPB21C1FH8sjan3KdQ4dKPBtDb0KELsk X-Received: by 2002:aca:de42:: with SMTP id v63mr706764oig.99.1585861687078; Thu, 02 Apr 2020 14:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585861687; cv=none; d=google.com; s=arc-20160816; b=aehiAbJy19AcUb0bHafxuDhi6og9CRZa0O3FPRHp1Cp6ldhLJJ75ESz3dJ/aa0dW9f obAa1aB0niX/fz/crN8ViDXOjdfAyQTVWqGAAavFKk3Z7bHgxtpsoIluemj2f1z4jW67 NZ57ZOxMPu71MiCv5cYCiwlbeLuPiGFnY2+DF1JC7TvRMFYkZKXrAinUjWLeqbDdGs/G 77Q6IXJsA8gIvFvTtfkGI94Pjw2vA9LCWOBrq13gVQfSG28nyuEX64IK6OaonttHUc0y HJrPrN+o4nJ+xX88Oqmbt5IntxIcyEZwxa0QSrUJuravI6QMdkK+m1CbmSWFyWxsbIsk CKDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sVjs2DH9m9fKgjs6n5kVRWIE0vGLsA/x3K/6uNiKORs=; b=SDLG7riNC1XN9TuxiNLFXPJDZ4B79dd62FnEKocC8ob3Cpuhl8QB/4qVCV8FU8j9GZ ExYazMwR2gYoAe4Ws3YHtyrroR3YqQqaiZ5tVain51h/8d5Rv2z+RiQJ/ZpzhOPSyYkt bUeFV0lv1/fRMDCqKTbywe8mwyb23pLpulkdXZkx+gG6nB5/CCMMoJX9LPctoEXK29kt NjIGfVPOjocjhmAgmHNhnopzBSs8kjIVlTWymLS533Z6yo85iWB4RbGh1NTFu7pwx3bY kDnZB/cj2R/IdJVBxKugVI0QqL4fOHGCxd5zPbcw+ScawZUuiH03AfRkQcU8Ie7m6oFi U7WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=daDolYs7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si2879649otj.205.2020.04.02.14.07.54; Thu, 02 Apr 2020 14:08: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=@gmail.com header.s=20161025 header.b=daDolYs7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389707AbgDBVDJ (ORCPT + 99 others); Thu, 2 Apr 2020 17:03:09 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:33782 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbgDBVDJ (ORCPT ); Thu, 2 Apr 2020 17:03:09 -0400 Received: by mail-qk1-f195.google.com with SMTP id v7so5827899qkc.0; Thu, 02 Apr 2020 14:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sVjs2DH9m9fKgjs6n5kVRWIE0vGLsA/x3K/6uNiKORs=; b=daDolYs7NP3AZpiXGh8vMaDcVivAzxdICdi7a5NF4eji04bA84T747X4wiXOZfMH1J PNU/6IAUp2gnrVx3HcfMPiEYj3DWHUs4qsHQMDo/8VyrnqhbyL/TsfFtFZWlJkCad0tt 364Ci6j98+J/faVYlvmIY+4UIDBWba5IvRCj9/RzlsszImRrZkEPx5xpJoA96RtuDcPb YpDWiyEPusaB0pnVTjDtQuAJhB74DWBcXrYhxOttkXswGEBqQ1KJ4gAnQEbiUNvm757G u2ylGGb36YA0ZpNX0UESKPW8vKTbUxfLeK/O0MdLC+bZkDXzMOVECnHORTppQ3y3WU1j T9dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sVjs2DH9m9fKgjs6n5kVRWIE0vGLsA/x3K/6uNiKORs=; b=b9hEV0Qex9KqLzRUnf1LNc0xNlSLKpWC+rL3LWtTFRMfhl9Pe32gs0qJn2WjmzKdeg v0V7qTngOfrL3cS2qFRCFZLcZ5Zg/1Yc8MrG3Qvu1q6F9o7GRzImPUC1t/0+HoywNkCF emrJK/E3/6FBJhd3RRSY79rPSSvtY/JrFz1qEtrkxstK0FyAHMc9sKnB/89gDCH70BWW Lx5SQ2rFOmunXDiEuRVdBhGVTRwfGWoaDkbKnZ23wUguw+dQ8selOgHFrC4QOirgYjNe yVifMZ1zbP5iEgsz8J5z1Q6PZgyhkBHycb/xOmVqLTXFLgplmyq2wVEZA+PG4NKq0rTa bNFA== X-Gm-Message-State: AGi0PuZfNwufWZuCUGi1eG1XdgGOiFek+j3DNZi7ZK6lOLYa7GztvrQU yjq5ebXJEeq+qvD4zpflhb8/vCH1N49gUnwJVzU= X-Received: by 2002:a37:6411:: with SMTP id y17mr5760875qkb.437.1585861388455; Thu, 02 Apr 2020 14:03:08 -0700 (PDT) MIME-Version: 1.0 References: <202004021328.E6161480@keescook> <20200402204138.408021-1-slava@bacher09.org> In-Reply-To: <20200402204138.408021-1-slava@bacher09.org> From: Andrii Nakryiko Date: Thu, 2 Apr 2020 14:02:57 -0700 Message-ID: Subject: Re: [PATCH v5 bpf] kbuild: fix dependencies for DEBUG_INFO_BTF To: Slava Bacherikov Cc: Andrii Nakryiko , Kees Cook , bpf , open list , Jann Horn , Alexei Starovoitov , Daniel Borkmann , Kernel Hardening , Liu Yiding , KP Singh Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 2, 2020 at 1:44 PM Slava Bacherikov wrote: > > 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 > Reviewed-by: Kees Cook > Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux") > --- > lib/Kconfig.debug | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index f61d834e02fe..6118d99117da 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -223,6 +223,8 @@ config DEBUG_INFO_DWARF4 > config DEBUG_INFO_BTF > bool "Generate BTF typeinfo" > depends on DEBUG_INFO > + depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED > + depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST Given what Kees explained, I think this looks good. Thanks! > help > Generate deduplicated BTF type information from DWARF debug info. > Turning this on expects presence of pahole tool, which will convert