From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A11533B27EF for ; Mon, 27 Apr 2026 09:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777282168; cv=none; b=hhnjHcD4WV6ko6X/359/4LsQH6x9e2eTosOgzFN/iLJC5REBhQlbOBvWUsWpd2jm5T1ucrZ1BSYZKyTTUxBBfP/JRBi7xSpfPeWjKIF9U2PZ/tbouCvVr1Ozdib0nrgysTXzZmuwwsu+CT/M31nDiCeT/pPwbLWdmIDtnOYd2GY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777282168; c=relaxed/simple; bh=ZOsDGx6yoV0gkgm1H7hTV3PaKBw7ScWEW+1RhAs5+Eo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pj7BNstNM2AfwpgdM4sZSHspaa4rSorwHp9Ftc/Nk5b2W68Oh2SBmxX33dsqoHhInVgP5N+3l497fS8kXWru7QIJV5M3tBC3Nqk90nS8QjnDwbiIr5T7BUks0lVgmokpuEw5Lx6o/A93/HHcY+Bhcn1FfCZU/BHPsTadPJHHnEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QX00PRVc; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QX00PRVc" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4891c0620bcso67485005e9.1 for ; Mon, 27 Apr 2026 02:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777282165; x=1777886965; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=qhBsUsRnxGxteXWit32fczP20HqInrjs7pD4raLih9A=; b=QX00PRVcrvL4RniLDn0smz2QwrBAv2SiGwmg8tR39QhPrPnCIIk11pF76K+MbkiNHF O3fasHkmTdNEXFR73W9tFk0Cj1flUycP0l7ymr/SttW4mhLcaaRsv9RGXsUbqHFu2nrl lPekFGZIU5iCuCh2JvqNCwqPFzYmlXi/SaArH2KLA7WMGtJJXh47UXNrAqpYvr+f6K4h oJ9H8qghj2izMbmsKQi5fJnADJok2lB3u25Tcb/+XC2lL0yrB69orMsMyFNcGWhlJiTH aNdmbnllj0XqstKWjsSqKrfCWi4Y+wFLYnJSicFU22OEuI1VRjX/0PGuDp6/ogcUaTL7 RWQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777282165; x=1777886965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qhBsUsRnxGxteXWit32fczP20HqInrjs7pD4raLih9A=; b=q2MbzTuDuAMWvSznxf+P4vydVV8Bx+q577drTfPYalCLJpWmk45NTuTvZDsHTf2i1O 3eCTZw9jS71hCT1oZjHOomd+9JJVCr82kPbmq34wGT2URzFa0V/vpRru3RejACVcyHjS oc4GX5dnyt8rVMhm/KBZa8/BBQBjaSyiWmE7GilfaNLvJYQsJc4M2UTSgQx5rHZkpiKF h9KecHMbH7h+1LFG0AUkG2tU9tbsfEgbhEdUvCBaBhs/VKd0GOQAX70yzDq8rKO/uq6v gGhSLJR6xmZGOUqx1NKl5e47B6nfYl/dOcTl6I1McMyT17bwzgKB0oTpeEYkanKGCSfr IgmQ== X-Forwarded-Encrypted: i=1; AFNElJ/pYtsD2Rczploq9sfo1K4MrJXi3zj6sD9eNvcu7eUvN438b/WvAeZDWfvEDUtNuLTTXxKo4kBFU8zB9tg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4DWEvW+E1e/oYt7dLaCrt2FynqQJ4yfLW2spc1pdelDgVGZRa E6f79SEx1vl+hYmbTdtE1CMqnrK2Q+S+JARMi/ftPK84isj2a3lQKYSq X-Gm-Gg: AeBDiesewnX0x9fgycRzkYf4kuTKDSb1AW5A1KsHixPE0xzcXlf3Zt6rE7v43gPPiz2 DeXMlnWUNLwmYAqluYiBJLZP5T3iXjmlLJggGQhWKsZi9+eWtlhSYZ5ILWCEook9AeNCw34/Bbq tOUNnaftC6mPLorO5CAOIT2bT26N8neEAxu4/MTB8S99K2F0Rn078MrqdsDAQj5eq7dnW35pHSf cUax2ih2Op6E2lroOWSXY2VDZ/Xw52/YUNCO97dDFeEr9fr6fatgo/CzB0Xkdru6ndBaCLV44+F Jirlw8sHKTrm2eYCw7tFVdpe2HrDWnK0lrqcJWkbm64+z6x9y0BypC0gjjIGtS9XdEtWtdXqUqw 1NO+Is74sCXE3FXReaOVql70lmcZfVvxf4iornLCwAUyt7sMpswCBVFR+BaW6L4ruFNg/xFPG9E ZC5kKHOcUMLJSEYsgxuAqVfVKbYcfr2ZIuDafFU0EditQP/SHRRibiPyspbSE90Og7MvUlsECHx 4k= X-Received: by 2002:a05:600c:c177:b0:486:fb0b:ad79 with SMTP id 5b1f17b1804b1-488fb78129emr534667615e9.20.1777282164670; Mon, 27 Apr 2026 02:29:24 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7ac6aasm249078295e9.25.2026.04.27.02.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 02:29:24 -0700 (PDT) Date: Mon, 27 Apr 2026 10:29:22 +0100 From: David Laight To: Dmitry Antipov Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrew Morton , Andy Shevchenko , Charlie Jenkins , Alexandre Ghiti , Ard Biesheuvel , linux-riscv@lists.infradead.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 3/3] riscv: fix building compressed EFI image Message-ID: <20260427102922.08d0bcda@pumpkin> In-Reply-To: <20260425185151.477442-4-dmantipov@yandex.ru> References: <20260425185151.477442-1-dmantipov@yandex.ru> <20260425185151.477442-4-dmantipov@yandex.ru> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 25 Apr 2026 21:51:50 +0300 Dmitry Antipov wrote: > When building vmlinuz.efi with CONFIG_EFI_ZBOOT enabled, > '__lshrdi3()' is also needed to fix yet another link error: > > riscv32-linux-gnu-ld: drivers/firmware/efi/libstub/lib-cmdline.stub.o: in function `__efistub_.L49': > __efistub_cmdline.c:(.init.text+0x202): undefined reference to `__efistub___lshrdi3' > > And since riscv64 can have CONFIG_EFI_ZBOOT but doesn't need > these library routines, rely on CONFIG_32BIT to manage linking > of lib-ashldi3.o and lib-lshrdi3.o on riscv32 only. > > Reported-by: Charlie Jenkins > Closes: https://lore.kernel.org/linux-riscv/20260409050018.GA371560@inky.localdomain > Tested-by: Charlie Jenkins > Suggested-by: Ard Biesheuvel > Signed-off-by: Dmitry Antipov > --- > v6: adjust to match recent upstream changes > v5: rely on CONFIG_32BIT rather than dedicated Kconfig symbol (Ard) > v4: use more meaningful CONFIG_EFI_ZBOOT_USE_LIBGCC and adjust tags (Andy) > v3: initial version to join the series > --- > drivers/firmware/efi/libstub/Makefile | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile > index 983a438e35f3..e1c11d02a5cb 100644 > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -95,7 +95,9 @@ CFLAGS_zboot-decompress-gzip.o += -I$(srctree)/lib/zlib_inflate > zboot-obj-$(CONFIG_KERNEL_ZSTD) := zboot-decompress-zstd.o lib-xxhash.o > CFLAGS_zboot-decompress-zstd.o += -I$(srctree)/lib/zstd > > -zboot-obj-$(CONFIG_RISCV) += lib-clz_ctz.o lib-ashldi3.o > +zboot-obj-$(CONFIG_RISCV) += lib-clz_ctz.o > +zboot-riscv-obj-$(CONFIG_32BIT) += lib-ashldi3.o lib-lshrdi3.o > +zboot-obj-$(CONFIG_RISCV) += lib-clz_ctz.o $(zboot-riscv-obj-y) Doesn't that specify lib-clz_ctz.o twice ? I think you could also use: zboot-obj-$(CONFIG_RISCV) += lib-clz_ctz.o $(if $(CONFIG_32BIT),lib-ashldi3.o lib-lshrdi3.o) David > zboot-obj-$(CONFIG_LOONGARCH) += lib-clz_ctz.o lib-ashldi3.o > lib-$(CONFIG_EFI_ZBOOT) += zboot.o $(zboot-obj-y) >