--- zzzz-none-000/linux-4.4.271/arch/mips/Makefile 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/arch/mips/Makefile 2023-04-19 10:22:28.000000000 +0000 @@ -76,6 +76,8 @@ all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz +# Build the DT binary blobs if we have OF configured +all-$(CONFIG_USE_OF) += dtbs # # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel @@ -87,11 +89,20 @@ # machines may also. Since BFD is incredibly buggy with respect to # crossformat linking we rely on the elf2ecoff tool for format conversion. # -cflags-y += -G 0 -mno-abicalls -fno-pic -pipe +cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely cflags-y += -msoft-float -LDFLAGS_vmlinux += -G 0 -static -n -nostdlib +LDFLAGS_vmlinux += -G 0 -static -n -nostdlib --gc-sections +ifdef CONFIG_64BIT KBUILD_AFLAGS_MODULE += -mlong-calls KBUILD_CFLAGS_MODULE += -mlong-calls +else +KBUILD_AFLAGS_MODULE += -mno-long-calls +KBUILD_CFLAGS_MODULE += -mno-long-calls +endif + +ifndef CONFIG_FUNCTION_TRACER +KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections +endif # # pass -msoft-float to GAS if it supports it. However on newer binutils @@ -138,6 +149,12 @@ -Wa,-mips32 -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ -Wa,-mips32r2 -Wa,--trap +cflags-$(CONFIG_CPU_24K) += $(call cc-option,-march=mips24kc,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32r2 -Wa,--trap +cflags-$(CONFIG_CPU_34K) += $(call cc-option,-march=mips34kc,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32r2 -Wa,--trap +cflags-$(CONFIG_CPU_74K) += $(call cc-option,-march=mips74kc,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32r2 -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ -Wa,-mips64 -Wa,--trap @@ -209,9 +226,12 @@ # libs-$(CONFIG_FW_ARC) += arch/mips/fw/arc/ libs-$(CONFIG_FW_CFE) += arch/mips/fw/cfe/ +libs-$(CONFIG_MYLOADER) += arch/mips/fw/myloader/ libs-$(CONFIG_FW_SNIPROM) += arch/mips/fw/sni/ libs-y += arch/mips/fw/lib/ +libs-$(CONFIG_AVM_ENHANCED) += arch/mips/avm_enh/ + # # Kernel compression # @@ -281,7 +301,7 @@ head-y := arch/mips/kernel/head.o libs-y += arch/mips/lib/ -libs-y += arch/mips/math-emu/ +libs-$(CONFIG_MIPS_FPU_EMULATOR) += arch/mips/math-emu/ # See arch/mips/Kbuild for content of core part of the kernel core-y += arch/mips/