~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/riscv/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/riscv/Makefile (Version linux-6.12-rc7) and /arch/alpha/Makefile (Version linux-4.17.19)


  1 # This file is included by the global makefile !!   1 #
  2 # architecture-specific flags and dependencies !!   2 # alpha/Makefile
  3 #                                                   3 #
  4 # This file is subject to the terms and condit      4 # This file is subject to the terms and conditions of the GNU General Public
  5 # License.  See the file "COPYING" in the main      5 # License.  See the file "COPYING" in the main directory of this archive
  6 # for more details.                                 6 # for more details.
  7 #                                                   7 #
                                                   >>   8 # Copyright (C) 1994 by Linus Torvalds
                                                   >>   9 #
  8                                                    10 
  9 LDFLAGS_vmlinux := -z norelro                  !!  11 NM := $(NM) -B
 10 ifeq ($(CONFIG_RELOCATABLE),y)                 << 
 11         LDFLAGS_vmlinux += -shared -Bsymbolic  << 
 12         KBUILD_CFLAGS += -fPIE                 << 
 13 endif                                          << 
 14 ifeq ($(CONFIG_DYNAMIC_FTRACE),y)              << 
 15         LDFLAGS_vmlinux += --no-relax          << 
 16         KBUILD_CPPFLAGS += -DCC_USING_PATCHABL << 
 17 ifeq ($(CONFIG_RISCV_ISA_C),y)                 << 
 18         CC_FLAGS_FTRACE := -fpatchable-functio << 
 19 else                                           << 
 20         CC_FLAGS_FTRACE := -fpatchable-functio << 
 21 endif                                          << 
 22 endif                                          << 
 23                                                << 
 24 ifeq ($(CONFIG_CMODEL_MEDLOW),y)               << 
 25 KBUILD_CFLAGS_MODULE += -mcmodel=medany        << 
 26 endif                                          << 
 27                                                << 
 28 export BITS                                    << 
 29 ifeq ($(CONFIG_ARCH_RV64I),y)                  << 
 30         BITS := 64                             << 
 31         UTS_MACHINE := riscv64                 << 
 32                                                << 
 33         KBUILD_CFLAGS += -mabi=lp64            << 
 34         KBUILD_AFLAGS += -mabi=lp64            << 
 35                                                << 
 36         KBUILD_LDFLAGS += -melf64lriscv        << 
 37                                                << 
 38         KBUILD_RUSTFLAGS += -Ctarget-cpu=gener << 
 39                             -Cno-redzone       << 
 40 else                                           << 
 41         BITS := 32                             << 
 42         UTS_MACHINE := riscv32                 << 
 43                                                << 
 44         KBUILD_CFLAGS += -mabi=ilp32           << 
 45         KBUILD_AFLAGS += -mabi=ilp32           << 
 46         KBUILD_LDFLAGS += -melf32lriscv        << 
 47 endif                                          << 
 48                                                << 
 49 ifndef CONFIG_RISCV_USE_LINKER_RELAXATION      << 
 50         KBUILD_CFLAGS += -mno-relax            << 
 51         KBUILD_AFLAGS += -mno-relax            << 
 52 ifndef CONFIG_AS_IS_LLVM                       << 
 53         KBUILD_CFLAGS += -Wa,-mno-relax        << 
 54         KBUILD_AFLAGS += -Wa,-mno-relax        << 
 55 endif                                          << 
 56 # LLVM has an issue with target-features and L << 
 57 # Ensure it is aware of linker relaxation with << 
 58 # be incorrect: https://github.com/llvm/llvm-p << 
 59 else ifeq ($(CONFIG_LTO_CLANG),y)              << 
 60         KBUILD_LDFLAGS += -mllvm -mattr=+c -ml << 
 61 endif                                          << 
 62                                                << 
 63 ifeq ($(CONFIG_SHADOW_CALL_STACK),y)           << 
 64         KBUILD_LDFLAGS += --no-relax-gp        << 
 65 endif                                          << 
 66                                                << 
 67 # ISA string setting                           << 
 68 riscv-march-$(CONFIG_ARCH_RV32I)        := rv3 << 
 69 riscv-march-$(CONFIG_ARCH_RV64I)        := rv6 << 
 70 riscv-march-$(CONFIG_FPU)               := $(r << 
 71 riscv-march-$(CONFIG_RISCV_ISA_C)       := $(r << 
 72 riscv-march-$(CONFIG_RISCV_ISA_V)       := $(r << 
 73                                                << 
 74 ifneq ($(CONFIG_RISCV_ISA_C),y)                << 
 75         KBUILD_RUSTFLAGS += -Ctarget-feature=- << 
 76 endif                                          << 
 77                                                << 
 78 ifdef CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC      << 
 79 KBUILD_CFLAGS += -Wa,-misa-spec=2.2            << 
 80 KBUILD_AFLAGS += -Wa,-misa-spec=2.2            << 
 81 else                                           << 
 82 riscv-march-$(CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ << 
 83 endif                                          << 
 84                                                << 
 85 # Remove F,D,V from isa string for all. Keep e << 
 86 # matching non-v and non-multi-letter extensio << 
 87 KBUILD_CFLAGS += -march=$(shell echo $(riscv-m << 
 88                                                << 
 89 KBUILD_AFLAGS += -march=$(riscv-march-y)       << 
 90                                                << 
 91 # For C code built with floating-point support << 
 92 CC_FLAGS_FPU  := -march=$(shell echo $(riscv-m << 
 93                                                << 
 94 KBUILD_CFLAGS += -mno-save-restore             << 
 95 KBUILD_CFLAGS += -DCONFIG_PAGE_OFFSET=$(CONFIG << 
 96                                                << 
 97 ifeq ($(CONFIG_CMODEL_MEDLOW),y)               << 
 98         KBUILD_CFLAGS += -mcmodel=medlow       << 
 99 endif                                          << 
100 ifeq ($(CONFIG_CMODEL_MEDANY),y)               << 
101         KBUILD_CFLAGS += -mcmodel=medany       << 
102 endif                                          << 
103                                                << 
104 # Avoid generating .eh_frame sections.         << 
105 KBUILD_CFLAGS += -fno-asynchronous-unwind-tabl << 
106                                                << 
107 # The RISC-V attributes frequently cause compa << 
108 # information, so just turn them off.          << 
109 KBUILD_CFLAGS += $(call cc-option,-mno-riscv-a << 
110 KBUILD_AFLAGS += $(call cc-option,-mno-riscv-a << 
111 KBUILD_CFLAGS += $(call as-option,-Wa$(comma)- << 
112 KBUILD_AFLAGS += $(call as-option,-Wa$(comma)- << 
113                                                << 
114 KBUILD_CFLAGS_MODULE += $(call cc-option,-mno- << 
115 KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$( << 
116                                                << 
117 # GCC versions that support the "-mstrict-alig << 
118 # unaligned accesses.  While unaligned accesse << 
119 # RISC-V ISA, they're emulated by machine mode << 
120 # architectures.  It's faster to have GCC emit << 
121 ifneq ($(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCES << 
122 KBUILD_CFLAGS += $(call cc-option,-mstrict-ali << 
123 endif                                          << 
124                                                << 
125 ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)     << 
126 prepare: stack_protector_prepare               << 
127 stack_protector_prepare: prepare0              << 
128         $(eval KBUILD_CFLAGS += -mstack-protec << 
129                                 -mstack-protec << 
130                                 -mstack-protec << 
131                         awk '{if ($$2 == "TSK_ << 
132                                         includ << 
133 endif                                          << 
134                                                << 
135 # arch specific predefines for sparse          << 
136 CHECKFLAGS += -D__riscv -D__riscv_xlen=$(BITS) << 
137                                                << 
138 # Default target when executing plain make     << 
139 boot            := arch/riscv/boot             << 
140 ifeq ($(CONFIG_XIP_KERNEL),y)                  << 
141 KBUILD_IMAGE := $(boot)/xipImage               << 
142 else                                           << 
143 ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAA << 
144 KBUILD_IMAGE := $(boot)/loader.bin             << 
145 else                                           << 
146 ifeq ($(CONFIG_EFI_ZBOOT),)                    << 
147 KBUILD_IMAGE    := $(boot)/Image.gz            << 
148 else                                           << 
149 KBUILD_IMAGE := $(boot)/vmlinuz.efi            << 
150 endif                                          << 
151 endif                                          << 
152 endif                                          << 
153                                                << 
154 boot                                    := arc << 
155 boot-image-y                            := Ima << 
156 boot-image-$(CONFIG_KERNEL_BZIP2)       := Ima << 
157 boot-image-$(CONFIG_KERNEL_GZIP)        := Ima << 
158 boot-image-$(CONFIG_KERNEL_LZ4)         := Ima << 
159 boot-image-$(CONFIG_KERNEL_LZMA)        := Ima << 
160 boot-image-$(CONFIG_KERNEL_LZO)         := Ima << 
161 boot-image-$(CONFIG_KERNEL_ZSTD)        := Ima << 
162 boot-image-$(CONFIG_KERNEL_XZ)          := Ima << 
163 ifdef CONFIG_RISCV_M_MODE                      << 
164 boot-image-$(CONFIG_ARCH_CANAAN)        := loa << 
165 endif                                          << 
166 boot-image-$(CONFIG_EFI_ZBOOT)          := vml << 
167 boot-image-$(CONFIG_XIP_KERNEL)         := xip << 
168 KBUILD_IMAGE                            := $(b << 
169                                                << 
170 libs-y += arch/riscv/lib/                      << 
171 libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/ << 
172                                                << 
173 ifeq ($(KBUILD_EXTMOD),)                       << 
174 ifeq ($(CONFIG_MMU),y)                         << 
175 prepare: vdso_prepare                          << 
176 vdso_prepare: prepare0                         << 
177         $(Q)$(MAKE) $(build)=arch/riscv/kernel << 
178         $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \    << 
179                 $(build)=arch/riscv/kernel/com << 
180                                                << 
181 endif                                          << 
182 endif                                          << 
183                                                << 
184 vdso-install-y                  += arch/riscv/ << 
185 vdso-install-$(CONFIG_COMPAT)   += arch/riscv/ << 
186                                                    12 
187 BOOT_TARGETS := Image Image.gz Image.bz2 Image !!  13 LDFLAGS_vmlinux := -static -N #-relax
                                                   >>  14 CHECKFLAGS      += -D__alpha__ -m64
                                                   >>  15 cflags-y        := -pipe -mno-fp-regs -ffixed-8
                                                   >>  16 cflags-y        += $(call cc-option, -fno-jump-tables)
                                                   >>  17 
                                                   >>  18 cpuflags-$(CONFIG_ALPHA_EV4)            := -mcpu=ev4
                                                   >>  19 cpuflags-$(CONFIG_ALPHA_EV5)            := -mcpu=ev5
                                                   >>  20 cpuflags-$(CONFIG_ALPHA_EV56)           := -mcpu=ev56
                                                   >>  21 cpuflags-$(CONFIG_ALPHA_POLARIS)        := -mcpu=pca56
                                                   >>  22 cpuflags-$(CONFIG_ALPHA_SX164)          := -mcpu=pca56
                                                   >>  23 cpuflags-$(CONFIG_ALPHA_EV6)            := -mcpu=ev6
                                                   >>  24 cpuflags-$(CONFIG_ALPHA_EV67)           := -mcpu=ev67
                                                   >>  25 # If GENERIC, make sure to turn off any instruction set extensions that
                                                   >>  26 # the host compiler might have on by default.  Given that EV4 and EV5
                                                   >>  27 # have the same instruction set, prefer EV5 because an EV5 schedule is
                                                   >>  28 # more likely to keep an EV4 processor busy than vice-versa.
                                                   >>  29 cpuflags-$(CONFIG_ALPHA_GENERIC)        := -mcpu=ev5
                                                   >>  30 
                                                   >>  31 cflags-y                                += $(cpuflags-y)
                                                   >>  32 
                                                   >>  33 
                                                   >>  34 # For TSUNAMI, we must have the assembler not emulate our instructions.
                                                   >>  35 # The same is true for IRONGATE, POLARIS, PYXIS.
                                                   >>  36 # BWX is most important, but we don't really want any emulation ever.
                                                   >>  37 KBUILD_CFLAGS += $(cflags-y) -Wa,-mev6
                                                   >>  38 
                                                   >>  39 head-y := arch/alpha/kernel/head.o
                                                   >>  40 
                                                   >>  41 core-y                          += arch/alpha/kernel/ arch/alpha/mm/
                                                   >>  42 core-$(CONFIG_MATHEMU)          += arch/alpha/math-emu/
                                                   >>  43 drivers-$(CONFIG_OPROFILE)      += arch/alpha/oprofile/
                                                   >>  44 libs-y                          += arch/alpha/lib/
                                                   >>  45 
                                                   >>  46 # export what is needed by arch/alpha/boot/Makefile
                                                   >>  47 LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y))
                                                   >>  48 export LIBS_Y
                                                   >>  49 
                                                   >>  50 boot := arch/alpha/boot
188                                                    51 
189 all:    $(notdir $(KBUILD_IMAGE))              !!  52 #Default target when executing make with no arguments
                                                   >>  53 all boot: $(boot)/vmlinux.gz
190                                                    54 
191 loader.bin: loader                             !!  55 $(boot)/vmlinux.gz: vmlinux
192 Image.gz Image.bz2 Image.lz4 Image.lzma Image. !!  56         $(Q)$(MAKE) $(build)=$(boot) $@
193                                                    57 
194 $(BOOT_TARGETS): vmlinux                       !!  58 bootimage bootpfile bootpzfile: vmlinux
195         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$     59         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
196         @$(kecho) '  Kernel: $(boot)/$@ is rea << 
197                                                    60 
198 # the install target always installs KBUILD_IM !!  61 archclean:
199 # but keep the zinstall target for compatibili !!  62         $(Q)$(MAKE) $(clean)=$(boot)
200 install zinstall:                              << 
201         $(call cmd,install)                    << 
202                                                << 
203 PHONY += rv32_randconfig                       << 
204 rv32_randconfig:                               << 
205         $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctre << 
206                 -f $(srctree)/Makefile randcon << 
207                                                << 
208 PHONY += rv64_randconfig                       << 
209 rv64_randconfig:                               << 
210         $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctre << 
211                 -f $(srctree)/Makefile randcon << 
212                                                << 
213 PHONY += rv32_defconfig                        << 
214 rv32_defconfig:                                << 
215         $(Q)$(MAKE) -f $(srctree)/Makefile def << 
216                                                << 
217 PHONY += rv32_nommu_virt_defconfig             << 
218 rv32_nommu_virt_defconfig:                     << 
219         $(Q)$(MAKE) -f $(srctree)/Makefile nom << 
220                                                    63 
221 define archhelp                                    64 define archhelp
222   echo  '  Image                - Uncompressed !!  65   echo '* boot          - Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
223   echo  '  Image.gz     - Compressed kernel im !!  66   echo '  bootimage     - SRM bootable image (arch/alpha/boot/bootimage)'
224   echo  '  Image.bz2    - Compressed kernel im !!  67   echo '  bootpfile     - BOOTP bootable image (arch/alpha/boot/bootpfile)'
225   echo  '  Image.lz4    - Compressed kernel im !!  68   echo '  bootpzfile    - compressed kernel BOOTP image (arch/alpha/boot/bootpzfile)'
226   echo  '  Image.lzma   - Compressed kernel im << 
227   echo  '  Image.lzo    - Compressed kernel im << 
228   echo  '  Image.zst    - Compressed kernel im << 
229   echo  '  Image.xz     - Compressed kernel im << 
230   echo  '  vmlinuz.efi  - Compressed EFI kerne << 
231   echo  '                 Default when CONFIG_ << 
232   echo  '  xipImage     - Execute-in-place ker << 
233   echo  '                 Default when CONFIG_ << 
234   echo  '  install      - Install kernel using << 
235   echo  '                 (distribution) /sbin << 
236   echo  '                 $$(INSTALL_PATH)'    << 
237 endef                                              69 endef
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php