Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1628299ybg; Thu, 11 Jun 2020 15:08:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1AqZpvnqknMMZax4onUQj5Q/fvkV6WUHRQLzp3Ho/stUE7VEiy6OX8RWcZrWuEZDOKEmm X-Received: by 2002:a50:9b14:: with SMTP id o20mr9080424edi.371.1591913330507; Thu, 11 Jun 2020 15:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591913330; cv=none; d=google.com; s=arc-20160816; b=kmIPQKL7zWsaUiv6Sy2zy9Oa+OJdHcUDsIJGwIFZT/7xETC+olFt15BxJc1HotOvwR OeMgMFWLn5msWWA7YvwaRlHudDtJPzYK+PVKdSy7GYq4yHUCfHXHwACb3fBS+V9ErAuh JzSjWIRADn3mftYSqc6lmG58p42ninOeHss8vSPO2Vla5nqVs5jcE9l5rMgxX+fRj4uA hG0apZRWdkU+nbU8rfcaobbMhK1vgUPS2n4QkEmEKprRo5XrjoEcbo7pgox1ZfIs8CxZ yIXKuZsSd9REF6hGDNEwW9nUAJUK/o3d1SJLmiu5wKWibp+wwqcbIeE04cFyf/MIYLMa ao6g== 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:from; bh=ArGjVW4oQ7C5SwrlBjOLMgTUCNvN058wc3V7i+UWSxo=; b=P2+pHG8go/YTxK1oiV9oCaIziYd1GSYPo4ykPKHptxyhP95x3f+m9cjCI+vFI4AeRk LgSgXLFsfF3I/s9lQA4sDBrufHJKhQR2S9nxL1DOZbvpJQmd5kQ6NpRAR9WgegQNMx26 9aNd14szWcVy/vnKm3vciaPcjBZlA6UYdI+EW7HvzFH2Ee6QQVcd4UXHUJKIRLKUTvkz b8BDchQB93AF9p9xe69gwURiaF8h2dlJl9zaUEHnGUrhd1Q3GrfdLXqHqR1dgUPdh7Z7 tNNHwDWKQ+leGW0MCjhy3gIN40gnTr23qYE6CbyyY0cDAo0+Erz6BWRS6ja1nf444upF gOaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si2237853edy.582.2020.06.11.15.08.27; Thu, 11 Jun 2020 15:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726270AbgFKWDm (ORCPT + 99 others); Thu, 11 Jun 2020 18:03:42 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:37058 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725869AbgFKWDl (ORCPT ); Thu, 11 Jun 2020 18:03:41 -0400 Received: by mail-qk1-f194.google.com with SMTP id b27so7191456qka.4 for ; Thu, 11 Jun 2020 15:03:40 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=ArGjVW4oQ7C5SwrlBjOLMgTUCNvN058wc3V7i+UWSxo=; b=hvNS/GrbsIHtDzvSneE134GQ3hF7Wid6M89QMBNx87JQBdDR/+03X4y9MKv8xy78L8 2Qbw8MIHT95SLgDtBz97Ql0+3YrBtFqm1g31q2rUzcBPOTVXL61FkCrpb3UQVfhHFZdP PnVCKrgEfGCEG7RvCpa2vdAmc773+ZNakkDDPsCd7pocDzqfvyNBphmWK9Nyl8MBQ6gM w9E3d1kUfCAOOeX3wdBG3hcvXKMY5mgUCv5exXqVHIW8fE8221G/HdyNHzjbpE8GJdkl blisGxTpCSTwCpjLb1HDoz+Iwv/yioYDGb0RJoe+YnLzieQ4S7Os7nqG4Ujl4g8VDbxt aCfg== X-Gm-Message-State: AOAM530iXDff3JT9HETil2V7GlKJn9Aj6RG7L3H6YYf9fFJz3SKeefCH K/RcrWC9L5/rZelDDE0YynI= X-Received: by 2002:a37:3d2:: with SMTP id 201mr138413qkd.64.1591913020455; Thu, 11 Jun 2020 15:03:40 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id u25sm3411338qtc.11.2020.06.11.15.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 15:03:39 -0700 (PDT) From: Arvind Sankar To: Masahiro Yamada Cc: Nick Desaulniers , Fangrui Song , Rong Chen , kernel test robot , kbuild-all@lists.01.org, LKML Subject: [PATCH v2] Makefile: Improve compressed debug info support detection Date: Thu, 11 Jun 2020 18:03:39 -0400 Message-Id: <20200611220339.3971675-1-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 10e68b02c861 ("Makefile: support compressed debug info") added support for compressed debug sections. Support is detected by checking - does the compiler support -gz=zlib - does the assembler support --compressed-debug-sections=zlib - does the linker support --compressed-debug-sections=zlib However, the gcc driver's support for this option is somewhat convoluted. The driver's builtin specs are set based on the version of binutils that it was configured with. It reports an error if the configure-time linker/assembler (i.e., not necessarily the actual assembler that will be run) do not support the option, but only if the assembler (or linker) is actually invoked when -gz=zlib is passed. The cc-option check in scripts/Kconfig.include does not invoke the assembler, so the gcc driver reports success even if it does not support the option being passed to the assembler. Because the as-option check passes the option directly to the assembler via -Wa,--compressed-debug-sections=zlib, the gcc driver does not see this option and will never report an error. Combined with an installed version of binutils that is more recent than the one the compiler was built with, it is possible for all three tests to succeed, yet an actual compilation with -gz=zlib to fail. Moreover, it is unnecessary to explicitly pass --compressed-debug-sections=zlib to the assembler via -Wa, since the driver will do that automatically when it supports -gz=zlib. Convert the as-option to just -gz=zlib, simplifying it as well as performing a better test of the gcc driver's capabilities. Reported-by: kernel test robot Signed-off-by: Arvind Sankar --- Makefile | 2 +- lib/Kconfig.debug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 839f9fee22cb..cb29e56f227a 100644 --- a/Makefile +++ b/Makefile @@ -842,7 +842,7 @@ endif ifdef CONFIG_DEBUG_INFO_COMPRESSED DEBUG_CFLAGS += -gz=zlib -KBUILD_AFLAGS += -Wa,--compress-debug-sections=zlib +KBUILD_AFLAGS += -gz=zlib KBUILD_LDFLAGS += --compress-debug-sections=zlib endif diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index cb98741601bd..94ce36be470c 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -229,7 +229,7 @@ config DEBUG_INFO_COMPRESSED bool "Compressed debugging information" depends on DEBUG_INFO depends on $(cc-option,-gz=zlib) - depends on $(as-option,-Wa$(comma)--compress-debug-sections=zlib) + depends on $(as-option,-gz=zlib) depends on $(ld-option,--compress-debug-sections=zlib) help Compress the debug information using zlib. Requires GCC 5.0+ or Clang -- 2.26.2