Rewrote KernelAddon. We were using Addon before, with the undesired side
effect that we were linking not only against the complete glue code, but also against libroot.so. Now we explicitly link against crtbegin.o/crtend.o only. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15545 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -219,6 +219,8 @@ HAIKU_EXECUTABLE_BEGIN_GLUE_CODE =
|
|||||||
<src!system!glue>init_term_dyn.o
|
<src!system!glue>init_term_dyn.o
|
||||||
;
|
;
|
||||||
HAIKU_EXECUTABLE_END_GLUE_CODE = $(HAIKU_LIBRARY_END_GLUE_CODE) ;
|
HAIKU_EXECUTABLE_END_GLUE_CODE = $(HAIKU_LIBRARY_END_GLUE_CODE) ;
|
||||||
|
HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = crtbegin.o ;
|
||||||
|
HAIKU_KERNEL_ADDON_END_GLUE_CODE = crtend.o ;
|
||||||
|
|
||||||
SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
|
SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
|
||||||
|
|
||||||
|
|||||||
+27
-15
@@ -64,30 +64,42 @@ actions KernelLd
|
|||||||
rule KernelAddon
|
rule KernelAddon
|
||||||
{
|
{
|
||||||
# KernelAddon <name> : <relpath> : <sources> : <static-libraries> ;
|
# KernelAddon <name> : <relpath> : <sources> : <static-libraries> ;
|
||||||
|
#
|
||||||
|
# TODO: <relpath> no longer needed!
|
||||||
|
local target = $(1) ;
|
||||||
local sources = $(3) ;
|
local sources = $(3) ;
|
||||||
|
local libs = $(4) ;
|
||||||
|
|
||||||
# platform supported?
|
local kernel ;
|
||||||
on $(1) {
|
local beginGlue ;
|
||||||
|
local endGlue ;
|
||||||
|
on $(target) {
|
||||||
|
# platform supported?
|
||||||
if ! $(PLATFORM) in $(SUPPORTED_PLATFORMS) {
|
if ! $(PLATFORM) in $(SUPPORTED_PLATFORMS) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# determine which kernel and glue code to link against
|
||||||
|
if $(PLATFORM) = haiku {
|
||||||
|
kernel = <nogrist>kernel.so ;
|
||||||
|
beginGlue = $(HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE) ;
|
||||||
|
endGlue = $(HAIKU_KERNEL_ADDON_END_GLUE_CODE) ;
|
||||||
|
} else {
|
||||||
|
kernel = /boot/develop/lib/x86/_KERNEL_ ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# When building for Haiku, we link against kernel.so, otherwise
|
# add glue code
|
||||||
# against the system kernel.
|
LINK_BEGIN_GLUE on $(target) = $(beginGlue) ;
|
||||||
local kernel ;
|
LINK_END_GLUE on $(target) = $(endGlue) ;
|
||||||
if [ on $(1) return $(PLATFORM) ] = haiku {
|
Depends $(target) : $(beginGlue) $(endGlue) ;
|
||||||
kernel = <nogrist>kernel.so ;
|
|
||||||
} else {
|
|
||||||
kernel = /boot/develop/lib/x86/_KERNEL_ ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
# compile and link
|
||||||
SetupKernel $(sources) : -fno-pic ;
|
SetupKernel $(sources) : -fno-pic ;
|
||||||
|
local linkFlags = -nostdlib -Xlinker -soname=\"$(target)\" ;
|
||||||
Addon $(1) : $(2) : $(sources) ;
|
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ] $(linkFlags) ;
|
||||||
LINKFLAGS on $(1) = [ on $(1) return $(LINKFLAGS) ] -nostdlib ;
|
Main $(target) : $(sources) ;
|
||||||
LinkAgainst $(1) : $(4) $(kernel) ;
|
LinkAgainst $(target) : $(libs) $(kernel) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule KernelMergeObject
|
rule KernelMergeObject
|
||||||
|
|||||||
Reference in New Issue
Block a user