From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86A07C77B73 for ; Mon, 22 May 2023 16:52:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233265AbjEVQwy (ORCPT ); Mon, 22 May 2023 12:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbjEVQww (ORCPT ); Mon, 22 May 2023 12:52:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0239F1 for ; Mon, 22 May 2023 09:52:51 -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 3D04C6252A for ; Mon, 22 May 2023 16:52:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28B6CC433D2; Mon, 22 May 2023 16:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684774370; bh=vOQbWWEEqd8EQVksWSFEy4waMaZII1vIhTX3SzTbbko=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e3MLFpG2OoR6zPuYXlOFRm68JelSBH0QDndXPwKeHRgL9+reSIMdQe6CNgI/cfc9f miDxNritVnfcvqwuHDuMk5Rn/GbaQD+om4+8MowbFMZnHWSN9ZE0shhe5sjt+9/A0J BNSZ2iolJWZw8v1cc/eom6LTzfCJ1k1NevOLgfiI= Date: Mon, 22 May 2023 17:52:32 +0100 From: Greg KH To: Ricardo =?iso-8859-1?Q?Ca=F1uelo?= Cc: Nick Desaulniers , 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: <2023052247-bobtail-factsheet-d104@gregkh> References: <17c91d37-7d9c-0df4-2438-2b30ca0b5777@collabora.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87353ok78h.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". thanks, greg k-h