Distinguish KERNEL_ARCH_DIR from KERNEL_ARCH.

On x86_64, the KERNEL_ARCH should really be "x86_64", but it was "x86"
as the architecture sources/headers directory is shared between 32 and 64 bit.

Should not be a functional change on any platform outside x86_64.
This commit is contained in:
Augustin Cavalier 2021-10-01 16:26:45 -04:00
parent 2cc1b23d48
commit c4eec9f1e8
33 changed files with 50 additions and 49 deletions

View File

@ -217,6 +217,7 @@ rule KernelArchitectureSetup architecture
# packaging architecture (supplied for convenience).
HAIKU_KERNEL_ARCH = $(HAIKU_ARCH) ;
HAIKU_KERNEL_ARCH_DIR = $(HAIKU_KERNEL_ARCH) ;
local cpu = $(HAIKU_CPU_$(architecture)) ;
@ -295,7 +296,7 @@ rule KernelArchitectureSetup architecture
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
# x86_64 kernel source is under arch/x86.
HAIKU_KERNEL_ARCH = x86 ;
HAIKU_KERNEL_ARCH_DIR = x86 ;
# nasm is required for target arch x86_64
if ! $(HAIKU_NASM) {
@ -333,7 +334,7 @@ rule KernelArchitectureSetup architecture
HAIKU_PRIVATE_KERNEL_HEADERS =
[ PrivateHeaders $(DOT) kernel libroot shared
kernel/boot/platform/$(HAIKU_KERNEL_PLATFORM) ]
[ ArchHeaders $(HAIKU_KERNEL_ARCH) ]
[ ArchHeaders $(HAIKU_KERNEL_ARCH_DIR) ]
[ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR_$(architecture)) system
kernel ]
$(HAIKU_PRIVATE_SYSTEM_HEADERS_$(architecture))

View File

@ -565,7 +565,7 @@ if $(HAIKU_HOST_BUILD_ONLY) = 1 {
# for all architectures (e.g. TARGET_DEFINES).
local buildVars =
ARCH ARCHS KERNEL_ARCH PACKAGING_ARCH PACKAGING_ARCHS
ARCH ARCHS KERNEL_ARCH KERNEL_ARCH_DIR PACKAGING_ARCH PACKAGING_ARCHS
DEFINES
KERNEL_DEFINES

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel bluetooth btCoreData ;
UsePrivateHeaders kernel net bluetooth ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
#UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_KERNEL_PLATFORM) ] ;
# disable debug output, if debugging is disabled

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel bluetooth hci ;
UsePrivateKernelHeaders ;
UsePrivateHeaders net bluetooth ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
#UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_KERNEL_PLATFORM) ] ;
# disable debug output, if debugging is disabled

View File

@ -8,4 +8,4 @@ KernelAddon config_manager :
;
SubInclude HAIKU_TOP src add-ons kernel bus_managers config_manager arch
$(TARGET_KERNEL_ARCH) ;
$(TARGET_KERNEL_ARCH_DIR) ;

View File

@ -8,4 +8,4 @@ KernelAddon isa :
;
SubInclude HAIKU_TOP src add-ons kernel bus_managers isa arch
$(TARGET_KERNEL_ARCH) ;
$(TARGET_KERNEL_ARCH_DIR) ;

View File

@ -3,7 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel bus_managers pci ;
UsePrivateKernelHeaders ;
UsePrivateHeaders shared ;
UsePrivateHeaders [ FDirName kernel util ] ;
UseHeaders [ FDirName $(SUBDIR) arch $(TARGET_KERNEL_ARCH) ] ;
UseHeaders [ FDirName $(SUBDIR) arch $(TARGET_KERNEL_ARCH_DIR) ] ;
KernelAddon pci :
pci.cpp
@ -22,4 +22,4 @@ ObjectHdrs [ FGristFiles pci_info$(SUFOBJ) ]
Includes [ FGristFiles pci_info.cpp ] : <src!apps!devices>pcihdr.h ;
SubInclude HAIKU_TOP src add-ons kernel bus_managers pci arch
$(TARGET_KERNEL_ARCH) ;
$(TARGET_KERNEL_ARCH_DIR) ;

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src add-ons kernel busses agp_gart ;
SubDirC++Flags -fno-rtti ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
UsePrivateHeaders [ FDirName graphics intel_extreme ] ;
UsePrivateHeaders [ FDirName graphics common ] ;
UsePrivateHeaders drivers graphics kernel ;
@ -15,6 +15,6 @@ KernelAddon <agp_gart>intel :
;
SEARCH on [ FGristFiles
kernel_cpp.cpp
kernel_cpp.cpp
] = [ FDirName $(HAIKU_TOP) src system kernel util ] ;

View File

@ -1,6 +1,6 @@
SubDir HAIKU_TOP src add-ons kernel console vga_text ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
KernelAddon vga_text :

View File

@ -1,3 +1,3 @@
SubDir HAIKU_TOP src add-ons kernel cpu ;
SubInclude HAIKU_TOP src add-ons kernel cpu $(TARGET_KERNEL_ARCH) ;
SubInclude HAIKU_TOP src add-ons kernel cpu $(TARGET_KERNEL_ARCH_DIR) ;

View File

@ -7,4 +7,4 @@ KernelAddon <kdebug>disasm :
: disasm_arch.a
;
SubInclude HAIKU_TOP src add-ons kernel debugger disasm $(TARGET_KERNEL_ARCH) ;
SubInclude HAIKU_TOP src add-ons kernel debugger disasm $(TARGET_KERNEL_ARCH_DIR) ;

View File

@ -1,4 +1,4 @@
SubDir HAIKU_TOP src add-ons kernel debugger disasm $(TARGET_KERNEL_ARCH) ;
SubDir HAIKU_TOP src add-ons kernel debugger disasm $(TARGET_KERNEL_ARCH_DIR) ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
UseHeaders [ LibraryHeaders udis86 ] ;

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons kernel file_cache ;
UsePrivateKernelHeaders ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
KernelAddon log :
log.cpp

View File

@ -9,5 +9,5 @@ HaikuSubInclude settings ;
# Known device trees
if $(TARGET_ARCH) = "arm" {
HaikuSubInclude dts arch $(TARGET_KERNEL_ARCH) ;
HaikuSubInclude dts arch $(TARGET_KERNEL_ARCH_DIR) ;
}

View File

@ -261,7 +261,7 @@ for platform in [ MultiBootSubDirSetup ] {
x86_64 ] ;
} else {
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot os arch
$(TARGET_KERNEL_ARCH) ] ;
$(TARGET_KERNEL_ARCH_DIR) ] ;
}
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix string ] ;
@ -299,7 +299,7 @@ for platform in [ MultiBootSubDirSetup ] {
AddResources haiku_loader.$(TARGET_BOOT_PLATFORM) : boot_loader.rdef ;
local archGrist = [ FGrist src system boot arch $(TARGET_KERNEL_ARCH) $(platform:G=) ] ;
local archGrist = [ FGrist src system boot arch $(TARGET_KERNEL_ARCH_DIR) $(platform:G=) ] ;
local archObject = boot_arch_$(TARGET_KERNEL_ARCH).o ;
local ldflags = $(HAIKU_BOOT_LDFLAGS) $(HAIKU_BOOT_$(platform:G=:U)_LDFLAGS) ;
ldflags ?= $(TARGET_BOOT_LDFLAGS) ;
@ -400,6 +400,6 @@ for platform in [ MultiBootSubDirSetup ] {
}
}
SubInclude HAIKU_TOP src system boot arch $(TARGET_KERNEL_ARCH) ;
SubInclude HAIKU_TOP src system boot arch $(TARGET_KERNEL_ARCH_DIR) ;
SubInclude HAIKU_TOP src system boot loader ;
SubInclude HAIKU_TOP src system boot platform ;

