Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1676216rwi; Thu, 3 Nov 2022 07:56:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IpF5Ee/V9MEjoiqnF1VBF3kZOZGOQUtvhfemZhEZKeaq+nEf/kkrojeuGBZsg/7adM4J3 X-Received: by 2002:a17:907:8688:b0:791:91a0:fdb3 with SMTP id qa8-20020a170907868800b0079191a0fdb3mr28726863ejc.499.1667487400667; Thu, 03 Nov 2022 07:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487400; cv=none; d=google.com; s=arc-20160816; b=IT5kNlvKI15YrDcY+LViWBHNBtL5gkrHWCT1jFTVDoJ+MCMNyLpk5+l/nqoU7taYV/ hACS1XhFDO21CicY1g5B3MWKmt3XauArUMBV18bqa6IPz6CLwF3wZUn6sBj5urUTgRca MUtn0Rzz7W+OG98km5P3cOYw2xEOuUaL0zI/ehyYYYCKuog3CDqBbNlVv7FxpyEgIWXZ t7DgVNgOhg15Fds7P3wInlaA521NSQLdI4FGtBYWmOw+mDrZxDhfT0AQYS8PVUo0BQON sisu7CHbfrxQXQUHWCN/z/VUl0zPyZdwlDNMzL17DONeU2RW9W7MGb5aOGCC85fdh0PK w25Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=TuNM2rHD3sRB+ox8RBaC7f6+XLb7VfNR657ErBE+mys=; b=y4ccugk1F48iU3BEO21DuJ77z5+ZcJyeLfZH9rNyBOb+37CaNm6uOOVf/CXvVgqXOT fVYNSmxuLRE/KW1S+k89YVzCBYtC4s6FFCgy6r8WPejcX1OGezmx0nYvFSmov9OJyhOt n7oDA6MDz493PhxVDoRJo354JsKM/roTmFs3nsM9t7o2I2ZHt/r8cKgMGHMb16frBsPv l4kAL5JgulYByQmNbpFPqny5ttvI8ZGtUrKLLK5CjUTwgKuH2w0W2GIuxiATWaf3xKcV VqQ+DP3oqgmOx982BqX9PsUpM2t25SnsqO313paocSkXg4o/Mv/S95LOkoZA6BXx4auK rIXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WsDBF+vx; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a1709065d0e00b0078e11a20640si655317ejt.2.2022.11.03.07.56.16; Thu, 03 Nov 2022 07:56:40 -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=@nifty.com header.s=dec2015msa header.b=WsDBF+vx; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231731AbiKCOs0 (ORCPT + 97 others); Thu, 3 Nov 2022 10:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbiKCOsY (ORCPT ); Thu, 3 Nov 2022 10:48:24 -0400 Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7992E0D; Thu, 3 Nov 2022 07:48:22 -0700 (PDT) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 2A3Elfk5019027; Thu, 3 Nov 2022 23:47:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 2A3Elfk5019027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1667486862; bh=TuNM2rHD3sRB+ox8RBaC7f6+XLb7VfNR657ErBE+mys=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WsDBF+vxaUubH4L3pg4hCsLNJRA2ad7z+JyxDAwDCsnw4WCfmlGz/IsiJx4dCwBWU O0mwmUErZC029A8CUSnlaYrCQ2Q2iQf1VRwm48D+Cr38ir0LYnt6YLlUnkI825ec+6 SaZj34joRpg76JodABZ/KHzlVUdZGEHMCwiWoYr1Nub3FmDWeZhUZQobHEsG4SuMnw q1II9bTPghm7f7aoiU5ABjjekGT7Grpy9layb533jmWrCUzLdGLgHgKUhWDIwhxsT4 kWbdPixcXDHsfDm6JIxuymEmCTBpRWoXGYd0KSH8AZ9ah2wHt4nRJZzobKWXztZLeP 5dIMv8WEFt3ng== X-Nifty-SrcIP: [209.85.167.175] Received: by mail-oi1-f175.google.com with SMTP id p127so2155204oih.9; Thu, 03 Nov 2022 07:47:41 -0700 (PDT) X-Gm-Message-State: ACrzQf0OFVOe2U5L+6vSeWKU1VwDR3B3ULiAPivxFgFbT6WJ2re22eff 3g+FNEXz/P+hg6V5B4MDQkWrETnPcORkZ2YoxNw= X-Received: by 2002:a05:6808:1893:b0:359:f7c7:1caf with SMTP id bi19-20020a056808189300b00359f7c71cafmr13748303oib.194.1667486860713; Thu, 03 Nov 2022 07:47:40 -0700 (PDT) MIME-Version: 1.0 References: <20221102091308.11568-1-masahiroy@kernel.org> <9fe8615c-fe31-ebf7-09bd-453fae189666@kernel.org> In-Reply-To: <9fe8615c-fe31-ebf7-09bd-453fae189666@kernel.org> From: Masahiro Yamada Date: Thu, 3 Nov 2022 23:47:04 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] kbuild: pass objects instead of archives to linker To: Jiri Slaby Cc: Ard Biesheuvel , linux-kbuild@vger.kernel.org, Michael Matz , Kees Cook , Sami Tolvanen , Fangrui Song , Michal Marek , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 Thu, Nov 3, 2022 at 4:22 PM Jiri Slaby wrote: > > On 02. 11. 22, 10:44, Masahiro Yamada wrote: > > Jiri Slaby reported that the (not-upstreamed) GCC-LTO tree got broken > > due to 321648455061 ("kbuild: use obj-y instead extra-y for objects > > placed at the head") > > > > https://lore.kernel.org/linux-kbuild/ea468b86-abb7-bb2b-1e0a-4c8959d23f1c@kernel.org/ > > > > > > I am not pretty sure because I did not check the downstream code. > > > > > > If I understood his report correctly, the reason for the breakage is > > because I put all objects into the thin archive, expecting > > the linker would preserve the object order in the archive. > > > > By specifying the object order directly in the command line, > > GCC-LTO should get back working again. > > ... > > > I think my patch is unneeded (hence RFC), but I just wanted to know > > if linkers (gnu ld and lld) see any difference. > > Yes, including your patch (instead of vmlinux.S and /compressed/* > changes) also fixes the issue. So the linker (gcc-ld) indeed respects > command line, but not order of objects in .a. > Can I see your LTO implementation somewhere in public? I know Andy Kleen's GCC-LTO, the latest version is 5.13-ish. https://github.com/andikleen/linux-misc.git > thanks, > -- > js > suse labs > -- Best Regards Masahiro Yamada