From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 2683C3857C4F for ; Tue, 9 Apr 2024 12:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2683C3857C4F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2683C3857C4F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712667388; cv=none; b=gv+3hqrSagANWj5fhQJ1WZ53VGm0aLk+/XI9iPrMPn0nakukb8uKCm4473oZz0jNdv8g8B/mH2sFobpzeRJbvZZwBCocwOCrFQhBm8VDYwnTw+kHwXslg/QW6t/+q7dPjGbWa/l3Cn22sRg7rt4fGyNGkK05y8MNJrf5um/Hq28= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712667388; c=relaxed/simple; bh=XbnvrazUtzDvZLFAGVH8sAxR3Vor8+p5Bx74M0AV91c=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=W7w/8sctgpsk3DUxYiiTRFWeZxtlBFuTlc61llmP3tnXyXL5eURCy7+8PUNRQdfatP2RKW2FvTuW0XJ0XaHGs+1SJhZM0C0IxwVgZ3PZ62cb3ZoFa64YD1X3kBhahv3TDR3Q1spiILN22jMOhMUmW+v4ZiCu4mzwzt5zkswyPTg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.5.241] (unknown [10.168.5.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0CD37209D9; Tue, 9 Apr 2024 12:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712667384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gDzvXHzIW1upgHbyo7XgnFdFHB33mvfIy2xV8b2t/Y8=; b=KvBLJDS+j/QFGMlmOKQYmNmbLkQeYiVRplzoV2mocKoudaQn+X+UzbayxUXHZ4x1ntOX2K P5kXmYN4c7J8lamGTXHs5VKLmv+fYJ9kS7LLkoU1Qo3T9jAjxnlYn3Ss8bRNx36roAeIW9 mivsEiYSf1DdnvQjULhkddJZD+Xj9uo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712667384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gDzvXHzIW1upgHbyo7XgnFdFHB33mvfIy2xV8b2t/Y8=; b=Np9xJEWBg/KV5Ai4IuPyoHvSKZ5nsaWOkOpTNHTmJSXYpMT+WBbEpF68OH05jJu3iStEqy kQCjdMLw7MVnDDAA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712667384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gDzvXHzIW1upgHbyo7XgnFdFHB33mvfIy2xV8b2t/Y8=; b=KvBLJDS+j/QFGMlmOKQYmNmbLkQeYiVRplzoV2mocKoudaQn+X+UzbayxUXHZ4x1ntOX2K P5kXmYN4c7J8lamGTXHs5VKLmv+fYJ9kS7LLkoU1Qo3T9jAjxnlYn3Ss8bRNx36roAeIW9 mivsEiYSf1DdnvQjULhkddJZD+Xj9uo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712667384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gDzvXHzIW1upgHbyo7XgnFdFHB33mvfIy2xV8b2t/Y8=; b=Np9xJEWBg/KV5Ai4IuPyoHvSKZ5nsaWOkOpTNHTmJSXYpMT+WBbEpF68OH05jJu3iStEqy kQCjdMLw7MVnDDAA== Date: Tue, 9 Apr 2024 14:56:23 +0200 (CEST) From: Richard Biener To: Jan Hubicka cc: gcc-patches@gcc.gnu.org, Jakub Jelinek Subject: Re: [PATCH] lto/114655 - -flto=4 at link time doesn't override -flto=auto at compile time In-Reply-To: Message-ID: <2o3s98q9-17p3-8s32-q1o8-r25r9n1q6820@fhfr.qr> References: <20240409124949.31FE93858289@sourceware.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -1.85 X-Spam-Level: X-Spamd-Result: default: False [-1.85 / 50.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-0.55)[80.83%]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[lto-wrapper.cc:url] X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP 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: On Tue, 9 Apr 2024, Jan Hubicka wrote: > > The following adjusts -flto option processing in lto-wrapper to have > > link-time -flto override any compile time setting. > > > > LTO-boostrapped on x86_64-unknown-linux-gnu, testing in progress. > > > > OK for trunk and branches? GCC 11 seems to be unaffected by this. > > > > Thanks, > > Richard. > > > > PR lto/114655 > > * lto-wrapper.cc (merge_flto_options): Add force argument. > > (merge_and_complain): Do not force here. > > (run_gcc): But here to make the link-time -flto option override > > any compile-time one. > Looks good to me. I am actually surprised we propagate -flto settings > from compile time at all. I guess I never tried it since I never > assumed it to work :) We do magic now ;) I think this was done because while people manage to use CFLAGS=-flto they eventually fail to adjust LDFLAGS and without plugin auto-loading you won't get LTO and in particular not -flto=auto. I checked that it now works as expected - fortunately -v now displays the make invocation command, so it was easy to verify. Richard.