mbox series

[v2,0/2] MIPS: dec: Only check -msym32 when need compiler

Message ID F49F5EE9975F29EA+20250214094758.172055-1-wangyuli@uniontech.com (mailing list archive)
Headers show
Series MIPS: dec: Only check -msym32 when need compiler | expand

Message

WangYuli Feb. 14, 2025, 9:47 a.m. UTC
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.