Make guarded heap accessible through its own libroot_guarded.so.
This adds libroot_guarded.so to the HaikuDevel package. It is the same as libroot_debug with the debug heap swapped out for the guarded heap. The guarded heap has some useful features that make it desirable to use while having the disadvantage of a large memory and address space overhead which make it unusable in some situations. Therefore the guarded heap cannot simply replace the debug heap but should still be made available. As the heap init needs to happen even before having environment variables, the heap to use can not be chosen dynamically. Exposing them through their own libraries is the next best thing.
This commit is contained in:
@@ -19,7 +19,11 @@ AddFilesToPackage develop lib :
|
||||
AddFilesToPackage develop lib : kernel.so : _KERNEL_ ;
|
||||
|
||||
# additional libraries
|
||||
local developmentLibs = <revisioned>libroot_debug.so ;
|
||||
local developmentLibs =
|
||||
<revisioned>libroot_debug.so
|
||||
<revisioned>libroot_guarded.so
|
||||
;
|
||||
|
||||
AddFilesToPackage lib : $(developmentLibs) ;
|
||||
|
||||
# library symlinks
|
||||
|
||||
@@ -62,6 +62,11 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
;
|
||||
librootDebugObjects = $(librootDebugObjects:G=$(architecture)) ;
|
||||
|
||||
local librootGuardedObjects =
|
||||
posix_malloc_guarded.o
|
||||
;
|
||||
librootGuardedObjects = $(librootGuardedObjects:G=$(architecture)) ;
|
||||
|
||||
local librootNoDebugObjects =
|
||||
posix_malloc.o
|
||||
;
|
||||
@@ -69,12 +74,15 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
|
||||
local libroot = [ MultiArchDefaultGristFiles libroot.so ] ;
|
||||
local librootDebug = $(libroot:B=libroot_debug) ;
|
||||
local librootGuarded = $(libroot:B=libroot_guarded) ;
|
||||
|
||||
DONT_LINK_AGAINST_LIBROOT on $(libroot) = true ;
|
||||
DONT_LINK_AGAINST_LIBROOT on $(librootDebug) = true ;
|
||||
DONT_LINK_AGAINST_LIBROOT on $(librootGuarded) = true ;
|
||||
|
||||
SetVersionScript $(libroot) : libroot_versions ;
|
||||
SetVersionScript $(librootDebug) : libroot_versions ;
|
||||
SetVersionScript $(librootGuarded) : libroot_versions ;
|
||||
|
||||
SharedLibrary $(libroot)
|
||||
:
|
||||
@@ -100,6 +108,17 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
[ TargetLibgcc ]
|
||||
;
|
||||
|
||||
HAIKU_SONAME on $(librootGuarded) = libroot.so ;
|
||||
|
||||
SharedLibrary $(librootGuarded)
|
||||
:
|
||||
libroot_init.c
|
||||
:
|
||||
$(librootObjects)
|
||||
$(librootGuardedObjects)
|
||||
[ TargetStaticLibsupc++ ]
|
||||
[ TargetLibgcc ]
|
||||
;
|
||||
|
||||
# Copy libroot.so and update the copy's revision section. We link
|
||||
# everything against the original, but the copy will end up on the disk
|
||||
@@ -112,12 +131,18 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
libroot.so : revisioned ] ;
|
||||
local revisionedLibrootDebug
|
||||
= $(librootDebug:G=$(revisionedLibroot:G)) ;
|
||||
local revisionedLibrootGuarded
|
||||
= $(librootGuarded:G=$(revisionedLibroot:G)) ;
|
||||
|
||||
MakeLocate $(revisionedLibroot) : $(targetDir) ;
|
||||
CopySetHaikuRevision $(revisionedLibroot) : $(libroot) ;
|
||||
|
||||
MakeLocate $(revisionedLibrootDebug) : $(targetDir) ;
|
||||
CopySetHaikuRevision $(revisionedLibrootDebug) : $(librootDebug) ;
|
||||
|
||||
MakeLocate $(revisionedLibrootGuarded) : $(targetDir) ;
|
||||
CopySetHaikuRevision $(revisionedLibrootGuarded)
|
||||
: $(librootGuarded) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,11 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
||||
UsePrivateSystemHeaders ;
|
||||
|
||||
MergeObject <$(architecture)>posix_malloc_debug.o :
|
||||
#guarded_heap.cpp
|
||||
heap.cpp
|
||||
;
|
||||
|
||||
MergeObject <$(architecture)>posix_malloc_guarded.o :
|
||||
guarded_heap.cpp
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user