Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Bradley Morgan <brads@mainlining.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	kernel test robot <lkp@intel.com>
Cc: Josh Law <objecting@objecting.org>,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-mips@vger.kernel.org
Subject: Re: arch/mips/boot/compressed/decompress.c:undefined reference to `__ashldi3'
Date: Wed, 30 Sep 2026 20:11:18 +0100	[thread overview]
Message-ID: <B2E9C8DD-202A-4C86-B349-C0FCCE3AF17B@mainlining.org> (raw)
In-Reply-To: <20260930120159.7e4f29a82d461bd8b040454e@linux-foundation.org>

On 30 September 2026 20:01:59 BST, Andrew Morton
<akpm@linux-foundation.org> wrote:
>On Wed, 30 Sep 2026 18:36:50 +0200 kernel test robot <lkp@intel.com>
>wrote:
>
>> tree:  
>https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   551c722f40809618230001baccf219193e22fc5a
>> commit: d4dba3b9c03a326cfa73833d6b166aeb442f82b5 lib:
>decompress_bunzip2: fix 32-bit shift undefined behavior
>> date:   6 months ago
>> config: mips-randconfig-r2300-20260930
>(https://download.01.org/0day-ci/archive/20260930/202609301826.MFaFMsmd-lkp@intel.com/config)
>> compiler: mips-linux-gcc (GCC) 15.2.0
>> sparse: v0.6.5-rc1
>> reproduce (this is a W=1 build):
>(https://download.01.org/0day-ci/archive/20260930/202609301826.MFaFMsmd-lkp@intel.com/reproduce)
>> 
>> If you fix the issue in a separate patch/commit (i.e. not just a new
>version of
>> the same patch/commit), kindly add following tags
>> | Fixes: d4dba3b9c03a ("lib: decompress_bunzip2: fix 32-bit shift
>undefined behavior")
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes:
>https://lore.kernel.org/oe-kbuild-all/202609301826.MFaFMsmd-lkp@intel.com/
>> 
>> All errors (new ones prefixed by >>):
>> 
>>    mips-linux-ld: arch/mips/boot/compressed/decompress.o: in function
>`get_bits':
>> >> arch/mips/boot/compressed/decompress.c:(.text+0xf4): undefined
>reference to `__ashldi3'
>> >> mips-linux-ld: arch/mips/boot/compressed/decompress.c:(.text+0x168):
>undefined reference to `__ashldi3'
>
>I dunno, I'd be suspecting a toolchain issue here?
>
>--- a/lib/decompress_bunzip2.c
>+++ b/lib/decompress_bunzip2.c
>@@ -135,7 +135,7 @@ static unsigned int INIT get_bits(struct bunzip_data *bd, char bits_wanted)
> 		}
> 		/* Avoid 32-bit overflow (dump bit buffer to top of output) */
> 		if (bd->inbufBitCount >= 24) {
>-			bits = bd->inbufBits&((1 << bd->inbufBitCount)-1);
>+			bits = bd->inbufBits & ((1ULL << bd->inbufBitCount) - 1);
> 			bits_wanted -= bd->inbufBitCount;
> 			bits <<= bits_wanted;
> 			bd->inbufBitCount = 0;
>@@ -146,7 +146,7 @@ static unsigned int INIT get_bits(struct bunzip_data *bd, char bits_wanted)
> 	}
> 	/* Calculate result */
> 	bd->inbufBitCount -= bits_wanted;
>-	bits |= (bd->inbufBits >> bd->inbufBitCount)&((1 << bits_wanted)-1);
>+	bits |= (bd->inbufBits >> bd->inbufBitCount) & ((1ULL << bits_wanted) - 1);
> 
> 	return bits;
> }
>
>32-bit MIPS should be able to do this?
May I ask why I got CCed in this..??
--- Thanks!
"I'm not a very positive person" - Linus torvalds

  reply	other threads:[~2026-09-30 19:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202609301826.MFaFMsmd-lkp@intel.com>
2026-09-30 19:01 ` arch/mips/boot/compressed/decompress.c:undefined reference to `__ashldi3' Andrew Morton
2026-09-30 19:11   ` Bradley Morgan [this message]
2026-10-01 10:30   ` Pedro Falcato
2026-10-02  1:07     ` Andrew Morton
2026-10-02  9:53     ` David Laight

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=B2E9C8DD-202A-4C86-B349-C0FCCE3AF17B@mainlining.org \
    --to=brads@mainlining.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=objecting@objecting.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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