From afde44733fdff43256384ea0441585a082e73c95 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 31 Jul 2014 18:05:36 +0200 Subject: [PATCH] * When using the non-legacy compiler, use the c++ and gcc headers provided in the gcc_syslibs_devel build feature for building Haiku. * Simplify declaration of c++ and gcc headers for the legacy compiler - in the end we always use the ones living by our source tree anyway. * Fix a couple of missing local declarations for jam variables, which were necessary to avoid a build problem with strace. There are probably more bugs like these hiding in our build system files, but I'm saving the fix for those to the next commit. * Add new gcc packages to the HaikuPorts (x86*-)repositories. --- Jamfile | 9 +++++++++ build/jam/ArchitectureRules | 8 -------- build/jam/BuildSetup | 3 +++ build/jam/HeadersRules | 17 +++++++++-------- build/jam/LocaleRules | 3 ++- build/jam/MainBuildRules | 5 ++++- build/jam/OverriddenJamRules | 3 ++- build/jam/repositories/HaikuPorts/x86 | 7 +++++-- build/jam/repositories/HaikuPorts/x86_64 | 6 ++++-- build/jam/repositories/HaikuPorts/x86_gcc2 | 7 +++++-- src/libs/stdc++/legacy/Jamfile | 2 +- src/tools/gensyscalls/Jamfile | 1 + 12 files changed, 45 insertions(+), 26 deletions(-) diff --git a/Jamfile b/Jamfile index 9a1295ab03..4d17047bd5 100644 --- a/Jamfile +++ b/Jamfile @@ -8,6 +8,15 @@ local architectureObject ; for architectureObject in [ MultiArchSubDirSetup ] { on $(architectureObject) { include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ; + + # Let the target platform depend on the external header directories such + # that those will be unpacked before anything is built for the target + # platform. + Depends $(TARGET_PLATFORM) : [ + BuildFeatureAttribute gcc_syslibs_devel : c++-headers + ] [ + BuildFeatureAttribute gcc_syslibs_devel : gcc-headers + ] ; } } diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index f4e34277f6..004becb8b0 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -54,14 +54,6 @@ rule ArchitectureSetup architecture } HAIKU_GCC_BASE_FLAGS_$(architecture) = $(gccBaseFlags) ; - # 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 harm for the cross-compiler either. - if $(gccVersion[1]) = 2 { - HAIKU_GCC_HEADERS_DIR_$(architecture) - = [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ; - } - # initial state for flags etc. HAIKU_C++_$(architecture) ?= $(HAIKU_CC_$(architecture)) ; HAIKU_LINK_$(architecture) = $(HAIKU_CC_$(architecture)) ; diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 099489aae5..3f82f42fe6 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -866,6 +866,9 @@ SUPPORTED_PLATFORMS = haiku ; # initializations that are required before anything is built for a specific # platform can be forced by depending the pseudo target for the platform on the # initializations. +# This is currently used to unpack the external headers from the +# gcc_syslibs_devel build feature before anything is built for the target +# platform. NotFile $(TARGET_PLATFORM) ; NotFile host ; diff --git a/build/jam/HeadersRules b/build/jam/HeadersRules index bbbfcb970c..3b812ad8bb 100644 --- a/build/jam/HeadersRules +++ b/build/jam/HeadersRules @@ -137,7 +137,7 @@ rule PublicHeaders local list = $(1) ; local dirs ; - + local i ; for i in $(list) { dirs += [ FDirName $(HAIKU_TOP) headers os $(i) ] ; } @@ -154,6 +154,7 @@ rule PrivateHeaders local list = $(1) ; local dirs ; + local i ; for i in $(list) { dirs += [ FDirName $(HAIKU_TOP) headers private $(i) ] ; } @@ -170,6 +171,7 @@ rule PrivateBuildHeaders local list = $(1) ; local dirs ; + local i ; for i in $(list) { dirs += [ FDirName $(HAIKU_TOP) headers build private $(i) ] ; } @@ -186,6 +188,7 @@ rule LibraryHeaders local list = $(1) ; local dirs ; + local i ; for i in $(list) { dirs += [ FDirName $(HAIKU_TOP) headers libs $(i) ] ; } @@ -453,17 +456,15 @@ rule FStandardHeaders architecture local headers = ; - # The C++ headers. If specified, we use the compiler headers, otherwise - # the ones that come with our libstdc++. - if $(HAIKU_C++_HEADERS_DIR_$(architecture)) { - headers += $(HAIKU_C++_HEADERS_DIR_$(architecture)) ; + # The C++ headers and gcc headers. + if $(architecture) != x86_gcc2 { + headers += [ C++HeaderDirectories $(architecture) ] ; + headers += [ GccHeaderDirectories $(architecture) ] ; } else { headers += [ FDirName $(HAIKU_TOP) headers cpp ] ; + headers += [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ; } - # GCC headers - headers += $(HAIKU_GCC_HEADERS_DIR_$(architecture)) ; - # Use headers directory, to allow to do things like include headers += [ FDirName $(HAIKU_TOP) headers ] ; diff --git a/build/jam/LocaleRules b/build/jam/LocaleRules index e5e34fbaaf..e24a38770c 100644 --- a/build/jam/LocaleRules +++ b/build/jam/LocaleRules @@ -32,7 +32,8 @@ rule ExtractCatalogEntries target : sources : signature : regexp localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ; systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ; } else { - sysHeaders += $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ; + sysHeaders += [ FStandardHeaders $(TARGET_PACKAGING_ARCH) ] + $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ; defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH)) $(TARGET_DEFINES) ; cc = $(TARGET_CC_$(TARGET_PACKAGING_ARCH)) ; diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index 317dd61ee9..6ca4674126 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -274,7 +274,8 @@ rule CreateAsmStructOffsetsHeader header : source } } else { - sysHeaders += $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ; + sysHeaders += [ FStandardHeaders $(TARGET_PACKAGING_ARCH) ] + $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ; defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH)) $(TARGET_DEFINES) ; } @@ -491,6 +492,8 @@ rule LinkAgainst local mapLibs = $(3:E=true) ; on $(target) { + local i ; + # map libraries, if desired and target platform is Haiku local map = $(TARGET_LIBRARY_NAME_MAP_$(TARGET_PACKAGING_ARCH)) ; if $(PLATFORM) != host && $(mapLibs) = true && $(map) { diff --git a/build/jam/OverriddenJamRules b/build/jam/OverriddenJamRules index 43f426780c..e05d37adb1 100644 --- a/build/jam/OverriddenJamRules +++ b/build/jam/OverriddenJamRules @@ -108,7 +108,8 @@ rule Object } } else { - sysHeaders += $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ; + sysHeaders += [ FStandardHeaders $(TARGET_PACKAGING_ARCH) ] + $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ; defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH)) $(TARGET_DEFINES) ; } diff --git a/build/jam/repositories/HaikuPorts/x86 b/build/jam/repositories/HaikuPorts/x86 index b2add747be..8921601c86 100644 --- a/build/jam/repositories/HaikuPorts/x86 +++ b/build/jam/repositories/HaikuPorts/x86 @@ -44,7 +44,9 @@ RemotePackageRepository HaikuPorts freetype-2.5.2-3 freetype_devel-2.5.2-3 gawk-4.1.0-2 - gcc-4.8.3_2014_05_28-2 + gcc-4.8.3_2014_07_26-1 + gcc_syslibs-4.8.3_2014_07_26-1 + gcc_syslibs_devel-4.8.3_2014_07_26-1 gettext-0.18.1.1-5 gettext_libintl-0.18.1.1-5 git-1.8.3.4-2 @@ -177,6 +179,7 @@ RemotePackageRepository HaikuPorts freetype_x86_gcc2-2.5.2-3 freetype_x86_gcc2_devel-2.5.2-3 gcc_x86_gcc2-2.95.3_2014_07_26-1 + gcc_x86_gcc2_syslibs_devel-2.95.3_2014_07_26-1 gettext_x86_gcc2-0.18.1.1-5 gettext_x86_gcc2_libintl-0.18.1.1-5 glu_x86_gcc2-9.0.0-2 @@ -244,7 +247,7 @@ RemotePackageRepository HaikuPorts fossil freetype gawk -# gcc + gcc gcc_x86_gcc2 gettext git diff --git a/build/jam/repositories/HaikuPorts/x86_64 b/build/jam/repositories/HaikuPorts/x86_64 index ac59c0e26b..1bd645ff39 100644 --- a/build/jam/repositories/HaikuPorts/x86_64 +++ b/build/jam/repositories/HaikuPorts/x86_64 @@ -40,7 +40,9 @@ RemotePackageRepository HaikuPorts freetype-2.5.2-3 freetype_devel-2.5.2-3 gawk-4.1.0-2 - gcc-4.8.3_2014_05_28-3 + gcc-4.8.3_2014_07_26-1 + gcc_syslibs-4.8.3_2014_07_26-1 + gcc_syslibs_devel-4.8.3_2014_07_26-1 gettext-0.18.1.1-5 gettext_libintl-0.18.1.1-5 git-1.8.3.4-3 @@ -182,7 +184,7 @@ RemotePackageRepository HaikuPorts fossil freetype gawk -# gcc + gcc gettext git glu diff --git a/build/jam/repositories/HaikuPorts/x86_gcc2 b/build/jam/repositories/HaikuPorts/x86_gcc2 index 7f619ef991..46877e8c14 100644 --- a/build/jam/repositories/HaikuPorts/x86_gcc2 +++ b/build/jam/repositories/HaikuPorts/x86_gcc2 @@ -71,6 +71,7 @@ RemotePackageRepository HaikuPorts friss-0.8beta-1 gawk-4.1.0-2 gcc-2.95.3_2014_07_26-1 + gcc_syslibs_devel-2.95.3_2014_07_26-1 getconf-r260000-1 getopt-1.1.5-1 gettext-0.18.1.1-6 @@ -333,7 +334,9 @@ RemotePackageRepository HaikuPorts ffmpeg_x86_devel-0.10.14-1 freetype_x86-2.5.2-2 freetype_x86_devel-2.5.2-2 - gcc_x86-4.8.3_2014_05_28-3 + gcc_x86-4.8.3_2014_07_26-1 + gcc_x86_syslibs-4.8.3_2014_07_26-1 + gcc_x86_syslibs_devel-4.8.3_2014_07_26-1 gettext_x86-0.18.1.1-6 gettext_x86_libintl-0.18.1.1-6 giflib_x86-5.1.0-1 @@ -549,7 +552,7 @@ RemotePackageRepository HaikuPorts friss gawk gcc -# gcc_x86 + gcc_x86 getconf getopt gettext diff --git a/src/libs/stdc++/legacy/Jamfile b/src/libs/stdc++/legacy/Jamfile index 3593847240..26637ff21d 100644 --- a/src/libs/stdc++/legacy/Jamfile +++ b/src/libs/stdc++/legacy/Jamfile @@ -31,7 +31,7 @@ for architectureObject in [ MultiArchSubDirSetup x86_gcc2 ] { [ FDirName $(HAIKU_TOP) headers os kernel ] [ FDirName $(HAIKU_TOP) headers os storage ] [ FDirName $(HAIKU_TOP) headers os support ] - $(HAIKU_GCC_HEADERS_DIR_x86_gcc2) + [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] # so that include_next will work ; diff --git a/src/tools/gensyscalls/Jamfile b/src/tools/gensyscalls/Jamfile index 58a8870541..4e6f315ee4 100644 --- a/src/tools/gensyscalls/Jamfile +++ b/src/tools/gensyscalls/Jamfile @@ -43,6 +43,7 @@ rule PreprocessSyscalls preprocessedHeader : header : architecture $(TARGET_PRIVATE_SYSTEM_HEADERS_$(architecture)) [ ArchHeaders $(TARGET_ARCH_$(architecture)) ] [ on $(preprocessedHeader) return $(SUBDIRSYSHDRS) $(SYSHDRS) ] + [ FStandardHeaders $(architecture) ] $(TARGET_HDRS_$(architecture)) ; HDRS on $(preprocessedHeader) = $(headers) ;