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
This commit is contained in:
@@ -389,7 +389,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_BEGIN_GLUE_CODE = crtbegin.o
|
||||||
|
<src!system!glue>haiku_version_glue.o ;
|
||||||
HAIKU_KERNEL_ADDON_END_GLUE_CODE = $(HAIKU_GCC_LIBGCC) crtend.o ;
|
HAIKU_KERNEL_ADDON_END_GLUE_CODE = $(HAIKU_GCC_LIBGCC) crtend.o ;
|
||||||
|
|
||||||
SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
|
SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
|
||||||
|
|||||||
@@ -237,9 +237,11 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ]
|
|||||||
# DevelopmentMin
|
# DevelopmentMin
|
||||||
if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
|
if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 {
|
||||||
# glue code
|
# glue code
|
||||||
AddFilesToHaikuImage develop lib x86
|
AddFilesToHaikuImage develop lib x86 :
|
||||||
: <src!system!glue!arch!x86>crti.o <src!system!glue!arch!x86>crtn.o
|
<src!system!glue!arch!x86>crti.o <src!system!glue!arch!x86>crtn.o
|
||||||
<src!system!glue>init_term_dyn.o <src!system!glue>start_dyn.o ;
|
<src!system!glue>init_term_dyn.o <src!system!glue>start_dyn.o
|
||||||
|
<src!system!glue>haiku_version_glue.o
|
||||||
|
;
|
||||||
|
|
||||||
# kernel
|
# kernel
|
||||||
AddFilesToHaikuImage develop lib x86 : kernel.so : _KERNEL_ ;
|
AddFilesToHaikuImage develop lib x86 : kernel.so : _KERNEL_ ;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ endif
|
|||||||
ifeq ($(NAME), )
|
ifeq ($(NAME), )
|
||||||
NAME = NameThisApp
|
NAME = NameThisApp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TYPE), )
|
ifeq ($(TYPE), )
|
||||||
TYPE = APP
|
TYPE = APP
|
||||||
endif
|
endif
|
||||||
@@ -30,7 +30,7 @@ endif
|
|||||||
|
|
||||||
# specify that the binary should be created in the object directory
|
# specify that the binary should be created in the object directory
|
||||||
# NOTE: make doesn't find the target if its name is enclosed in
|
# 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)"
|
||||||
TARGET := $(OBJ_DIR)/$(NAME)
|
TARGET := $(OBJ_DIR)/$(NAME)
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ ifeq ($(CPU), x86)
|
|||||||
# set the compiler and compiler flags
|
# set the compiler and compiler flags
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
# SETTING: set the CFLAGS for each binary type
|
# SETTING: set the CFLAGS for each binary type
|
||||||
ifeq ($(TYPE), DRIVER)
|
ifeq ($(TYPE), DRIVER)
|
||||||
CFLAGS += -D_KERNEL_MODE=1 -no-fpic
|
CFLAGS += -D_KERNEL_MODE=1 -no-fpic
|
||||||
else
|
else
|
||||||
@@ -72,15 +72,15 @@ ifeq ($(CPU), x86)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# SETTING: set proper debugger flags
|
# SETTING: set proper debugger flags
|
||||||
ifeq ($(DEBUGGER), TRUE)
|
ifeq ($(DEBUGGER), TRUE)
|
||||||
DEBUG += -g
|
DEBUG += -g
|
||||||
OPTIMIZER = -O0
|
OPTIMIZER = -O0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += $(OPTIMIZER) $(DEBUG)
|
CFLAGS += $(OPTIMIZER) $(DEBUG)
|
||||||
|
|
||||||
# SETTING: set warning level
|
# SETTING: set warning level
|
||||||
@@ -104,19 +104,20 @@ ifeq ($(CPU), x86)
|
|||||||
LDFLAGS += -nostart -Xlinker -soname=$(NAME)
|
LDFLAGS += -nostart -Xlinker -soname=$(NAME)
|
||||||
else
|
else
|
||||||
ifeq ($(TYPE), DRIVER)
|
ifeq ($(TYPE), DRIVER)
|
||||||
LDFLAGS += -nostdlib /boot/develop/lib/x86/_KERNEL_
|
LDFLAGS += -nostdlib /boot/develop/lib/x86/_KERNEL_ \
|
||||||
endif
|
/boot/develop/lib/x86/haiku_version_glue.o
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# ppc Settings
|
# ppc Settings
|
||||||
ifeq ($(CPU), ppc)
|
ifeq ($(CPU), ppc)
|
||||||
# set the compiler and compiler flags
|
# set the compiler and compiler flags
|
||||||
CC = mwcc
|
CC = mwcc
|
||||||
CFLAGS +=
|
CFLAGS +=
|
||||||
|
|
||||||
# SETTING: set the proper optimization level
|
# SETTING: set the proper optimization level
|
||||||
ifeq ($(OPTIMIZE), FULL)
|
ifeq ($(OPTIMIZE), FULL)
|
||||||
@@ -137,7 +138,7 @@ ifeq ($(CPU), ppc)
|
|||||||
#set the proper debugger settings
|
#set the proper debugger settings
|
||||||
ifeq ($(DEBUGGER), TRUE)
|
ifeq ($(DEBUGGER), TRUE)
|
||||||
DEBUG += -g
|
DEBUG += -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += $(OPTIMIZER) $(DEBUG)
|
CFLAGS += $(OPTIMIZER) $(DEBUG)
|
||||||
|
|
||||||
@@ -159,10 +160,10 @@ ifeq ($(CPU), ppc)
|
|||||||
|
|
||||||
# SETTING: set linker flags for each binary type
|
# SETTING: set linker flags for each binary type
|
||||||
ifeq ($(TYPE), APP)
|
ifeq ($(TYPE), APP)
|
||||||
LDFLAGS +=
|
LDFLAGS +=
|
||||||
else
|
else
|
||||||
ifeq ($(TYPE), SHARED)
|
ifeq ($(TYPE), SHARED)
|
||||||
LDFLAGS += -xms
|
LDFLAGS += -xms
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -179,10 +180,10 @@ ifeq ($(CPU), ppc)
|
|||||||
-lroot \
|
-lroot \
|
||||||
/boot/develop/lib/ppc/glue-noinit.a \
|
/boot/develop/lib/ppc/glue-noinit.a \
|
||||||
/boot/develop/lib/ppc/init_term_dyn.o \
|
/boot/develop/lib/ppc/init_term_dyn.o \
|
||||||
/boot/develop/lib/ppc/start_dyn.o
|
/boot/develop/lib/ppc/start_dyn.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# SETTING: output symbols in an xMAP file
|
# SETTING: output symbols in an xMAP file
|
||||||
ifeq ($(SYMBOLS), TRUE)
|
ifeq ($(SYMBOLS), TRUE)
|
||||||
LDFLAGS += -map $(TARGET).xMAP
|
LDFLAGS += -map $(TARGET).xMAP
|
||||||
@@ -249,7 +250,7 @@ LINK_LIBS += $(filter %.so %.a _APP_ _KERNEL_, $(LIBS))
|
|||||||
# prepend -l to each name: be becomes -lbe
|
# prepend -l to each name: be becomes -lbe
|
||||||
LINK_LIBS += $(foreach lib, $(filter-out %.so %.a _APP_ _KERNEL_, $(LIBS)), $(addprefix -l, $(lib)))
|
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)
|
LDFLAGS += $(LINK_PATHS) $(LINK_LIBS)
|
||||||
|
|
||||||
# SETTING: add the defines to the compiler flags
|
# SETTING: add the defines to the compiler flags
|
||||||
@@ -269,9 +270,9 @@ else
|
|||||||
BUILD_LINE = $(LD) -o $@ $(OBJS) $(LDFLAGS)
|
BUILD_LINE = $(LD) -o $@ $(OBJS) $(LDFLAGS)
|
||||||
endif
|
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
|
# 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.
|
# of the directory name, leaving just the root file name.
|
||||||
# It then appends the .rsrc suffix and prepends the $(OBJ_DIR)/ path
|
# It then appends the .rsrc suffix and prepends the $(OBJ_DIR)/ path
|
||||||
define RDEFS_LIST_TO_RSRCS
|
define RDEFS_LIST_TO_RSRCS
|
||||||
@@ -294,7 +295,7 @@ endef
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# define the actual work to be done
|
# define the actual work to be done
|
||||||
default: $(TARGET)
|
default: $(TARGET)
|
||||||
|
|
||||||
$(TARGET): $(OBJ_DIR) $(OBJS) $(RSRCS)
|
$(TARGET): $(OBJ_DIR) $(OBJS) $(RSRCS)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ UsePrivateSystemHeaders ;
|
|||||||
KernelObjects
|
KernelObjects
|
||||||
init_term_dyn.c
|
init_term_dyn.c
|
||||||
start_dyn.c
|
start_dyn.c
|
||||||
|
haiku_version_glue.c
|
||||||
;
|
;
|
||||||
|
|
||||||
SubInclude HAIKU_TOP src system glue arch ;
|
SubInclude HAIKU_TOP src system glue arch ;
|
||||||
|
|||||||
@@ -5,17 +5,12 @@
|
|||||||
|
|
||||||
#include <user_runtime.h>
|
#include <user_runtime.h>
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
#include <image_defs.h>
|
|
||||||
|
|
||||||
#include "init_term_dyn.h"
|
#include "init_term_dyn.h"
|
||||||
|
|
||||||
|
|
||||||
// Haiku API and ABI versions -- we compile those into shared objects so that
|
// include the version glue -- it's separate for the kernel add-ons only
|
||||||
// the runtime loader can discriminate the versions and enable compatibility
|
#include "haiku_version_glue.c"
|
||||||
// work-arounds, if necessary.
|
|
||||||
|
|
||||||
uint32 B_SHARED_OBJECT_HAIKU_VERSION_VARIABLE = B_HAIKU_VERSION;
|
|
||||||
uint32 B_SHARED_OBJECT_HAIKU_ABI_VARIABLE = B_HAIKU_ABI;
|
|
||||||
|
|
||||||
|
|
||||||
/** These functions are called from _init()/_fini() (in crti.S, crtn.S)
|
/** These functions are called from _init()/_fini() (in crti.S, crtn.S)
|
||||||
|
|||||||
Reference in New Issue
Block a user