Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2343425rdb; Mon, 5 Feb 2024 03:50:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIhbsxG50uOsTtR4ifBV+kxYsb08QmzYQEkbYbqxvevm5v37wVPwi6/O/ec7QOxOIk7xN7 X-Received: by 2002:a05:6402:2903:b0:560:3bcc:a5c0 with SMTP id ee3-20020a056402290300b005603bcca5c0mr2671826edb.4.1707133833667; Mon, 05 Feb 2024 03:50:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707133833; cv=pass; d=google.com; s=arc-20160816; b=VRMdZTo+08znbqlBso7SBN/GBYWOnahMMokd//Cnf29uPq4FktmxRTFuz7G5i6e867 lSmWURo8AIVt3S96kzm79wZ42uiQ9TAz3sKe3cttcfEcH8NPXWvXvmOA//u29hHE5zds ZO1QFhoa1U8sqKA+UHoAz0YySiNC6ZFSeNw3oDCVxg/MjCUvsGKhgnF5WCbq/5yNMawX 4uF0JG9xFHRiJ19Hv4inJ6uL62mA6btJlb//Yh8RXNeJ0uDimn13gyBiAdUXDdhKdjts y6rox+FZGP0aTwrjJnBzwFEg/J9WqRqRVYGeQYlIobpYIiT/AZ6T5WNKQZ2SuiPQT8uV VztQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=bq4JnBKH4fcGIQnmBj9NFYLFAco5hbkJPdMheU+N2rg=; fh=zWgzAXSItZ2v8hmUQJy9pPUToOOqvcmyZxoQsuRK2ZA=; b=UfL10XR+OrNMWSWPKqoMlTfCTKEcbvnO708+KoHVWUCyVs9UMl/J/13lpjaO1531sX NWnvVxSjo0c1fxu5oCjuRpDK/wY9GAKjzAZYeY10x1pQAenvc7tPFP9UuzcmDgs3aJiD OFxf8oqw154yOyVwrbCTR52EnM16OFjM1FG9tkLiv7/kin4ZqY8xyjFt/CK3TYYye4lD IH2NE4sFDOeXLjtg4avEUX+njAVHqk95Hv8zjMdpCwuVM2kb0QoMKtYp/bBZgoqMBhQX sNnUtO+s6VIh0wwml4TgNZX9ISQOFYcBWOszHF4bQFoOClikJfM/7s2fIRgRtkdVptmV kG8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=qFtnvIwy; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-52520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52520-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVpXmW2Oyf5+wC63yi1Fd/J9bQUEdI2ulvZa/0s0h3pIXcktJyeynlxeqOdJohREtWHYEYtDsnM2vFVRbEy+USEbEaUEsyyGaFW40/Svw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a4-20020a05640213c400b005582e987866si4035607edx.7.2024.02.05.03.50.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 03:50:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=qFtnvIwy; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-52520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52520-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3E7C81F23B5D for ; Mon, 5 Feb 2024 11:50:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32A2B18E27; Mon, 5 Feb 2024 11:50:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="qFtnvIwy" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 2A53D18EAD for ; Mon, 5 Feb 2024 11:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133825; cv=none; b=hCmb/ZWfNm5ioXc65J22NxssBeSKNdqJ6XopNyxkx6JVgC54BK3oZuRmctCuk/sCjXO4m+D4O8eHohxPr16GeMNZ7T/7aVN2BvgrLGzDhoEyUWY7Wp7zpI9xV3NqW8EkBXE7iGfVLINsc2POZAZe11yO1pEMryCaCqMNTmw9AOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707133825; c=relaxed/simple; bh=6XWtce4S7GRyjcwlA6+lanS5MbI/XWrjrzDEdYwxALM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=MT0pMQS5wywRiG3jHyHt8maWZKzCFNFDpBFpStYZhd7MCfd3/AEr5VQJdiAGeZKU640FxhTHQApZxRwbgYb6U+0bWmNhgFNGreOF2tFjCtrZkDnTHyeN/y+EZBZ3oRMIo4+gik4EgxCQm5yhHH55E8yrVaH/eRT7+vM3n7GLodE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=qFtnvIwy; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1707133820; bh=bq4JnBKH4fcGIQnmBj9NFYLFAco5hbkJPdMheU+N2rg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qFtnvIwyatxe9V0C/oa7VXw+9uKeDDekYVIcg/rKdZBKYY+sfNOvrYEXpL0khVtcw xJxX8RBOuz6kcSKoyDZV8Kwl67LBjdGP81LGqiyVTw7dSM4pqsVX8+hCxpgBpTDoey /IdMaHFHuNNzOQKzKQJLIhfeD45omAFespEwvYoeBs9lBNdd25uGXbqSYugZCD6k5l M6kBe7lHCNkHIyHpM3ryw3oaHEA9e/OqDEGDNDQJFDZlSqvO0Cejql5lelNbGxT+qs zDnzji32v67pY5StdX8BM6iyamOfnu160TUsEFx42ek6ozAvZ2qopEN2GwYdcVoVSY tM8FgIe/rKvsw== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (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 mail.ozlabs.org (Postfix) with ESMTPSA id 4TT4SV4yXvz4wcF; Mon, 5 Feb 2024 22:50:18 +1100 (AEDT) From: Michael Ellerman To: Jan Stancek , Nicholas Piggin Cc: Masahiro Yamada , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, jstancek@redhat.com Subject: Re: [PATCH] powerpc: add crtsavres.o to always-y instead of extra-y In-Reply-To: References: <20231120232332.4100288-1-masahiroy@kernel.org> Date: Mon, 05 Feb 2024 22:50:17 +1100 Message-ID: <87v873870m.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jan Stancek writes: > On Tue, Nov 21, 2023 at 10:51:34AM +1000, Nicholas Piggin wrote: >>On Tue Nov 21, 2023 at 9:23 AM AEST, Masahiro Yamada wrote: >>> crtsavres.o is linked to modules. However, as explained in commit >>> d0e628cd817f ("kbuild: doc: clarify the difference between extra-y >>> and always-y"), 'make modules' does not build extra-y. >>> >>> For example, the following command fails: >>> >>> $ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules >>> [snip] >>> LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko >>> ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory >>> make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 >>> make[2]: *** [Makefile:1844: modules] Error 2 >>> make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 >>> make: *** [Makefile:234: __sub-make] Error 2 >>> >> >>Thanks. Is this the correct Fixes tag? >> >>Fixes: d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux") >> >>Hmm, looks like LLD might just do this now automatically for us >>too without --save-restore-funcs (https://reviews.llvm.org/D79977). >>But we probably still need it for older versions, so we still need >>your patch. > > Hi, > > I'm still seeing the error of crtsavres.o missing when building external modules > after "make LLVM=1 modules_prepare". Should it be built also in archprepare? Or modules_prepare? Example patch below. cheers diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 051247027da0..82cdef40a9cd 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -59,6 +59,11 @@ ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy) KBUILD_LDFLAGS_MODULE += --save-restore-funcs else KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o + +crtsavres_prepare: scripts + $(MAKE) $(build)=arch/powerpc/lib arch/powerpc/lib/crtsavres.o + +modules_prepare: crtsavres_prepare endif ifdef CONFIG_CPU_LITTLE_ENDIAN