From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 25FE81B0F19 for ; Wed, 14 Jan 2026 12:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768393583; cv=none; b=eJzyaPLS9kv5kuqeFcbN9gIMTDyfLprSSIp//6qD24x2wccBvAU/XZG+0d83FfD3rftnhpfgqQNH0fxxgMa3c1+xbBOmtrOU15W22lcuSeyMC4G6rTF2akU0C+E7KNF7p6POxMo5BkRrz0ky6sTpyNcepwSYhP+Fs/ncJ/oHG2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768393583; c=relaxed/simple; bh=j+mQoSqzAh5RCYUg705iz2e3cyvLCAFRTNP2daSCz30=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qs39PqS6zRtFzWwvrdftqx/BfcK2RzVmklGtGOIoinkpJeJ1/rHtmFa4pKMpdXSxhS77JgRsHP05Gw+QWGEBga6jbNxk/+H0xPnhP8cxzomm1/ip9dv7I6JT4n/ONI4ZNKcksxqnpIRdolaUutcdP8ZYjH1FrF2KiHtZygcSnGk= 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=C/6uKrsU; arc=none smtp.client-ip=209.85.218.50 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="C/6uKrsU" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b8765b7f4c0so98648366b.0 for ; Wed, 14 Jan 2026 04:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768393579; x=1768998379; 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=Gsd8G2M81+WYoxdkuRC18RhaEdxHWf3NY55zL6lQS6M=; b=C/6uKrsUOGwge9GCxbyHbS4wmwEGpPN3ZYxTRRn4bzV7j0CBMw47eGbYP2/YR34aCk fplhv0Qg8XUkKgDfJwhAQxqRrq2SN3Mteb0EzcKbLBrcLXvXo1F9JLwsMOR8J/hkBUPN PlVGSxtwxr7EG2r7fvsz+E4L+U4aSGYXV3uoLfxaE0p7C222djOqbvhzkqZMAYetF2cY Ebvt8hcI+e0St+0slujWqAf5EGUSxQxThsskcbzqT2pcyj9a16PEivD1smODPoyp675w 4oxksjm6cYKRWwnUosX3EKffCVKjrVVQ5+rgy3OjxygrBUcUpbbTWMZ3kjH04lEtjg57 fsEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768393579; x=1768998379; 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=Gsd8G2M81+WYoxdkuRC18RhaEdxHWf3NY55zL6lQS6M=; b=uxPwyMhA9EzByEWjh41mYCQAyMgSpCikrFCppjPCzgVVBSd3UB8hvN2BR8Qagbsx1W OzzQuEqhKHZ9eOadL7cMOZx7Oa5Bk3oTFZKEAgay+bblatXPnE+CsYqMNmDC/XljFWns vzQ624AeekAvFc0Q9aApn1KSvikyEYUdK8Yatxlf8HY7cKgf/6/PVt1yvCaziiGiw6BD Ga5GlOoUSdrRBH2Jl91c73f0FHjW7yfGPxyi12kC1JUEMAJzgoHVg5wIcyM2+wSucMRJ 1/dAWwWCWPd91CKO8vBEX/z2hz5uP9TE1lPPZ0MY2RwBioXxVKPMtyraKEvvbe5LssBV Xdzw== X-Forwarded-Encrypted: i=1; AJvYcCWM2V1GW2nk9TmhUaukfzmBJOiGHDRy+qBqEaJ4x7SnZBtnzAC/KQQdonhxfhei/UzkPFZKJLpKeBljfUQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzW9HWJdLFxr8PRW7iawTUH1XBolmY+LcbPTEykksHnolhuhipR PU1UVjo80YoFT8EYfbip+Wpd3hqkXzLkQ2RpCnnMaoUKTnxCS5xWA4Gw66zr3g== X-Gm-Gg: AY/fxX6LOJupbwz1Pvgik5ScLtyxBhrSOrI+3b5mmapvpwJ7qbuAOm6xXt7syrr/9Wu swt9nqei5AhF2dK+OsMIyX+VPwIDn0lGaFP8aEa1R2zegfIXbqOP8NdvdtAowA/ORTV6zpNnsps hG3jtnLvaKlnBljN2/Ie7FcUz9wcCH0SFg9sfBWXCEuO8DZM2VQhPWnTMCLdBZDmoDnPFb7s3mI RjjE/bSKrXn0SqPRd8kPUwBwS56c3GwGXr9ah5lNkhCOdneKkInx6eGP1MrDvqveJnIP1qEyHKQ qF/MgD5mdLbV7amgHENVk668DzavX+yMAwsJIdaZWZzg5GW8OadvO0++TW37DzrsAgo+K66hcPC Kmy/nXrp2qBNh7V6f997GcOTQAIjwdfqmugG2yPoqz4GhsNPloZQhk/Xm+QqXY2alMo8n0bf9YC hYXYaFdi637Ko+hFSsdxj9bQlnw4dO9vwsx/BdPjdRlq2SZ/UiBfj2 X-Received: by 2002:a05:600c:c16a:b0:46f:d682:3c3d with SMTP id 5b1f17b1804b1-47ee32f14ddmr22777885e9.13.1768386665307; Wed, 14 Jan 2026 02:31:05 -0800 (PST) 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-47ee5914232sm24680845e9.14.2026.01.14.02.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 02:31:05 -0800 (PST) Date: Wed, 14 Jan 2026 10:31:03 +0000 From: David Laight To: "Maciej W. Rozycki" Cc: kernel test robot , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Andrew Morton , Linux Memory Management List , Nicolas Pitre , linux-mips@vger.kernel.org, Thomas Bogendoerfer Subject: Re: mips64-linux-ld: div64.c:undefined reference to `__multi3' Message-ID: <20260114103103.216aa122@pumpkin> In-Reply-To: References: <202601140146.hMLODc6v-lkp@intel.com> <20260113200455.3dffe121@pumpkin> 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 Wed, 14 Jan 2026 06:19:02 +0000 (GMT) "Maciej W. Rozycki" wrote: > On Tue, 13 Jan 2026, David Laight wrote: > > > > All errors (new ones prefixed by >>): > > > > > > mips64-linux-ld: lib/math/div64.o: in function `mul_u64_add_u64_div_u64': > > > div64.c:(.text+0x84): undefined reference to `__multi3' > > > >> mips64-linux-ld: div64.c:(.text+0x11c): undefined reference to `__multi3' > > > > > > > This looks like a bug in the mips 'port'. > > arch/mips/lib/multi3.c has the comment: > > > > /* > > * GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for > > * that specific case only we implement that intrinsic here. > > * > > * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981 > > */ > > #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8) > > > > So this code is excluded for gcc 8.5 but the compiler is generating the call. > > > > Looking at the git log for that file there is a comment that includes: > > "we wouldn't expect any calls to __multi3 to be generated from > > kernel code". > > Not true.... > > Not sure why the link didn't fail before though, something subtle must > > have changed. > > > > I think the fix is just to remove the gcc version check. > > Or rather fix the version check. The GCC fix went in with GCC 10: Does that mean the GCC 10 generates the multiply instructions and never calls __multi3? (Rather than just not using __multi3() for that specific example.) In this case gcc knows the high bits are all zero - so just needs the two instructions to generate the high and low parts. David > > $ git log -1 --pretty=oneline 48b2123f6336 > 48b2123f6336ba6c06846d7c8b60bd14eaeae7ec re PR target/82981 (unnecessary __multi3 call for mips64r6 linux kernel) > $ git show 48b2123f6336:gcc/BASE-VER > 10.0.0 > $ > > I don't know why the PR got it all wrong; I've fixed it now. > > Maciej >