From c154b94624d37e53245540edfcdc6625e906987f Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 21 May 2009 15:04:37 +0000 Subject: [PATCH] Added haiku_version_glue.o "glue code" containing the Haiku/ABI version symbols recently introduced. Until init_term_dyn.o is linked into kernel add-ons, too, we link with haiku_version_glue.o, so we have those symbols in kernel add-ons as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30818 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/BuildSetup | 3 +- build/jam/OptionalPackages | 8 ++++-- data/develop/makefile-engine | 49 +++++++++++++++++---------------- src/system/glue/Jamfile | 1 + src/system/glue/init_term_dyn.c | 9 ++---- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index f9e44ba36c..11784b3182 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -389,7 +389,8 @@ HAIKU_EXECUTABLE_BEGIN_GLUE_CODE = init_term_dyn.o ; HAIKU_EXECUTABLE_END_GLUE_CODE = $(HAIKU_LIBRARY_END_GLUE_CODE) ; -HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = crtbegin.o ; +HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = crtbegin.o + haiku_version_glue.o ; HAIKU_KERNEL_ADDON_END_GLUE_CODE = $(HAIKU_GCC_LIBGCC) crtend.o ; SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ; diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 1890788334..45621a92ff 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -237,9 +237,11 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ] # DevelopmentMin if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 { # glue code - AddFilesToHaikuImage develop lib x86 - : crti.o crtn.o - init_term_dyn.o start_dyn.o ; + AddFilesToHaikuImage develop lib x86 : + crti.o crtn.o + init_term_dyn.o start_dyn.o + haiku_version_glue.o + ; # kernel AddFilesToHaikuImage develop lib x86 : kernel.so : _KERNEL_ ; diff --git a/data/develop/makefile-engine b/data/develop/makefile-engine index a8798a30dd..03b8d6da02 100644 --- a/data/develop/makefile-engine +++ b/data/develop/makefile-engine @@ -19,7 +19,7 @@ endif ifeq ($(NAME), ) NAME = NameThisApp endif - + ifeq ($(TYPE), ) TYPE = APP endif @@ -30,7 +30,7 @@ endif # specify that the binary should be created in the object directory # NOTE: make doesn't find the target if its name is enclosed in -# quotation marks +# quotation marks # TARGET := "$(OBJ_DIR)/$(NAME)" TARGET := $(OBJ_DIR)/$(NAME) @@ -50,7 +50,7 @@ ifeq ($(CPU), x86) # set the compiler and compiler flags CC = gcc -# SETTING: set the CFLAGS for each binary type +# SETTING: set the CFLAGS for each binary type ifeq ($(TYPE), DRIVER) CFLAGS += -D_KERNEL_MODE=1 -no-fpic else @@ -72,15 +72,15 @@ ifeq ($(CPU), x86) endif endif endif - - + + # SETTING: set proper debugger flags ifeq ($(DEBUGGER), TRUE) DEBUG += -g OPTIMIZER = -O0 - endif - + endif + CFLAGS += $(OPTIMIZER) $(DEBUG) # SETTING: set warning level @@ -104,19 +104,20 @@ ifeq ($(CPU), x86) LDFLAGS += -nostart -Xlinker -soname=$(NAME) else ifeq ($(TYPE), DRIVER) - LDFLAGS += -nostdlib /boot/develop/lib/x86/_KERNEL_ - endif - endif - endif + LDFLAGS += -nostdlib /boot/develop/lib/x86/_KERNEL_ \ + /boot/develop/lib/x86/haiku_version_glue.o + endif + endif + endif + - else # ppc Settings ifeq ($(CPU), ppc) # set the compiler and compiler flags CC = mwcc - CFLAGS += + CFLAGS += # SETTING: set the proper optimization level ifeq ($(OPTIMIZE), FULL) @@ -137,7 +138,7 @@ ifeq ($(CPU), ppc) #set the proper debugger settings ifeq ($(DEBUGGER), TRUE) DEBUG += -g - endif + endif CFLAGS += $(OPTIMIZER) $(DEBUG) @@ -159,10 +160,10 @@ ifeq ($(CPU), ppc) # SETTING: set linker flags for each binary type ifeq ($(TYPE), APP) - LDFLAGS += + LDFLAGS += else ifeq ($(TYPE), SHARED) - LDFLAGS += -xms + LDFLAGS += -xms endif endif @@ -179,10 +180,10 @@ ifeq ($(CPU), ppc) -lroot \ /boot/develop/lib/ppc/glue-noinit.a \ /boot/develop/lib/ppc/init_term_dyn.o \ - /boot/develop/lib/ppc/start_dyn.o - endif - - + /boot/develop/lib/ppc/start_dyn.o + endif + + # SETTING: output symbols in an xMAP file ifeq ($(SYMBOLS), TRUE) LDFLAGS += -map $(TARGET).xMAP @@ -249,7 +250,7 @@ LINK_LIBS += $(filter %.so %.a _APP_ _KERNEL_, $(LIBS)) # prepend -l to each name: be becomes -lbe LINK_LIBS += $(foreach lib, $(filter-out %.so %.a _APP_ _KERNEL_, $(LIBS)), $(addprefix -l, $(lib))) -# add to the linker flags +# add to the linker flags LDFLAGS += $(LINK_PATHS) $(LINK_LIBS) # SETTING: add the defines to the compiler flags @@ -269,9 +270,9 @@ else BUILD_LINE = $(LD) -o $@ $(OBJS) $(LDFLAGS) endif -# pseudo-function for converting a list of resource definition files in RDEFS +# pseudo-function for converting a list of resource definition files in RDEFS # variable to a corresponding list of object files in $(OBJ_DIR)/xxx.rsrc -# The "function" strips off the rdef file suffix (.rdef) and then strips +# The "function" strips off the rdef file suffix (.rdef) and then strips # of the directory name, leaving just the root file name. # It then appends the .rsrc suffix and prepends the $(OBJ_DIR)/ path define RDEFS_LIST_TO_RSRCS @@ -294,7 +295,7 @@ endef endif -# define the actual work to be done +# define the actual work to be done default: $(TARGET) $(TARGET): $(OBJ_DIR) $(OBJS) $(RSRCS) diff --git a/src/system/glue/Jamfile b/src/system/glue/Jamfile index d1d1e63951..d0f11c46bb 100644 --- a/src/system/glue/Jamfile +++ b/src/system/glue/Jamfile @@ -5,6 +5,7 @@ UsePrivateSystemHeaders ; KernelObjects init_term_dyn.c start_dyn.c + haiku_version_glue.c ; SubInclude HAIKU_TOP src system glue arch ; diff --git a/src/system/glue/init_term_dyn.c b/src/system/glue/init_term_dyn.c index a531ee2b7c..d395a4176a 100644 --- a/src/system/glue/init_term_dyn.c +++ b/src/system/glue/init_term_dyn.c @@ -5,17 +5,12 @@ #include #include -#include #include "init_term_dyn.h" -// Haiku API and ABI versions -- we compile those into shared objects so that -// the runtime loader can discriminate the versions and enable compatibility -// work-arounds, if necessary. - -uint32 B_SHARED_OBJECT_HAIKU_VERSION_VARIABLE = B_HAIKU_VERSION; -uint32 B_SHARED_OBJECT_HAIKU_ABI_VARIABLE = B_HAIKU_ABI; +// include the version glue -- it's separate for the kernel add-ons only +#include "haiku_version_glue.c" /** These functions are called from _init()/_fini() (in crti.S, crtn.S)