Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1049738rwb; Thu, 1 Dec 2022 11:37:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5R+MIQBYUHgSCvoMrF+2W9TFpN1MTAtsc7D3xgOUgVVTMq9hITlFJN6QB2A47y803i8iti X-Received: by 2002:a63:225d:0:b0:477:beb8:70f8 with SMTP id t29-20020a63225d000000b00477beb870f8mr36284466pgm.281.1669923465346; Thu, 01 Dec 2022 11:37:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669923465; cv=none; d=google.com; s=arc-20160816; b=wkLqNbpX9ELtzj8ncFSQgpeGPX8BnPy959B3doNNscw9EPlt9B/xdYNUpu11g05n/A IACZu2MtPWFNXmqd3OO/BBM7fC4GeHb64T3t0xAJHZQo+HNrM8FF4u57lWEWu2zXLxNU biL2ueylZQiDGTDMrfTAMatuQeJN5SDYIzAOPOrS71CbhSJLmEVRy/m4d+PBOQ+QBHHU ZE0RuHKA1rgU0PJon29telPuEAfpgHeXiXza+IeeVbEDW4Y59KcFg5HFin5X9XyR2e0I kI1fP4QA4yl1KMgyGp+oB31WXpP5t5ccgEuC1L/VsbFzgO480+7VriJGKmqKYuGqfN1Z CaLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zYaRO9PI35gTzGhdOcV/YfgtlN9nUtye2NlqF+jNYQw=; b=tyr6GxtkXb0UXAM1oBoCYqktXTKw/O6z9ni4m0kGilRBsog8qG9TXia8SEbVNOHC9o LpVI8Ho58k4soXRE24+1Wsf91onfRQ0KcdSyov+8wB9JKpBQGzfVuW7BUXTFnei5+mAk S/fKs2xUV8wP3bn9ceDKAis9shR6Hft8vkqEmSYG5k6uasAH3eckGORAwL/lFI2oHr7Q yrRxxZAWWsOm367qQTPY8cfvCTyPhrne99heioQd4RkKj0se2mLEedoL1qwKXZQ7MnEl fgHJJ5r3wRo79yzeRNGpYRhvE7rr9eJ2yCsF2QwdS2rdWMCSjzCWQuy+xE7rT5UHiF++ +pgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UjkeQFrz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020a63ee16000000b0043c8ce98a7bsi5069714pgi.802.2022.12.01.11.37.32; Thu, 01 Dec 2022 11:37:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UjkeQFrz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230016AbiLASjj (ORCPT + 82 others); Thu, 1 Dec 2022 13:39:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbiLASji (ORCPT ); Thu, 1 Dec 2022 13:39:38 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06642A432F for ; Thu, 1 Dec 2022 10:39:35 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id c1so3828506lfi.7 for ; Thu, 01 Dec 2022 10:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zYaRO9PI35gTzGhdOcV/YfgtlN9nUtye2NlqF+jNYQw=; b=UjkeQFrz3QbcPwePtkweRC9KPQatIUo5z9lOW+pGcGhVY1w1yCZtpcdR8VUoeYPTE5 mmioLfxQ/aeWCG/Faap+lW2Ds8eDFr+wEsKVWm46pF7ubrfCHHwRa0IldK0GVjD0oLJv wjEMe4DDqqv4EesQUpK4ERPqjvN6NOFd6sbghESf2CDlW/raN58zfAHmqPaAQleKPg8s CwSbArBoDAasWP+DE5tegBu1abcO1sXLgSvYnBMy11O7D2k7TAxT+Bybt0GjhdBvvmDA hjNLX6E2JnMPFBK+GPhm9UjjKLo6I3P8gFyO+jH6tdWK5zwl3nkvhfLm+csXwwEhvWxp jQ/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zYaRO9PI35gTzGhdOcV/YfgtlN9nUtye2NlqF+jNYQw=; b=OkZPirxGK5rO611/F/dto/VaCGdJQOoHgWCQHurGjvukv1JDaT/EU3PufLCm7c61Fu 1P1WlrL7hzn3jP0QgZXtGZ0PYyxi5blWbGUURmTTV+tikOkuPIBQexyiBNj2XXZKToZV YQeWO5niy+VeOSudxUODyTOL/mtiSdfu6E5Fr0wQ8IDGWnBXndL19L/xl6029haveCYz Hzp9fhSO8YWWFtGXm+CEe033k3e3SQN33rhS742rZK+vZdrRFihCTcuaZGNaXJX8T+4M he7JoYSc7og0t1gPRLitodTxWhnopqFIM1iNV9QCT1qcjIEiXMfauzjSSjgC/sgDcMwL owpA== X-Gm-Message-State: ANoB5pn3IL7+lTIqyqGW3ZLqYilOLMS0pjMCQogdAn9LKo9hn/cGsSpZ PvEDulMVzhuqLtmgFkTJ1axcNLC5voNwN0Ch4Ht4Nj3g7Zc= X-Received: by 2002:a05:6512:708:b0:4a2:6d30:fef2 with SMTP id b8-20020a056512070800b004a26d30fef2mr17308367lfs.324.1669919973147; Thu, 01 Dec 2022 10:39:33 -0800 (PST) MIME-Version: 1.0 References: <202212010140.pIueEBNb-lkp@intel.com> <20221201091610.524f7786@xps-13> <20221201171331.42f05097@xps-13> In-Reply-To: <20221201171331.42f05097@xps-13> From: Mikhail Zhilkin Date: Thu, 1 Dec 2022 21:39:22 +0300 Message-ID: Subject: Re: ld.lld: error: undefined symbol: __udivdi3 To: Miquel Raynal , Nathan Chancellor Cc: kernel test robot , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, NOGUCHI Hiroshi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miqu=C3=A8l, Nathan, On 12/1/2022 7:13 PM, Miquel Raynal wrote: > Hi Nathan, > > nathan@kernel.org wrote on Thu, 1 Dec 2022 09:00:57 -0700: > >> On Thu, Dec 01, 2022 at 09:16:10AM +0100, Miquel Raynal wrote: >>> Hi Mikhail, Hiroshi, >>> >>> lkp@intel.com wrote on Thu, 1 Dec 2022 01:46:36 +0800: >>> >>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux= .git master >>>> head: 01f856ae6d0ca5ad0505b79bf2d22d7ca439b2a1 >>>> commit: 9b78ef0c7997052e9eaa0f7a4513d546fa17358c mtd: parsers: add sup= port for Sercomm partitions >>>> date: 6 months ago >>>> config: mips-randconfig-r033-20221128 >>>> compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 6= e4cea55f0d1104408b26ac574566a0e4de48036) >>>> reproduce (this is a W=3D1 build): >>>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/= sbin/make.cross -O ~/bin/make.cross >>>> chmod +x ~/bin/make.cross >>>> # install mips cross compiling tool for clang build >>>> # apt-get install binutils-mipsel-linux-gnu >>>> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin= ux.git/commit/?id=3D9b78ef0c7997052e9eaa0f7a4513d546fa17358c >>>> git remote add linus https://git.kernel.org/pub/scm/linux/kern= el/git/torvalds/linux.git >>>> git fetch --no-tags linus master >>>> git checkout 9b78ef0c7997052e9eaa0f7a4513d546fa17358c >>>> # save the config file >>>> mkdir build_dir && cp config build_dir/.config >>>> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross= W=3D1 O=3Dbuild_dir ARCH=3Dmips SHELL=3D/bin/bash >>>> >>>> If you fix the issue, kindly add following tag where applicable >>>> | Reported-by: kernel test robot >>>> >>>> All errors (new ones prefixed by >>): >>>> >>>>>> ld.lld: error: undefined symbol: __udivdi3 >>>> >>> referenced by scpart.c >>>> >>> mtd/parsers/scpart.o:(scpart_parse) in archive dr= ivers/built-in.a >>>> >>> Can you please try to reproduce this with a mips toolchain as advised >>> and send a fix? >> For what it's worth, this is likely our bug: >> >> https://github.com/ClangBuiltLinux/linux/issues/1635 >> >> It sounds like there are some merged LLVM patches that should help but I >> guess not based on this report... > Ah, yeah, thanks a lot for the share. > > Cheers, Miqu=C3=A8l I could reproduce the issue and found that reference to __udivdi3 appears in this function: static uint32_t scpart_desc_is_valid(struct sc_part_desc *pdesc) { return ((pdesc->part_id !=3D 0xffffffffUL) && (pdesc->part_offs !=3D 0xffffffffUL) && (pdesc->part_bytes !=3D 0xffffffffUL)); } There is no LLVM compiler error if: static uint32_t scpart_desc_is_valid(struct sc_part_desc *pdesc) { return (0); } Currently I have no ideas where does __udivdi3 come from, because there's no division here. Should I try to rewrite somehow the function to avoid the error? I would greatly appreciate any ideas. -- Best regards, Mikhail