Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3414766rwd; Mon, 22 May 2023 13:26:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ovwYqv4PII07nCt4amtZ01kjtDU4FT2ZW2aLaAkx0cL9i7XxRlEfH/OBua7ylN7ixnEhR X-Received: by 2002:a17:90a:ce8a:b0:253:25c3:7a95 with SMTP id g10-20020a17090ace8a00b0025325c37a95mr16521909pju.14.1684787161465; Mon, 22 May 2023 13:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684787161; cv=none; d=google.com; s=arc-20160816; b=MONWuGOF34SFIWYVEs+/2yGwOlwZVGAA6CeCRGf+V1QQjpP6SoIjxMiFXYykkCp4eI yR5WO2+s24T/jJxoyvPoQD5CR0sj99iI8AUXGJvnvz3h0sp42vqKB4m1UboJh96sbzHE X2u0s2vsjbth3oDCrErq48+sCMCAYWb+/JoWA7kt31WjJ7IAph3mfSEmMZk8fgC9bCrK 8yYz2g86PRVoJFbEMrwASm3zaxvW/ZjZMv0+kwAlut9MZbqOEPa8noXMvtTETqRRRZvQ qaEW8wVUwD8+LG3kdUk2FHGTMGENZt6irGU9dIOQaNU5voK+sYmWjP6GGmd9QeviNKzm nQpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IavG5x23h2YHs0rMXS8JpDpv3YQJN4qq/DR8NCv0cQQ=; b=PrIvL7f9yDjynMEpFLR2rFnH2jjtjKN6THUWzzU+G11PFEiL3FM+S9H7FqhUou0BXk HXxqKNAhl949VveJVoqh9MStZigKgNEH7I8zg4l/4UPvVDKXTKsWH1PLsPmSqgr4tzus c/A/dClnWnS52KB4gO7iIhbMG/j5zJIXJhWkAD/7jHg7Zx+2pX4BfFNUOD9VbLLGIKqC W9agJp3t4Pv6GEIoE42wY44ork9rRNjYrWwhl+XGzc2pC5u5ktN47hmtBXFFYrkpWmHz mM4zh7+ar/2S8/EgOZU+ylmm8pofVWHF1o7XPezINo13A7x3s8TIXWbWvtFwQjGFFqgS GGxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xcfIjk/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a17090aad8c00b00250ab2f31besi5013471pjq.71.2023.05.22.13.25.45; Mon, 22 May 2023 13:26:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xcfIjk/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235570AbjEVUCG (ORCPT + 99 others); Mon, 22 May 2023 16:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235574AbjEVUB5 (ORCPT ); Mon, 22 May 2023 16:01:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960D5E77 for ; Mon, 22 May 2023 13:01:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10EC762B77 for ; Mon, 22 May 2023 20:01:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF2A4C433D2; Mon, 22 May 2023 20:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684785693; bh=q1rK3nNfauP5adtqxUDXHORtRgAnxyR+eJnFQ5R0jF0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xcfIjk/fciRm77QI0VhJV5h9il1UvqFI/HD2zmYsMqBvEdZ9o386jiOAgRCvimVxV e4B10SMVELOUbdXuG6fGS7PGplTQ3l00pAdhvMx98gkHKSDRUDRGTDCyXQcs1KCqDk bt+fVqpvcQ18ZABu35kITdkahUv5XBIWntV2iNMw= Date: Mon, 22 May 2023 21:01:30 +0100 From: Greg KH To: Nick Desaulniers Cc: Maksim Panchenko , Ricardo =?iso-8859-1?Q?Ca=F1uelo?= , Shreeya Patel , Michal Marek , Masahiro Yamada , Linux Kernel Mailing List , clang-built-linux , Bill Wendling , Nathan Chancellor , regressions@lists.linux.dev, "gustavo.padovan@collabora.com" , Guillaume Charles Tucker , denys.f@collabora.com, kernelci@lists.linux.dev Subject: Re: [PATCH v4] Makefile.compiler: replace cc-ifversion with compiler-specific macros Message-ID: <2023052251-oncoming-glance-f1b0@gregkh> References: <878rdlk9bi.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> <875y8ok9b5.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> <87353ok78h.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> <2023052247-bobtail-factsheet-d104@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 22, 2023 at 12:52:13PM -0700, Nick Desaulniers wrote: > On Mon, May 22, 2023 at 9:52 AM Greg KH wrote: > > > > On Mon, May 22, 2023 at 12:09:34PM +0200, Ricardo Cañuelo wrote: > > > On vie, may 19 2023 at 08:57:24, Nick Desaulniers wrote: > > > > It could be; if the link order was changed, it's possible that this > > > > target may be hitting something along the lines of: > > > > https://isocpp.org/wiki/faq/ctors#static-init-order i.e. the "static > > > > initialization order fiasco" > > > > > > > > I'm struggling to think of how this appears in C codebases, but I > > > > swear years ago I had a discussion with GKH (maybe?) about this. I > > > > think I was playing with converting Kbuild to use Ninja rather than > > > > Make; the resulting kernel image wouldn't boot because I had modified > > > > the order the object files were linked in. If you were to randomly > > > > shuffle the object files in the kernel, I recall some hazard that may > > > > prevent boot. > > > > > > I thought that was specifically a C++ problem? But then again, the > > > kernel docs explicitly say that the ordering of obj-y goals in kbuild is > > > significant in some instances [1]: > > > > Yes, it matters, you can not change it. If you do, systems will break. > > It is the only way we have of properly ordering our init calls within > > the same "level". > > Ah, right it was the initcall ordering. Thanks for the reminder. > > (There's a joke in there similar to the use of regexes to solve a > problem resulting in two new problems; initcalls have levels for > ordering, but we still have (unexpressed) dependencies between calls > of the same level; brittle!). No, the dependencies are explicitly expressed with the linker order. So it's not brittle, but rather very deterministic. When linker order didn't work for all sorts of things, we added different levels, but due to the huge number of init calls, of course can not give each one their own level. It's always been this way with Linux, nothing new here at all :) thanks, greg k-h