From patchwork Fri Feb 14 09:47:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WangYuli X-Patchwork-Id: 13974691 Received: from smtpbg150.qq.com (smtpbg150.qq.com [18.132.163.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC2EE253B46; Fri, 14 Feb 2025 09:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.132.163.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739526536; cv=none; b=O078vjHXt4KxtpSmphS2xeFC5aNtWF038FVlrUjb9VkzCu3ng5vSeMMVrrZcTOcyjsvhQwA2H6uLpt+l8O+yMy0XJK+vizDaUeJzUPa6GbjIk1u8KJKPrTYFrNo5Lm/u/K2k3resgI3EuUioEk+DLti7JXKQ6Ikb0nDC9g2enCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739526536; c=relaxed/simple; bh=O/8DIOSl5f/Y31KM1037Yj7JP2uqjIWVBVFxogazJiU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RrUqcPxMncwjJycLAnV8kLCvW6WNoDYw7xXRT+uvuwRabWGwMJ/wQ8DwHZryc53qGfNQjXuDAj4D52gHUQummLKFIQIqj9t8vDJfkZiPeN8bbHXrwzIt22QM4L0I3Mlmnc7VWuE38YJe+RiXn+IbQelqrny+QfexX7pc0K4AWRU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=VGWfD1X2; arc=none smtp.client-ip=18.132.163.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="VGWfD1X2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1739526496; bh=NAnqMvpz3CgMXnHWGFEBjzdavwVkEzeTJ0xJecoflYw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=VGWfD1X2NFjRTxsb3x5d2n94r2fkvs1BY9rvVS8O+9ASPXtQVkVH51//ZKVlV9OD8 bX0L+I7uho62jqadSSrWvVkXWv62+KERXT0JLqU9Z93cGXQEHr3uMUcUrNT7lGyL/o d9+ENqqOPcJDKAOMPWGYwtxTuY+UG5ZXhYorv4NA= X-QQ-mid: bizesmtpip2t1739526484tw7hc1n X-QQ-Originating-IP: hzoQEaX1BdaUZ8Hg3TePiaMBVM3pnsJ+6yBRy4x28Y8= Received: from localhost.localdomain ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 14 Feb 2025 17:48:02 +0800 (CST) X-QQ-SSF: 0002000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 14775040142801817448 From: WangYuli To: tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, macro@orcam.me.uk, masahiroy@kernel.org, zhanjun@uniontech.com, niecheng1@uniontech.com, guanwentao@uniontech.com, chenlinxuan@uniontech.com, WangYuli Subject: [PATCH v2 0/2] MIPS: dec: Only check -msym32 when need compiler Date: Fri, 14 Feb 2025 17:47:58 +0800 Message-ID: X-Mailer: git-send-email 2.47.2 Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpip:uniontech.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-QQ-XMAILINFO: N3iD438OGJ7hGK0Na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J7JmCjis3RsCQ2EbA7eHPNA= X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= X-QQ-RECHKSPAM: 0 During make modules_install, the need-compiler variable becomes null, so Makefile.compiler isn't included. This results in call cc-option-yn returning nothing. To get rid of spurious "CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32" error, just wrap it into `ifdef need-compiler'. Moreover, I also identified an unnecessary check for KBUILD_SYM32 in this Makefile section. Eliminate it for code simplification. NOTE: It is particularly important to note that this code fix does not imply that we have resolved the problem entirely. In fact, the entire application of cc-option and its auxiliary commands within the kernel codebase currently carries significant risk. When we execute make modules_install, the Makefile for the corresponding architecture under arch/subarches/Makefile is invariably included. Within these files, there are numerous usages of cc-option and its auxiliary commands, all of which will return empty strings. The reason other architectures can successfully complete compilation under these circumstances is purely because they do not, unlike MIPS, check the return values of cc-option and its auxiliary commands within their Makefiles and halt the compilation process when the expected results are not received. A feasible approach to remediation might be to encapsulate all usages of cc-option and its auxiliary commands within conditional statements across all architecture Makefiles, preventing their execution entirely during make modules_install. However, this would lead to a massive number of inelegant modifications, and these broader implications may require deliberation by Masahiro Yamada. Regardless, this does not preclude us from addressing the issue on MIPS first. Link: https://lore.kernel.org/all/41107E6D3A125047+20250211135616.1807966-1-wangyuli@uniontech.com/ WangYuli (2): MIPS: dec: Only check -msym32 when need compiler MIPS: Eliminate Redundant KBUILD_SYM32 Checks arch/mips/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- Changelog: *v1->v2: 1). Correct semantic errors. 2). Adopted a revised fix: Using a check for need-compiler in place of KBUILD_SYM32 check. 3). Swap the order of the changes in v1.