From: Vineet Gupta <vineet.gupta@linux.dev>
To: Dinh Nguyen <dinguyen@kernel.org>,
Simon Schuster <schuster.simon@siemens-energy.com>,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>
Cc: Sasha Levin <sashal@kernel.org>,
linux-kernel@vger.kernel.org, Vineet Gupta <vgupta@kernel.org>
Subject: Re: [PATCH v3 0/3] lib: Add software mul/div helpers and use them from nios2
Date: Tue, 17 Nov 2026 09:05:03 -0800 [thread overview]
Message-ID: <41664890-337a-402e-895f-376c941d83f2@linux.dev> (raw)
In-Reply-To: <69073cae-ced9-407d-ba96-e55fc7635735@kernel.org>
On 11/16/26 5:19 AM, Dinh Nguyen wrote:
> On 11/10/26 09:58, Simon Schuster wrote:
>> Recently, there have been linking failures on nios2 regarding libgcc
>> symbols that we reexport to modules (in particular __mulsi3 [0], and
>> __divsi3_table [1]).
>>
>> In the resulting discussion, Arnd suggested [2] dropping the libgcc
>> dependency altogether, as -- while specific functions might be fine --
>> libgcc does not expect to run in a kernel-like freestanding environment.
>>
>> To this end, Dinh Nguyen was kind enough to locate and extract
>> GPLv2-compliant versions of the software mul/div/mod functions required
>> by nios2 gcc and integrate them into the kernel. As Arnd also suggested
>> [3] that these might be helpful to other smaller architectures (such as
>> arc or openrisc), I've further extracted them to lib/ with corresponding
>> CONFIG_GENERIC_LIB_* options that allow selectively enabling and
>> exporting these as required.
>>
>> The patch series compiles mostly^4 fine in a nios2 allyesconfig
>> without modpost errors; a quick boot test on a regular build also
>> completed successfully.
>>
>> Best regards,
>> Simon
>>
>> 0: https://lore.kernel.org/lkml/20261019-nios2-mulsi3-v1-1-4fd75b1bacef@linutronix.de/
>> 1: https://lore.kernel.org/lkml/20261026234452.1086974-1-sashal@kernel.org/
>> 2: https://lore.kernel.org/lkml/686f4ca2-0fb6-4a73-9cdb-0edcccafdd62@app.fastmail.com/
>> 3: https://lore.kernel.org/lkml/426c73b7-b4dc-4b68-9aa5-6145a13280bc@app.fastmail.com/
>> 4: There seems to be an unrelated issue in linux-next regarding
>> CONFIG_PNFS_BLOCK. Furthermore -Wno-attribute-alias
>> -Wno-missing-prototypes -Wno-missing-declarations and
>> -Wno-unused-function were required due to unrelated Werror-related
>> compilation issues; but as this series concerns compiler intrinsics
>> that are never explicitly referenced in code and it links fine this
>> seems acceptable to me.
>>
>> Signed-off-by: Simon Schuster <schuster.simon@siemens-energy.com>
>> ---
>> Changes in v3:
>> - Switch __udivsi3 and __umodsi3 signature from s32 to u32 as requested
>> by Vineet Gupta in <bba7f6da-82ee-46cc-bd8f-b0e3e027f5e2@kernel.org>
>> - Link to v2: https://lore.kernel.org/r/20261103-nios2-remove-usage-of-libgcc-v2-0-5fabbedc49ec@siemens-energy.com
>>
>> Changes in v2:
>> - Reorganised to directly add to lib/* skipping arch/nios2/lib/math.c
>> - Dropped __gcc_bcmp as it is not actually needed
>> - Link to v1: https://lore.kernel.org/r/20261030-nios2-remove-usage-of-libgcc-v1-0-4e341c66082e@siemens-energy.com
>>
>> ---
> If there are no further comments on this patchset, I can pull it in?
>
> Thanks,
> Dinh
Sorry got busy. I will test this for ARC tonight. Also can this go via
Arnd's tree - I can post a followup for ARC which uses P1 so everything
can go together. Or he can a stable tag or branch of yours, whatever works.
Thx,
-Vineet
next prev parent reply other threads:[~2026-11-17 17:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 15:58 Simon Schuster
2026-11-10 15:58 ` [PATCH v3 1/3] lib: extract 32bit mul/div helpers from nios2 into GENERIC_LIB Simon Schuster
2026-11-10 15:58 ` [PATCH v3 2/3] nios2: export __divsi3_table Simon Schuster
2026-11-10 15:58 ` [PATCH v3 3/3] nios2: Drop usage of libgcc in favour of GENERIC_LIB_* Simon Schuster
2026-11-16 13:19 ` [PATCH v3 0/3] lib: Add software mul/div helpers and use them from nios2 Dinh Nguyen
2026-11-17 17:05 ` Vineet Gupta [this message]
2026-11-17 17:08 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41664890-337a-402e-895f-376c941d83f2@linux.dev \
--to=vineet.gupta@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dinguyen@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=schuster.simon@siemens-energy.com \
--cc=vgupta@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®