Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3123628rdb; Tue, 6 Feb 2024 07:49:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfW6hhBe+DdFxYEJlGIsRCbjQGHMYncdQ7KaqKjP2wYVkdTdUWxg/buAmdCe094UT1lmKq X-Received: by 2002:a17:902:eed2:b0:1d9:e1aa:c44 with SMTP id h18-20020a170902eed200b001d9e1aa0c44mr1211959plb.32.1707234593490; Tue, 06 Feb 2024 07:49:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707234593; cv=pass; d=google.com; s=arc-20160816; b=06gnG6PD+IirTAhoiuaOgLFx1FPyhrjlhxiUBVteaOSIbOugr6lkXwNditpk3HdLAW Jul0AOOCTLpTNQJKcwTLibsWxNrH7uwL/sb7Se/0fsNgX6TZEJC/f3nbusntDZUJPpLG FWJ78paTHihJOFjJYKIE6fA1+pp1R8DUjrh8wWqaFwcixMlw1I6BXaYEfwSO2lHuod8o ej27XHe6L0yIGnaolcSXcSUZqJwGKcZM64SbzYfnw5asx1rjqAgu/HYs84E6LmT/ZVJs 7A7ApkfzKnjQPO/AjLnHT4DMCkR3FCEMlPd99D8ciERbV1gx8lFdqVeJHQAIET/e9908 kCiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ByG4w3+p3pgSknmJ/EcNhTWuQ37ESYrqEa184hqMrWc=; fh=fyg3yK+mJVn8eEY1Nwj9a6qCB+gGNFpnx2xt+eJeKWo=; b=WJ4S+XAf9rUgvTWsQ+3ySnF82bIDlr8SwNs9TCjzJcPOoAg3KjMIBxttNpJQ45aQKa RZ71IiHwp7iSw6As4QnRB34OyID98vlCoFl+WoWFZY8KAzH8Ban8AJdZfz35ZwfRPRbZ pGVaoelvAkI2wBYbj1PCdltopMrSzKM2E49QUT2LYJGgJA9WiULzrjQt1/KEpFYVCzOF d6PVtJJ5V+gnxOnKb1zroI77HyBvSdkfIoPcJDmjG4yQzG3/PHrTVzLlBRKUgS985kGX gHRrW1BVSHhmx3gOqBwQGaawNDCE4Yxmz2ayI3O3r95HVcK//E8J3BtTOyBzqeOeJyak 1NrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Rak93+G/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55276-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVIOSR7VXGT8IKuWXORuL+y13RGFbqPniC+OOhh3NGijFEc9Jcf+YvGDSInCtroTbJpii2XLHRauUr1+ePmr/crL60H8El2EzA+nhEImA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j2-20020a170902da8200b001d5ea445244si1885631plx.483.2024.02.06.07.49.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:49:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55276-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Rak93+G/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55276-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E8F73281E30 for ; Tue, 6 Feb 2024 15:48:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 736E71339A2; Tue, 6 Feb 2024 15:48:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rak93+G/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 911A413341C; Tue, 6 Feb 2024 15:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707234517; cv=none; b=UqBwEW918OR0u9KWLUAn1z41HC9uO9Pqi91PknsDoZhSgkqe28sdTMBoYsO7Fs386Q/l5TlK9leKoHwRK/xNyDmnOUSLvAY5pXrOMYjD3NXDOWlL/Ird5KHY93emMG/IwFhl0rIX0Fs8vPZhSSts0qsBjyEihQm9eFvTX/8pRZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707234517; c=relaxed/simple; bh=zaZSsrvYhW5Ke2AYAmP/ja6WNn71gyudEVeXSINNEsM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dQ5j7qr3f5UarF+KCPt9P3+82A57mhL3TTPjrmuELMlj2yg6S34v0CAL+SuitC/ak/rWtuQiADYWEtK1wYtz/6XgGHRti7NC61hIV85MwmDloIO+t4WN/ZK83Op8Y9KhPqaxMmuvOo+BTPqCZeAwSsduKb0XH9/wVS2P7Eyld4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rak93+G/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C145DC433F1; Tue, 6 Feb 2024 15:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707234517; bh=zaZSsrvYhW5Ke2AYAmP/ja6WNn71gyudEVeXSINNEsM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rak93+G/BJ5ORjKtT7vFG8fmk8Bwt1Ix0jXOncUPNsLpN5JcRXpcq/uuHxMwGa/OC BYwc2bIZqVoxeBRDy7aR8m8/RFB9RT3u0qBiuS6IU+lD22qZEkv3nZ/fJWTw3PoXvV 6foJCiRNwclykXHNvYaVMgcc7sNrxJT5WIaaRXgfTdulEZ+jJGkE1g1yC4CMENy324 iYCsdeZUGt+6gl00zho0VjeUgWgp6TRcs6qepB3mDA8pxDgZJAiGbnK2H1FEwJqZPQ VKzIxtuCY6zo1MDzmfE3t+sG4xvBD97LH/lfhZU6UpYS9F9ZlIO29kTHaIN+CIHpWb ObfJEzis5v/TA== Date: Tue, 6 Feb 2024 08:48:35 -0700 From: Nathan Chancellor To: Daniel Bristot de Oliveira Cc: Steven Rostedt , Masami Hiramatsu , Nick Desaulniers , Bill Wendling , Justin Stitt , Donald Zickus , stable@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 1/6] tools/rtla: Fix Makefile compiler options for clang Message-ID: <20240206154835.GA1433705@dev-arch.thelio-3990X> References: <567ac1b94effc228ce9a0225b9df7232a9b35b55.1707217097.git.bristot@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <567ac1b94effc228ce9a0225b9df7232a9b35b55.1707217097.git.bristot@kernel.org> On Tue, Feb 06, 2024 at 12:05:29PM +0100, Daniel Bristot de Oliveira wrote: > The following errors are showing up when compiling rtla with clang: > > $ make HOSTCC=clang CC=clang LLVM_IAS=1 > [...] > > clang -O -g -DVERSION=\"6.8.0-rc1\" -flto=auto -ffat-lto-objects > -fexceptions -fstack-protector-strong > -fasynchronous-unwind-tables -fstack-clash-protection -Wall > -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 > -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized > $(pkg-config --cflags libtracefs) -c -o src/utils.o src/utils.c > > clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument] For what it's worth, this flag is supported in clang 17.0.0 and newer: https://github.com/llvm/llvm-project/commit/610fc5cbcc8b68879c562f6458608afe2473ab7f But if it is not critical, just dropping the flag like you have done here rather than conditionally supporting it is probably easier. > warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option] > 1 warning generated. > > clang -o rtla -ggdb src/osnoise.o src/osnoise_hist.o src/osnoise_top.o > src/rtla.o src/timerlat_aa.o src/timerlat.o src/timerlat_hist.o > src/timerlat_top.o src/timerlat_u.o src/trace.o src/utils.o $(pkg-config --libs libtracefs) > > src/osnoise.o: file not recognized: file format not recognized > clang: error: linker command failed with exit code 1 (use -v to see invocation) > make: *** [Makefile:110: rtla] Error 1 > > Solve these issues by: > - removing -ffat-lto-objects and -Wno-maybe-uninitialized if using clang > - informing the linker about -flto=auto > > Cc: stable@vger.kernel.org > Fixes: 1a7b22ab15eb ("tools/rtla: Build with EXTRA_{C,LD}FLAGS") > Suggested-by: Donald Zickus > Signed-off-by: Daniel Bristot de Oliveira > --- > tools/tracing/rtla/Makefile | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile > index 2456a399eb9a..afd18c678ff5 100644 > --- a/tools/tracing/rtla/Makefile > +++ b/tools/tracing/rtla/Makefile > @@ -28,10 +28,15 @@ FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \ > -fasynchronous-unwind-tables -fstack-clash-protection > WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized > > +ifeq ($(CC),clang) > + FOPTS := $(filter-out -ffat-lto-objects, $(FOPTS)) > + WOPTS := $(filter-out -Wno-maybe-uninitialized, $(WOPTS)) > +endif > + > TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) > > CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) > -LDFLAGS := -ggdb $(EXTRA_LDFLAGS) > +LDFLAGS := -flto=auto -ggdb $(EXTRA_LDFLAGS) > LIBS := $$($(PKG_CONFIG) --libs libtracefs) > > SRC := $(wildcard src/*.c) > -- > 2.43.0 >