View File

@ -55,10 +55,10 @@ for platform in [ MultiBootSubDirSetup u-boot efi ] {
;
SEARCH on [ FGristFiles $(kernelGenericSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH on [ FGristFiles $(kernelArchSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;

View File

@ -26,7 +26,7 @@ for platform in [ MultiBootSubDirSetup openfirmware ] {
;
SEARCH on [ FGristFiles arch_elf.cpp arch_uart_8250.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;

View File

@ -42,7 +42,7 @@ for platform in [ MultiBootSubDirSetup u-boot efi riscv ] {
;
SEARCH on [ FGristFiles $(kernelArchDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;
SEARCH on [ FGristFiles $(kernelDebugSources) ]

View File

@ -25,7 +25,7 @@ for platform in [ MultiBootSubDirSetup openfirmware ] {
;
SEARCH on [ FGristFiles arch_elf.cpp arch_uart_8250.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;

View File

@ -19,7 +19,7 @@ for platform in [ MultiBootSubDirSetup ] {
DEFINES +=
_BOOT_MODE
BOOT_ARCH=\\\"$(TARGET_KERNEL_ARCH)\\\"
BOOT_ARCH=\\\"$(TARGET_KERNEL_ARCH_DIR)\\\"
KMESSAGE_CONTAINER_ONLY
BOOT_SUPPORT_PARTITION_INTEL
@ -39,7 +39,7 @@ for platform in [ MultiBootSubDirSetup ] {
# Add architecture specific partition/file system modules
switch $(TARGET_KERNEL_ARCH) {
switch $(TARGET_KERNEL_ARCH_DIR) {
case "ppc" :
{
DEFINES +=
@ -172,7 +172,7 @@ for platform in [ MultiBootSubDirSetup ] {
= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems intel ] ;
SEARCH on [ FGristFiles stage2_crt0.S ]
= [ FDirName $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH on [ FGristFiles DataIO.cpp Referenceable.cpp ]
= [ FDirName $(HAIKU_TOP) src kits support ] ;

View File

@ -3,7 +3,7 @@ SubDir HAIKU_TOP src system boot platform efi ;
UsePrivateHeaders [ FDirName kernel boot ] ;
UsePrivateHeaders [ FDirName kernel platform ] ;
UsePrivateHeaders [ FDirName kernel boot platform efi ] ;
UsePrivateHeaders [ FDirName kernel boot arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel boot arch $(TARGET_KERNEL_ARCH_DIR) ] ;
if $(TARGET_ARCH) != x86_64 && $(TARGET_ARCH) != x86 && $(TARGET_ARCH) != arm64 {
UseLibraryHeaders [ FDirName libfdt ] ;

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src system boot platform openfirmware arch ppc ;
SubDirHdrs $(HAIKU_TOP) src system boot platform openfirmware ;
UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ]
[ FDirName kernel boot platform $(HAIKU_KERNEL_PLATFORM) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
@ -21,7 +21,7 @@ for platform in [ MultiBootSubDirSetup openfirmware ] {
start.cpp
;
SEARCH on [ FGristFiles arch_cpu_asm.S arch_mmu.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
}
}

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src system boot platform openfirmware arch sparc ;
SubDirHdrs $(HAIKU_TOP) src system boot platform openfirmware ;
UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ]
[ FDirName kernel boot platform $(HAIKU_KERNEL_PLATFORM) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
@ -21,6 +21,6 @@ for platform in [ MultiBootSubDirSetup openfirmware ] {
;
SEARCH on [ FGristFiles arch_cpu_asm.S arch_mmu.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
}
}

View File

@ -4,8 +4,8 @@ SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATF
SubDirHdrs $(HAIKU_TOP) headers private kernel platform $(TARGET_BOOT_PLATFORM) ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ;
SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ;
SubDirHdrs $(HAIKU_TOP) src system boot platform u-boot arch $(TARGET_KERNEL_ARCH) ;
SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH_DIR) ;
SubDirHdrs $(HAIKU_TOP) src system boot platform u-boot arch $(TARGET_KERNEL_ARCH_DIR) ;
UseLibraryHeaders [ FDirName libfdt ] ;

View File

@ -1,14 +1,14 @@
SubDir HAIKU_TOP src system boot platform u-boot arch arm ;
SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ;
SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ;
SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH_DIR) ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ;
UseLibraryHeaders [ FDirName libfdt ] ;
UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel platform u-boot ] ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
SubDirC++Flags -fno-rtti ;
@ -43,6 +43,6 @@ BootMergeObject boot_platform_u-boot_arm.o :
;
SEARCH on [ FGristFiles $(kernelArchDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
#SEARCH on [ FGristFiles arch_cpu_asm.S ]
# = [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
# = [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;

View File

@ -2,10 +2,10 @@ SubDir HAIKU_TOP src system boot platform u-boot arch ppc ;
SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ;
UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) board $(TARGET_BOOT_BOARD) ] ;
UseLibraryHeaders [ FDirName libfdt ] ;
@ -30,4 +30,4 @@ BootMergeObject boot_platform_u-boot_ppc.o :
;
SEARCH on [ FGristFiles arch_cpu_asm.S ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;

View File

@ -1,3 +1,3 @@
SubDir HAIKU_TOP src system kernel arch ;
SubInclude HAIKU_TOP src system kernel arch $(TARGET_KERNEL_ARCH) ;
SubInclude HAIKU_TOP src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ;

View File

@ -107,7 +107,7 @@ local archGenericSources =
x86_pit.cpp
;
KernelMergeObject kernel_arch_x86.o :
KernelMergeObject kernel_arch_$(TARGET_KERNEL_ARCH).o :
$(archSpecificSources)
$(archGenericSources)
:

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src system kernel lib arch x86_64 ;
# find the generated asm_offsets.h
SubDirHdrs [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
system kernel arch $(TARGET_KERNEL_ARCH) ] ;
system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src tests servers registrar ;
UsePublicHeaders [ FDirName add-ons registrar ] ;
UseArchHeaders $(TARGET_KERNEL_ARCH) ;
UseArchHeaders $(TARGET_KERNEL_ARCH_DIR) ;
# some test programs

View File

@ -3,7 +3,7 @@ SubDir HAIKU_TOP src tests system boot loader ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel util ] ;
UsePrivateHeaders kernel shared storage system ;
SubDirSysHdrs $(HAIKU_TOP) headers private kernel arch $(TARGET_KERNEL_ARCH) ;
SubDirSysHdrs $(HAIKU_TOP) headers private kernel arch $(TARGET_KERNEL_ARCH_DIR) ;
SubDirSysHdrs $(HAIKU_TOP) headers private system arch $(TARGET_ARCH) ;
SubDirSysHdrs $(HAIKU_TOP) src tests system boot loader ;
SubDirHdrs $(HAIKU_TOP) src system boot loader ;

View File

@ -10,7 +10,7 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits storage ] ;
UsePrivateHeaders shared ;
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_KERNEL_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
UsePrivateHeaders [ FDirName kernel fs ] ;
UsePrivateHeaders [ FDirName kernel ] ;
UsePrivateHeaders [ FDirName kernel util ] ;

View File

@ -3,7 +3,7 @@ SubDir HAIKU_TOP src tests system kernel scheduler ;
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src system kernel util ] ;
UsePrivateHeaders kernel ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_KERNEL_PLATFORM) ] ;
#UseHeaders [ FDirName $(HAIKU_TOP) src system kernel cache ] ;