Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #
  2. # arch/x86/realmode/Makefile
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. #
  9. # Sanitizer runtimes are unavailable and cannot be linked here.
  10. KASAN_SANITIZE := n
  11. KCSAN_SANITIZE := n
  12. KMSAN_SANITIZE := n
  13. OBJECT_FILES_NON_STANDARD := y
  14. # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
  15. KCOV_INSTRUMENT := n
  16. always-y := realmode.bin realmode.relocs
  17. wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
  18. wakeup-objs += copy.o bioscall.o regs.o
  19. # The link order of the video-*.o modules can matter. In particular,
  20. # video-vga.o *must* be listed first, followed by video-vesa.o.
  21. # Hardware-specific drivers should follow in the order they should be
  22. # probed, and video-bios.o should typically be last.
  23. wakeup-objs += video-vga.o
  24. wakeup-objs += video-vesa.o
  25. wakeup-objs += video-bios.o
  26. realmode-y += header.o
  27. realmode-y += trampoline_$(BITS).o
  28. realmode-y += stack.o
  29. realmode-y += reboot.o
  30. realmode-$(CONFIG_ACPI_SLEEP) += $(wakeup-objs)
  31. targets += $(realmode-y)
  32. REALMODE_OBJS = $(addprefix $(obj)/,$(realmode-y))
  33. sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
  34. quiet_cmd_pasyms = PASYMS $@
  35. cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
  36. targets += pasyms.h
  37. $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
  38. $(call if_changed,pasyms)
  39. targets += realmode.lds
  40. $(obj)/realmode.lds: $(obj)/pasyms.h
  41. LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
  42. CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
  43. targets += realmode.elf
  44. $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE
  45. $(call if_changed,ld)
  46. OBJCOPYFLAGS_realmode.bin := -O binary
  47. targets += realmode.bin
  48. $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs FORCE
  49. $(call if_changed,objcopy)
  50. quiet_cmd_relocs = RELOCS $@
  51. cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
  52. targets += realmode.relocs
  53. $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
  54. $(call if_changed,relocs)
  55. # ---------------------------------------------------------------------------
  56. KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
  57. -I$(srctree)/arch/x86/boot
  58. KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  59. KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
  60. GCOV_PROFILE := n
  61. UBSAN_SANITIZE := n