Fix x86_64 BuildConfig issues
* Resolve TODO: HOST_GCC_BASE_FLAGS should not be included in HOST_LDFLAGS. Enable adding "-fno-strict-aliasing -fno-tree-vrp" accordingly. * Fix handling of HOST_PLATFORM_IS_64_BIT and HAIKU_HOST_USE_32BIT: The former does now state whether the platform is effectively treated as 64 bit platform, i.e. it actually is 64 bit and the 32 bit mode is not enforced. HAIKU_HOST_USE_32BIT is now only set when the platform is actually 64 bit, but 32 bit mode is enforced.
This commit is contained in:
+25
-16
@@ -127,13 +127,10 @@ if $(HAIKU_USE_GCC_PIPE) = 1 {
|
|||||||
if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
||||||
HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
|
HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
|
||||||
}
|
}
|
||||||
# TODO: With Haiku as the host platform, this does not appear to be set up
|
|
||||||
# correctly, at least when compiling the libbe_test target platform. When
|
if $(HOST_GCC_VERSION[1]) >= 3 {
|
||||||
# enabling the lines below, these flags suddenly appear as link flags passed
|
HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
|
||||||
# to ld as well.
|
}
|
||||||
#if $(HOST_GCC_VERSION[1]) >= 3 {
|
|
||||||
# HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# override gcc 2.95.3's header directory -- strictly necessary only when using
|
# override gcc 2.95.3's header directory -- strictly necessary only when using
|
||||||
# the BeOS native compiler (since its headers are incompatible), but it doesn't
|
# the BeOS native compiler (since its headers are incompatible), but it doesn't
|
||||||
@@ -529,14 +526,26 @@ HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
|
|||||||
|
|
||||||
# analyze the host gcc machine spec to find out about 64-bitness
|
# analyze the host gcc machine spec to find out about 64-bitness
|
||||||
HOST_PLATFORM_IS_64_BIT = ;
|
HOST_PLATFORM_IS_64_BIT = ;
|
||||||
|
switch $(HOST_GCC_MACHINE) {
|
||||||
|
case amd64-* : HOST_PLATFORM_IS_64_BIT = 1 ;
|
||||||
|
case i686-apple-darwin10 : HOST_PLATFORM_IS_64_BIT = 1 ;
|
||||||
|
case x86_64-* : HOST_PLATFORM_IS_64_BIT = 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# If HAIKU_HOST_USE_32BIT is set, add the required gcc base flag (the LD flag
|
||||||
|
# is set later), or, if the architecture isn't actually 64 bit, clear
|
||||||
|
# HAIKU_HOST_USE_32BIT.
|
||||||
|
# Afterwards HOST_PLATFORM_IS_64_BIT will indicate whether the architecture is
|
||||||
|
# effectively (i.e. when using the compiler/linker flags) 64 bit and
|
||||||
|
# HAIKU_HOST_USE_32BIT will be set, iff the architecture is really 64 bit and
|
||||||
|
# 32 bit mode was requested.
|
||||||
if $(HAIKU_HOST_USE_32BIT) = 1 {
|
if $(HAIKU_HOST_USE_32BIT) = 1 {
|
||||||
# enable GCC -m32 option
|
if $(HOST_PLATFORM_IS_64_BIT) {
|
||||||
HOST_GCC_BASE_FLAGS = -m32 ;
|
# enable GCC -m32 option
|
||||||
} else {
|
HOST_GCC_BASE_FLAGS = -m32 ;
|
||||||
switch $(HOST_GCC_MACHINE) {
|
HOST_PLATFORM_IS_64_BIT = ;
|
||||||
case amd64-* : HOST_PLATFORM_IS_64_BIT = 1 ;
|
} else {
|
||||||
case i686-apple-darwin10 : HOST_PLATFORM_IS_64_BIT = 1 ;
|
HAIKU_HOST_USE_32BIT = 0 ;
|
||||||
case x86_64-* : HOST_PLATFORM_IS_64_BIT = 1 ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +559,7 @@ HOST_RANLIB ?= $(RANLIB) ;
|
|||||||
HOST_CPPFLAGS ?= $(CPPFLAGS) ;
|
HOST_CPPFLAGS ?= $(CPPFLAGS) ;
|
||||||
HOST_CCFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(CCFLAGS) ;
|
HOST_CCFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(CCFLAGS) ;
|
||||||
HOST_C++FLAGS ?= $(HOST_GCC_BASE_FLAGS) $(C++FLAGS) ;
|
HOST_C++FLAGS ?= $(HOST_GCC_BASE_FLAGS) $(C++FLAGS) ;
|
||||||
HOST_LDFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(LDFLAGS) ;
|
HOST_LDFLAGS ?= $(LDFLAGS) ;
|
||||||
HOST_LINKFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(LINKFLAGS) ;
|
HOST_LINKFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(LINKFLAGS) ;
|
||||||
HOST_DEFINES ?= $(DEFINES) ;
|
HOST_DEFINES ?= $(DEFINES) ;
|
||||||
HOST_HDRS ?= $(HDRS) ;
|
HOST_HDRS ?= $(HDRS) ;
|
||||||
@@ -682,7 +691,7 @@ for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ld flags
|
# ld flags
|
||||||
if $(HOST_ARCH) = x86_64 && $(HAIKU_HOST_USE_32BIT) = 1 {
|
if $(HAIKU_HOST_USE_32BIT) = 1 {
|
||||||
HOST_LDFLAGS += -melf_i386 ;
|
HOST_LDFLAGS += -melf_i386 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user