Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4478581rwl; Wed, 28 Dec 2022 04:51:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaJ3PCfCXyKHe9qUuOrXt9BXHuQgFlP3EQSrD1xAmk1GdNMkfDXSTUjKWcpeT2MYIY99qh X-Received: by 2002:a05:6a20:2a01:b0:a2:17a6:44cd with SMTP id e1-20020a056a202a0100b000a217a644cdmr29606021pzh.58.1672231907713; Wed, 28 Dec 2022 04:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672231907; cv=none; d=google.com; s=arc-20160816; b=ClPYpesBg8Xjal/6qRCvQr/jDUthvQutrF4l425AMMC1SSklSJGFkS3U9yoyWa6zWJ M1bTNtRxjNvS0Vn6S57KymQ93GhUJivZRz7jVCn7MIEGkncLMwiq/UTfGDlj5zDZUsXa 7nYBVhJj+PdSSEvbGs93Hn84C4GKu7zLTNH+D2FnfGxpXV1BUtoxGgrA4sF1auClYdaJ EES/g0J5aRHOfm7wO4UX7wbdDF3UIw4zuVOzhI93YaV7Ue4bVw1YImXTDsWF2fFqLux+ LO7GLf6Ox01jSLnhB25KU+QyjZJchbfUMmGPYJkhTLThq9+E4zAUdAYLIg5vgGn89Bbz Rstw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=bW1PGClHTWfEeOwMdfkxgteA4yAaYdNV1mnuj28PxXg=; b=hiA5TnRbcXuZDtSdxCAqSdZUF5dZ1HIR5uGWe1NWLnYmYRjFwW5t5bQkmJPK+FagZ+ j0TcdzrDTX/+2gzQAffiPfZnVVPC9XeEq5M9UoUDXJRCrQnG+k6Aicl46/hou0iZmARf 76b4Gx/dgIdzr72aIeZbENjtgAzCa5SbbarIEcYUvlFCVXbOd2rKz6YPW+Qv7Lpl3WkV Pjk3TBu5AVb0YqJkZW3/OtpHK8bpJqiocyKdOQRbNeIg8FfJ2lMA5fvSAPfefoOHt5YH j9c5ve59wZvhXdtVgtyL+1w3yxST6P8r2WG7gGNDpt1UHtbDiAzKyujpuzwtGBcU3Pm1 +Eqw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd7-20020a056a00278700b00576abbc404esi16324481pfb.238.2022.12.28.04.51.39; Wed, 28 Dec 2022 04:51:47 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232883AbiL1Mbq (ORCPT + 64 others); Wed, 28 Dec 2022 07:31:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230398AbiL1Mbi (ORCPT ); Wed, 28 Dec 2022 07:31:38 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB45460E3 for ; Wed, 28 Dec 2022 04:31:36 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NhrQ4631dz9t2b; Wed, 28 Dec 2022 20:27:40 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 28 Dec 2022 20:31:33 +0800 To: "x86@kernel.org" , linux-kernel CC: "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , Dave Hansen , From: Miaohe Lin Subject: [BUG Report] undefined reference to `convert_to_fxsr' Message-ID: <50aa72a7-043d-8091-78de-458cbcc6c356@huawei.com> Date: Wed, 28 Dec 2022 20:31:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 all: When I compile the mainline kernel v6.2-rc1, the below link error occurs: ld: arch/x86/kernel/fpu/signal.o: in function `__fpu_restore_sig': /home/linmiaohe/linux-next/arch/x86/kernel/fpu/signal.c:421: undefined reference to `convert_to_fxsr' make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1 make: *** [Makefile:1252: vmlinux] Error 2 make: *** Waiting for unfinished jobs.... I think it's because convert_to_fxsr() is only defined when CONFIG_X86_32 or CONFIG_IA32_EMULATION is enabled. But it can be call from __fpu_restore_sig() via below path: bool fpu__restore_sig(void __user *buf, int ia32_frame): if (!IS_ENABLED(CONFIG_X86_64) && !cpu_feature_enabled(X86_FEATURE_FPU)) { success = !fpregs_soft_set(current, NULL, 0, sizeof(struct user_i387_ia32_struct), NULL, buf); } else { success = __fpu_restore_sig(buf, buf_fx, ia32_fxstate); /* Will call convert_to_fxsr() later. */ } __fpu_restore_sig() will call convert_to_fxsr() even if neither CONFIG_X86_32 nor CONFIG_IA32_EMULATION is enabled. So the link error occurs. But I'm not really sure how to fix it. Any reply or fix is appreciated. Thanks, Miaohe Lin