runtime_loader: add hybrid support.

This commit is contained in:
Jérôme Duval
2018-02-25 08:29:51 +01:00
parent befa252fbf
commit 4bd0c1066b
6 changed files with 184 additions and 148 deletions
+102 -92
View File
@@ -1,109 +1,119 @@
SubDir HAIKU_TOP src system runtime_loader ; SubDir HAIKU_TOP src system runtime_loader ;
local architecture = $(TARGET_PACKAGING_ARCH) ;
UsePrivateHeaders libroot runtime_loader shared ; local architectureObject ;
UsePrivateHeaders kernel ; for architectureObject in [ MultiArchSubDirSetup ] {
# for <util/KMessage.h> on $(architectureObject) {
UsePrivateHeaders libroot os ; local architecture = $(TARGET_PACKAGING_ARCH) ;
# for "PathBuffer.h"
UsePrivateSystemHeaders ;
ObjectHdrs find_directory.cpp : $(HAIKU_TOP)/src/system/libroot/os ; UsePrivateHeaders libroot runtime_loader shared ;
UsePrivateHeaders kernel ;
# for <util/KMessage.h>
UsePrivateHeaders libroot os ;
# for "PathBuffer.h"
UsePrivateSystemHeaders ;
# Don't let gcc inject built-in function code. This will cause dependencies ObjectHdrs find_directory.cpp : $(HAIKU_TOP)/src/system/libroot/os ;
# to libroot, which we don't link against.
SubDirCcFlags -fno-builtin ;
SubDirC++Flags -fno-builtin -fno-exceptions ;
DEFINES += # Don't let gcc inject built-in function code. This will cause
KMESSAGE_CONTAINER_ONLY # dependencies to libroot, which we don't link against.
_LOADER_MODE SubDirCcFlags -fno-builtin ;
USING_LIBGCC=1 SubDirC++Flags -fno-builtin -fno-exceptions ;
;
AddResources runtime_loader : runtime_loader.rdef ; DEFINES +=
KMESSAGE_CONTAINER_ONLY
_LOADER_MODE
USING_LIBGCC=1
;
# needed for "runtime_loader" only AddResources [ MultiArchDefaultGristFiles runtime_loader ]
StaticLibrary libruntime_loader.a : : runtime_loader.rdef ;
kernel_vsprintf.cpp
kernel_cpp.cpp
KMessage.cpp
find_directory.cpp
:
<src!system!libroot!os!$(architecture)>mutex.o
<src!system!libroot!os!$(architecture)>recursive_lock.o
<src!system!libroot!os!$(architecture)>syscalls.o
<src!system!libroot!os!$(architecture)>sem.o
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>tls.o
<src!system!libroot!posix!$(architecture)>errno.o # needed for "runtime_loader" only
<src!system!libroot!posix!$(architecture)>fcntl.o StaticLibrary <$(architecture)>libruntime_loader.a :
kernel_vsprintf.cpp
kernel_cpp.cpp
KMessage.cpp
find_directory.cpp
:
<src!system!libroot!os!$(architecture)>mutex.o
<src!system!libroot!os!$(architecture)>recursive_lock.o
<src!system!libroot!os!$(architecture)>syscalls.o
<src!system!libroot!os!$(architecture)>sem.o
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>tls.o
<src!system!libroot!posix!locale!$(architecture)>ctype.o <src!system!libroot!posix!$(architecture)>errno.o
<src!system!libroot!posix!locale!$(architecture)>LocaleData.o <src!system!libroot!posix!$(architecture)>fcntl.o
<src!system!libroot!posix!string!$(architecture)>memchr.o <src!system!libroot!posix!locale!$(architecture)>ctype.o
<src!system!libroot!posix!string!$(architecture)>memcmp.o <src!system!libroot!posix!locale!$(architecture)>LocaleData.o
<src!system!libroot!posix!string!$(architecture)>memmove.o
<src!system!libroot!posix!string!$(architecture)>strcasecmp.o
<src!system!libroot!posix!string!$(architecture)>strcat.o
<src!system!libroot!posix!string!$(architecture)>strchr.o
<src!system!libroot!posix!string!$(architecture)>strcmp.o
<src!system!libroot!posix!string!$(architecture)>strcpy.o
<src!system!libroot!posix!string!$(architecture)>strcspn.o
<src!system!libroot!posix!string!$(architecture)>strdup.o
<src!system!libroot!posix!string!$(architecture)>strerror.o
<src!system!libroot!posix!string!$(architecture)>strlcat.o
<src!system!libroot!posix!string!$(architecture)>strlcpy.o
<src!system!kernel!lib>strlen.o
<src!system!libroot!posix!string!$(architecture)>strncmp.o
<src!system!libroot!posix!string!$(architecture)>strnlen.o
<src!system!libroot!posix!string!$(architecture)>strpbrk.o
<src!system!libroot!posix!string!$(architecture)>strrchr.o
<src!system!libroot!posix!string!$(architecture)>strspn.o
<src!system!libroot!posix!string!$(architecture)>strstr.o
[ FGristFiles kernel_vsprintf.o ] <src!system!libroot!posix!string!$(architecture)>memchr.o
; <src!system!libroot!posix!string!$(architecture)>memcmp.o
<src!system!libroot!posix!string!$(architecture)>memmove.o
<src!system!libroot!posix!string!$(architecture)>strcasecmp.o
<src!system!libroot!posix!string!$(architecture)>strcat.o
<src!system!libroot!posix!string!$(architecture)>strchr.o
<src!system!libroot!posix!string!$(architecture)>strcmp.o
<src!system!libroot!posix!string!$(architecture)>strcpy.o
<src!system!libroot!posix!string!$(architecture)>strcspn.o
<src!system!libroot!posix!string!$(architecture)>strdup.o
<src!system!libroot!posix!string!$(architecture)>strerror.o
<src!system!libroot!posix!string!$(architecture)>strlcat.o
<src!system!libroot!posix!string!$(architecture)>strlcpy.o
<src!system!libroot!posix!string!$(architecture)>strlen.o
<src!system!libroot!posix!string!$(architecture)>strncmp.o
<src!system!libroot!posix!string!$(architecture)>strnlen.o
<src!system!libroot!posix!string!$(architecture)>strpbrk.o
<src!system!libroot!posix!string!$(architecture)>strrchr.o
<src!system!libroot!posix!string!$(architecture)>strspn.o
<src!system!libroot!posix!string!$(architecture)>strstr.o
;
SEARCH on [ FGristFiles kernel_cpp.cpp ] SEARCH on [ FGristFiles kernel_cpp.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel util ] ; = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
SEARCH on [ FGristFiles kernel_vsprintf.cpp ] SEARCH on [ FGristFiles kernel_vsprintf.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel lib ] ; = [ FDirName $(HAIKU_TOP) src system kernel lib ] ;
SEARCH on [ FGristFiles KMessage.cpp ] SEARCH on [ FGristFiles KMessage.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel messaging ] ; = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
SEARCH on [ FGristFiles find_directory.cpp ] SEARCH on [ FGristFiles find_directory.cpp ]
= [ FDirName $(HAIKU_TOP) src system libroot os ] ; = [ FDirName $(HAIKU_TOP) src system libroot os ] ;
local sources = local sources =
add_ons.cpp add_ons.cpp
elf.cpp elf.cpp
elf_haiku_version.cpp elf_haiku_version.cpp
elf_load_image.cpp elf_load_image.cpp
elf_symbol_lookup.cpp elf_symbol_lookup.cpp
elf_tls.cpp elf_tls.cpp
elf_versioning.cpp elf_versioning.cpp
pe.cpp pe.cpp
errors.cpp errors.cpp
export.cpp export.cpp
heap.cpp heap.cpp
images.cpp images.cpp
runtime_loader.cpp runtime_loader.cpp
utility.cpp utility.cpp
; ;
Objects $(sources) ; Objects $(sources) ;
Ld runtime_loader : Ld [ MultiArchDefaultGristFiles runtime_loader ] :
[ FGristFiles $(sources:S=$(SUFOBJ)) ] [ FGristFiles $(sources:S=$(SUFOBJ)) ]
libruntime_loader.a <$(architecture)>libruntime_loader.a
libruntime_loader_$(TARGET_ARCH).a <$(architecture)>libruntime_loader_$(TARGET_ARCH).a
[ TargetKernelLibsupc++ ] [ TargetKernelLibsupc++ ]
[ TargetKernelLibgcc ] [ TargetKernelLibgcc ]
[ TargetKernelLibgcceh ] [ TargetKernelLibgcceh ]
: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/runtime_loader.ld : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/runtime_loader.ld
: --no-undefined -shared -soname=runtime_loader : --no-undefined -shared -soname=runtime_loader
; ;
}
}
local arch ;
for arch in $(TARGET_ARCHS) {
HaikuSubInclude arch $(arch) ;
}
HaikuSubInclude arch $(TARGET_ARCH) ;
+16 -11
View File
@@ -1,17 +1,22 @@
SubDir HAIKU_TOP src system runtime_loader arch arm ; SubDir HAIKU_TOP src system runtime_loader arch arm ;
local architecture = $(TARGET_PACKAGING_ARCH) ; local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup arm ] {
on $(architectureObject) {
local architecture = $(TARGET_PACKAGING_ARCH) ;
UsePrivateHeaders runtime_loader ; UsePrivateHeaders runtime_loader ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ; SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ;
StaticLibrary libruntime_loader_$(TARGET_ARCH).a : StaticLibrary <$(architecture)>libruntime_loader_$(TARGET_ARCH).a :
arch_relocate.cpp arch_relocate.cpp
: :
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o <src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memset.o <src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memset.o
; ;
}
}
+18 -12
View File
@@ -1,18 +1,24 @@
SubDir HAIKU_TOP src system runtime_loader arch m68k ; SubDir HAIKU_TOP src system runtime_loader arch m68k ;
local architecture = $(TARGET_PACKAGING_ARCH) ; local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup m68k ] {
on $(architectureObject) {
local architecture = $(TARGET_PACKAGING_ARCH) ;
UsePrivateHeaders runtime_loader ; UsePrivateHeaders runtime_loader ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ; SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ;
StaticLibrary libruntime_loader_$(TARGET_ARCH).a : StaticLibrary <$(architecture)>libruntime_loader_$(TARGET_ARCH).a :
arch_relocate.cpp arch_relocate.cpp
: :
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>atomic.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>atomic.o
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memset.o
;
}
}
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memset.o
;
+17 -12
View File
@@ -1,18 +1,23 @@
SubDir HAIKU_TOP src system runtime_loader arch ppc ; SubDir HAIKU_TOP src system runtime_loader arch ppc ;
local architecture = $(TARGET_PACKAGING_ARCH) ; local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup ppc ] {
on $(architectureObject) {
local architecture = $(TARGET_PACKAGING_ARCH) ;
UsePrivateHeaders runtime_loader ; UsePrivateHeaders runtime_loader ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ; SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ;
StaticLibrary libruntime_loader_$(TARGET_ARCH).a : StaticLibrary <$(architecture)>libruntime_loader_$(TARGET_ARCH).a :
arch_relocate.cpp arch_relocate.cpp
: :
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>atomic.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>atomic.o
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memcpy.o <src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memcpy.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memset.o <src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>memset.o
; ;
}
}
+16 -11
View File
@@ -1,17 +1,22 @@
SubDir HAIKU_TOP src system runtime_loader arch x86 ; SubDir HAIKU_TOP src system runtime_loader arch x86 ;
local architecture = $(TARGET_PACKAGING_ARCH) ; local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup x86 x86_gcc2 ] {
on $(architectureObject) {
local architecture = $(TARGET_PACKAGING_ARCH) ;
UsePrivateHeaders runtime_loader ; UsePrivateHeaders runtime_loader ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ; SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ;
StaticLibrary libruntime_loader_$(TARGET_ARCH).a : StaticLibrary <$(architecture)>libruntime_loader_$(TARGET_ARCH).a :
arch_relocate.cpp arch_relocate.cpp
: :
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>atomic.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>atomic.o
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o <src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o
; ;
}
}
+15 -10
View File
@@ -1,15 +1,20 @@
SubDir HAIKU_TOP src system runtime_loader arch x86_64 ; SubDir HAIKU_TOP src system runtime_loader arch x86_64 ;
local architecture = $(TARGET_PACKAGING_ARCH) ; local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup x86_64 ] {
on $(architectureObject) {
local architecture = $(TARGET_PACKAGING_ARCH) ;
UsePrivateHeaders runtime_loader ; UsePrivateHeaders runtime_loader ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ; SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ;
StaticLibrary libruntime_loader_$(TARGET_ARCH).a : StaticLibrary <$(architecture)>libruntime_loader_$(TARGET_ARCH).a :
arch_relocate.cpp arch_relocate.cpp
: :
<src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o <src!system!libroot!os!arch!$(TARGET_ARCH)!$(architecture)>thread.o
<src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o <src!system!libroot!posix!string!arch!$(TARGET_ARCH)!$(architecture)>arch_string.o
; ;
}
}