From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 936AC3858C53 for ; Tue, 13 Sep 2022 12:59:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 936AC3858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id EBB4B300089; Tue, 13 Sep 2022 12:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1663073979; bh=104gS9Nvde+AjI58slCh/r3Lex8Aukg6FA5pjcCP6fQ=; h=From:To:Cc:Subject:Date:Message-Id:Mime-Version: Content-Transfer-Encoding; b=XyktzVk1Ri+IpmaAZP03pnE/tepSHtg5Jy94R4TqOG3zQ3mhGW/APrWynmyNzx75g iTOWq+H07X3YNoAeKlCKN+dmrvFJ5avlEemX/xnv///no0sETxioWsjMeWh0tvEDOB GGjP8L5SjSHYWYuCl6/NEb6jl5beyn6C7mfrFZ70= From: Tsukasa OI To: Tsukasa OI , Nick Clifton , Jan Beulich Cc: binutils@sourceware.org Subject: [PATCH 0/1] bfd: Stop using -Wstack-usage=262144 when built with Clang Date: Tue, 13 Sep 2022 12:59:35 +0000 Message-Id: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, [Common Background: Building GNU Binutils / GDB with Clang 15.0.0] I'm now testing to build GNU Binutils / GDB with latest Clang (15.0.0) and found some errors by default (when Binutils / GDB is not configured with "--disable-werror"). While the best compiler to build GNU Binutils / GDB is GNU GCC, testing other compilers are helpful to discover underlying problems and modernize Binutils / GDB, even if building entire Binutils / GDB with the latest Clang is unrealistic. To be sure, I'm not going to finish "porting for Clang". I will take low-hanging fruits and... 1. make building with Clang easier and/or 2. fix code issues (or non-issues) discovered as Clang warnings. I made four patchsets in which, applying them all makes it possible to build GNU Binutils / GDB with Clang (without help of --disable-werrors) for many (but not all) targets including i386 and RISC-V with Ubuntu 22.04 LTS (x86_64) host. At least, I think they fix all (at minimum, most of) arch- independent parts which prevents building with the latest version of Clang. This is the one of them. [About this Patchset] Some components of GNU Binutils will pass "-Wstack-usage=262144" when "GCC >= 5.0" is detected. However, Clang does not support "-Wstack-usage", despite that related configuration part in bfd/warning.m4 handles the latest Clang as "GCC >= 5.0". The option "-Wstack-usage" was ignored when the first version of Clang is released but even this "ignoring" behavior is removed before Clang 4.0.0. So, if we give Clang "-Wstack-usage=262144", it generates a warning, making the build failure. With this patchset, GNU Binutils no longer appends "-Wstack-usage=262144" if the compiler is identified as Clang (when __clang__ is defined). I also regenerated related "configure" scripts with maintainer mode. Thanks, Tsukasa Tsukasa OI (1): bfd: Stop using -Wstack-usage=262144 when built with Clang bfd/configure | 18 ++++++++++++++++++ bfd/warning.m4 | 6 ++++-- binutils/configure | 18 ++++++++++++++++++ gas/configure | 18 ++++++++++++++++++ gold/configure | 18 ++++++++++++++++++ gprof/configure | 18 ++++++++++++++++++ ld/configure | 18 ++++++++++++++++++ opcodes/configure | 18 ++++++++++++++++++ 8 files changed, 130 insertions(+), 2 deletions(-) base-commit: 8fa9bc6a030c9a41eb8cf6f0f66043e02005b291 -- 2.34.1