Changeset 15280 in vbox for trunk/src/recompiler_new
- Timestamp:
- Dec 10, 2008 8:02:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/Makefile.kmk
r15279 r15280 23 23 include $(KBUILD_PATH)/subheader.kmk 24 24 25 # For 64-bit Windows we currently use gcc (due to MSVC unaware of such a novel 26 # thing as C99, a lot of GCC extensions deployed by QEMU and calling convention 27 # differences) to cross-compile code to Linux/ELF and dynamically generate invocation wrappers. 28 if1of (win.amd64, $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) 29 REM_MOD = VBoxREM2 30 SYSMODS += VBoxREM2 31 else 32 REM_MOD = VBoxREM 33 endif 34 35 TEMPLATE_DUMMY = dummy template (move to kBuild) 36 ifeq ($(KBUILD_TARGET), win) 37 $(REM_MOD)_TOOL.win.x86 = MINGW32 38 $(REM_MOD)_TOOL.win.amd64 = XGCCAMD64LINUX 39 $(REM_MOD)_TEMPLATE = DUMMY 40 $(REM_MOD)_SDKS.win.x86 = W32API 41 $(REM_MOD)_ASFLAGS = -x assembler-with-cpp 42 $(REM_MOD)_CFLAGS = -Wall -g -fno-omit-frame-pointer -fno-strict-aliasing 43 $(REM_MOD)_CFLAGS.debug = -O0 44 $(REM_MOD)_CFLAGS.release += -fno-gcse -O2 45 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release) 46 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) 47 48 IMPORT_LIBS += VBoxREMImp 49 DLLS += VBoxREM 50 51 VBoxREM_LIBS = \ 52 $(LIB_VMM) \ 53 $(LIB_RUNTIME) 54 55 USE_REM_IMP = 1 56 else 57 58 # Just keep it here, if need to experiment with older compilers in the future 59 TOOL_GCC3V3 = description 60 TOOL_GCC3V3_EXTENDS = GCC3 61 TOOL_GCC3V3_CC = $(firstword $(which gcc-4.2 gcc-4.1 gcc-3.4 gcc-3.4.6 gcc-3.3 gcc-3.3.6 gcc-3.2)) 62 TOOL_GCC3V3_COMPILE_C_DEPEND = 63 TOOL_GCC3V3_COMPILE_C_DEPORD = 64 TOOL_GCC3V3_COMPILE_C_OUTPUT = 65 define TOOL_GCC3V3_COMPILE_C_CMDS 66 $(QUIET)$(TOOL_GCC3V3_CC) -c\ 25 # 26 # Globals 27 # 28 VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT) 29 30 TEMPLATE_DUMMY = dummy template (move to kBuild) ## @todo Will be there in the next update, remove this. 31 32 if 0 33 # 34 # Template useful for forcing a specific gcc version in case it comes in handy. 35 # 36 TOOL_MYGCC = description 37 TOOL_MYGCC_EXTENDS = GCC3 38 TOOL_MYGCC_CC = $(firstword $(which gcc-4.2 gcc-4.1 gcc-3.4 gcc-3.4.6 gcc-3.3 gcc-3.3.6 gcc-3.2)) 39 TOOL_MYGCC_COMPILE_C_DEPEND = 40 TOOL_MYGCC_COMPILE_C_DEPORD = 41 TOOL_MYGCC_COMPILE_C_OUTPUT = 42 define TOOL_MYGCC_COMPILE_C_CMDS 43 $(QUIET)$(TOOL_MYGCC_CC) -c\ 67 44 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 68 45 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ … … 70 47 $(abspath $(source)) 71 48 endef 72 #target-i386/op_helper.c_TOOL = GCC3V3 73 74 $(REM_MOD)_TEMPLATE = VBOXR3NP 75 76 IMPORT_LIBS += VBoxREM 77 endif 49 #Usage: target-i386/op_helper.c_TOOL = MYGCC 50 endif 51 52 # For 64-bit Windows we currently use gcc (due to MSVC unaware of such a novel 53 # thing as C99, a lot of GCC extensions deployed by QEMU and calling convention 54 # differences) to cross-compile code to Linux/ELF and dynamically generate invocation wrappers. 55 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), win.amd64) 56 REM_MOD := VBoxREM2 57 else 58 REM_MOD := VBoxREM 59 endif 60 78 61 79 62 # VBOX_WITH_64_BITS_GUESTS = 1 80 63 81 # For 32-bit targets when enabled 64-bit guests we build 2 REM DLLs: 64 # For 32-bit targets when enabled 64-bit guests we build 2 REM DLLs: 82 65 # with 64-bit support (slow and buggy at the moment) VBOXREM64 83 66 # only 32-bit support (faster, stable, but not suitable for 64-bit guests) VBOXREM … … 91 74 endif 92 75 93 OTHER_CLEAN += 94 95 # 96 # Globals 97 # 98 VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT) 99 76 77 # 78 # Target lists (some of them anyways). 79 # 80 ifeq ($(REM_MOD),VBoxREM2) 81 SYSMODS += VBoxREM2 82 endif 83 ifeq ($(KBUILD_TARGET),win) 84 DLLS += VBoxREM 85 else 86 ## @todo this is wrong, proper DLLS are DLLS not IMPORT_LIBS. nice try ;-) 87 IMPORT_LIBS += VBoxREM 88 endif 89 90 91 # 100 92 # The VBoxREM.[dll|so|..] or VBoxREM2.rel. 101 93 # 102 $(REM_MOD)_DEFS = IN_REM_R3 REM_INCLUDE_CPU_H 103 $(REM_MOD)_DEFS += REM_PHYS_ADDR_IN_TLB 104 $(REM_MOD)_DEFS += VBOX_WITH_NEW_RECOMPILER 94 ifeq ($(KBUILD_TARGET),win) 95 $(REM_MOD)_TEMPLATE = DUMMY 96 $(REM_MOD)_TOOL.win.x86 = MINGW32 97 $(REM_MOD)_TOOL.win.amd64 = XGCCAMD64LINUX 98 $(REM_MOD)_SDKS.win.x86 = W32API 99 $(REM_MOD)_ASFLAGS = -x assembler-with-cpp 100 $(REM_MOD)_CFLAGS = -Wall -g -fno-omit-frame-pointer -fno-strict-aliasing 101 $(REM_MOD)_CFLAGS.debug = -O0 102 $(REM_MOD)_CFLAGS.release += -fno-gcse -O2 103 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release) 104 VBoxREM_LIBS = \ 105 $(LIB_VMM) \ 106 $(LIB_RUNTIME) 107 $(REM_MOD)_DEFS += IN_RING3 $(ARCH_BITS_DEFS) 108 # Temporary hack, to allow running with oldish GCC 109 $(REM_MOD)_DEFS.win.x86 += GCC_WITH_BUGGY_REGPARM 110 else # !win 111 $(REM_MOD)_TEMPLATE = VBOXR3NP 112 $(REM_MOD)_DEFS = 113 endif # !win 114 $(REM_MOD)_DEFS += IN_REM_R3 REM_INCLUDE_CPU_H 115 $(REM_MOD)_DEFS += REM_PHYS_ADDR_IN_TLB 116 $(REM_MOD)_DEFS += VBOX_WITH_NEW_RECOMPILER 105 117 #$(REM_MOD)_DEFS += DEBUG_ALL_LOGGING DEBUG_DISAS DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB # Enables huge amounts of debug logging. 106 118 $(REM_MOD)_DEFS.linux = _GNU_SOURCE 107 119 ifdef VBOX_SOLARIS_10 108 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=10109 else 110 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=11111 endif 112 113 $(REM_MOD)_INCS =\114 Sun 115 target-i386 116 tcg 117 fpu 118 $(PATH_$(REM_MOD)) 120 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=10 121 else 122 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=11 123 endif 124 125 $(REM_MOD)_INCS = \ 126 Sun \ 127 target-i386 \ 128 tcg \ 129 fpu \ 130 $(PATH_$(REM_MOD)) \ 119 131 $(PATH_ROOT)/src/VBox/VMM \ 120 132 . 121 133 122 $(REM_MOD)_SOURCES =\123 VBoxRecompiler.c 124 cpu-exec.c 125 exec.c 126 translate-all.c 127 host-utils.c 128 cutils.c 129 tcg/tcg.c 130 tcg/tcg-dyngen.c\131 tcg/tcg-runtime.c 132 fpu/softfloat-native.c 134 $(REM_MOD)_SOURCES = \ 135 VBoxRecompiler.c \ 136 cpu-exec.c \ 137 exec.c \ 138 translate-all.c \ 139 host-utils.c \ 140 cutils.c \ 141 tcg/tcg.c \ 142 tcg/tcg-dyngen.c \ 143 tcg/tcg-runtime.c \ 144 fpu/softfloat-native.c \ 133 145 target-i386/op_helper.c \ 134 target-i386/helper.c 146 target-i386/helper.c \ 135 147 target-i386/translate.c 136 148 137 149 ifeq ($(KBUILD_TARGET_ARCH),amd64) 138 $(REM_MOD)_DEFS 139 $(REM_MOD)_INCS 140 else 141 $(REM_MOD)_DEFS 142 $(REM_MOD)_INCS 143 endif 144 145 $(REM_MOD)_SOURCES.debug += \150 $(REM_MOD)_DEFS += __x86_64__ 151 $(REM_MOD)_INCS += tcg/x86_64 152 else 153 $(REM_MOD)_DEFS += __i386__ 154 $(REM_MOD)_INCS += tcg/i386 155 endif 156 157 $(REM_MOD)_SOURCES.debug += \ 146 158 Sun/testmath.c 147 $(REM_MOD)_SOURCES.win.x86 159 $(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def 148 160 ifneq ($(REM_MOD),VBoxREM2) 149 $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) 150 endif 151 161 $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) 162 endif 152 163 ifeq ($(REM_MOD),VBoxREM2) 153 # 154 # The VBoxREM2 wrapper. 155 # 156 VBoxREM_TEMPLATE = VBOXR3 157 VBoxREM_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,) 158 VBoxREM_DEFS += VBOX_WITH_NEW_RECOMPILER 159 VBoxREM_SOURCES = \ 160 VBoxREMWrapper.cpp \ 161 VBoxREMWrapperA.asm 162 164 ## @todo spread out where it belongs. 163 165 $(REM_MOD)_TEMPLATE = VBOXNOCRTGAS 164 166 $(REM_MOD)_DEFS += LOG_USE_C99 $(ARCH_BITS_DEFS) … … 170 172 $(REM_MOD)_INCS += \ 171 173 Sun/crt 172 $(REM_MOD)_LIBS = \174 $(REM_MOD)_LIBS = \ 173 175 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB) 174 $(REM_MOD)_SYSSUFF = .rel 175 176 endif 177 178 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release) 179 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) 180 181 $(REM_MOD)_DEFS += IN_RING3 $(ARCH_BITS_DEFS) 182 #$(REM_MOD)_DEFS += DEBUG_DISAS DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB # Enables huge amounts of debug logging. 183 176 $(REM_MOD)_SYSSUFF = .rel 177 endif 178 179 ## @todo clean up this, there are some duplicates with the template here I think. 184 180 $(REM_MOD)_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -undefined dynamic_lookup 185 181 $(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined … … 189 185 $(REM_MOD)_LDFLAGS.solaris = -mimpure-text 190 186 191 # Temporary hack, to allow running with oldish GCC 192 $(REM_MOD)_DEFS.win.x86 += GCC_WITH_BUGGY_REGPARM 187 188 ifeq ($(REM_MOD),VBoxREM2) 189 # 190 # The VBoxREM2 wrapper. 191 # 192 VBoxREM_TEMPLATE = VBOXR3 193 VBoxREM_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,) 194 VBoxREM_DEFS += VBOX_WITH_NEW_RECOMPILER 195 VBoxREM_SOURCES = \ 196 VBoxREMWrapper.cpp \ 197 VBoxREMWrapperA.asm 198 endif 193 199 194 200 195 201 ifdef USE_VBOXREM64 196 # Currently we never mix USE_VBOXREM64 and VBoxREM2, so can always use VBoxREM 197 # @todo: assert for that? use $(REM_MOD) instead? 198 # But loading logic got to be updated too. 199 ifeq ($(KBUILD_TARGET), win) 200 DLL += VBoxREM64 201 else 202 IMPORT_LIBS += VBoxREM64 203 endif 204 VBoxREM64_EXTENDS = $(REM_MOD) 205 VBoxREM64_EXTEND_BY = appending 206 VBoxREM64_DEFS := $($(REM_MOD)_DEFS) VBOX_ENABLE_VBOXREM64 207 endif 208 209 ifdef USE_REM_IMP 202 # 203 # The VBoxREM64 module, for targeting 64-bit guests on 32-bit systems. 204 # 205 # Currently we never mix USE_VBOXREM64 and VBoxREM2, so can always use VBoxREM 206 ## @todo: assert for that? use $(REM_MOD) instead? 207 # But loading logic got to be updated too. 208 ifeq ($(KBUILD_TARGET), win) 209 DLL += VBoxREM64 210 else 211 ## @todo see comment above. 212 IMPORT_LIBS += VBoxREM64 213 endif 214 VBoxREM64_EXTENDS = $(REM_MOD) 215 VBoxREM64_EXTENDS_BY = appending 216 VBoxREM64_DEFS = VBOX_ENABLE_VBOXREM64 217 endif # USE_VBOXREM64 218 219 220 if1of ($(KBUILD_TARGET), os2 win) 210 221 # 211 222 # The VBoxREM import library. … … 215 226 # won't be built until after all the other DLLs. 216 227 # 217 VBoxREMImp_TEMPLATE = VBOXR3 228 IMPORT_LIBS += VBoxREMImp 229 VBoxREMImp_TEMPLATE = VBOXR3 218 230 if1of ($(KBUILD_TARGET), os2 win) 219 VBoxREMImp_INST 231 VBoxREMImp_INST = $(INST_LIB) 220 232 else 221 VBoxREMImp_NAME 222 VBoxREMImp_INST 223 endif 224 VBoxREMImp_SOURCES.win 225 VBoxREMImp_SOURCES.os2 233 VBoxREMImp_NAME = VBoxREM 234 VBoxREMImp_INST = $(INST_LIB) 235 endif 236 VBoxREMImp_SOURCES.win = VBoxREM.def 237 VBoxREMImp_SOURCES.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def 226 238 ifeq ($(filter win os2,$(KBUILD_TARGET)),) 227 VBoxREMImp_SOURCES 228 VBoxREMImp_CLEAN 239 VBoxREMImp_SOURCES = $(PATH_VBoxREMImp)/VBoxREMImp.c 240 VBoxREMImp_CLEAN = $(PATH_VBoxREMImp)/VBoxREMImp.c 229 241 endif 230 242 ifneq ($(filter-out darwin os2 win,$(KBUILD_TARGET)),) 231 VBoxREMImp_SONAME 232 endif 233 VBoxREMImp_LDFLAGS.l4 243 VBoxREMImp_SONAME = VBoxREM$(SUFF_DLL) 244 endif 245 VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib 234 246 235 247 $$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@) … … 252 264 endif # USE_REM_IMP 253 265 266 254 267 # 255 268 # The math testcase as a standalone program for testing and debugging purposes.
Note:
See TracChangeset
for help on using the changeset viewer.