toolchain inspection

This commit is contained in:
Michael Davidsaver
2020-03-12 19:52:00 -07:00
parent 25e712eb2a
commit 0fd254d520
5 changed files with 61 additions and 18 deletions
+1
View File
@@ -6,6 +6,7 @@
/include/
/templates/
/configure/*.local
/configure/CONFIG_SITE.Common.*
O.*/
*.orig
*.log
-4
View File
@@ -43,7 +43,3 @@ CHECK_RELEASE = YES
# MSVC - skip defining min()/max() macros and enable APIs
USR_CPPFLAGS_WIN32 += -DNOMINMAX -D_WIN32_WINNT=_WIN32_WINNT_VISTA
ifneq ($(filter-out msvc,$(CMPLR_CLASS)),)
USR_CXXFLAGS += -std=c++11
endif
+15
View File
@@ -8,3 +8,18 @@ CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))
CFG += CONFIG_PVXS_VERSION
include $(TOP)/configure/RULES
ifdef T_A
install: $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
$(TOP)/configure/CONFIG_SITE.Common.$(T_A): toolchain.c
$(PREPROCESS.cpp)
else
clean: cleanToolchain
.PHONY: cleanToolchain
cleanToolchain:
$(RM) $(wildcard CONFIG_SITE.Common.*)
endif
+37
View File
@@ -0,0 +1,37 @@
/* Compiler inspection
*
* expanded as configure/CONFIG_SITE.Common.*
*/
#define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
CONFIG_LOADED=YES
#if __GNUC__
/* also true for clang */
GNUISH=YES
USR_CXXFLAGS += -std=c++11
#endif
#if __GNUC__ && !__clang__
#define GCC_VERSION VERSION_INT(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, 0)
/* LTO takes a nice chunk out of the .so text size, but blows up the .a size */
#if GCC_VERSION>=VERSION_INT(4,9,0,0)
OPT_CFLAGS_YES += -flto
OPT_CXXFLAGS_YES += -flto
USR_LDFLAGS += -flto
#endif
/* Compress debug information on ELF targets for ~25%-50% reduction in .so and .a file size
* (C++ debug info is Huuuge!)
*/
#if __ELF__ && GCC_VERSION>=VERSION_INT(5,0,0,0)
USR_CFLAGS += -gz=zlib
USR_CXXFLAGS += -gz=zlib
/* Actually a binutils feature, which we can't detect.
* Assume binutils upgrade follow gcc
*/
USR_LDFLAGS += -Wl,--compress-debug-sections=zlib
#endif
#endif /* __GNUC__ */
+8 -14
View File
@@ -7,28 +7,22 @@ include $(TOP)/configure/CONFIG
USR_CPPFLAGS += -DPVXS_API_BUILDING
ifneq (,$(filter gcc clang,$(CMPLR_CLASS)))
ifdef T_A
ifneq ($(CONFIG_LOADED),YES)
$(error Toolchain inspection failed $(MAKEFILE_LIST))
endif
endif
ifeq ($(GNUISH),YES)
# we explicitly mark dllimport/export anyway.
# So hide our internal symbols to speed up linking/loading on all targets.
USR_CFLAGS += -fvisibility=hidden
USR_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
# Compress debug information on ELF targets for ~25%-50% reduction in .so and .a file size
# (C++ debug info is Huuuge!)
#USR_CFLAGS_Linux += -gz=zlib
#USR_CXXFLAGS_Linux += -gz=zlib
#USR_LDFLAGS_Linux += -Wl,--compress-debug-sections=zlib
# LTO takes a nice chunk out of the .so text size, but blows up the .a size
#USR_CXXFLAGS += -flto
#USR_LDFLAGS += -flto
endif
# fault on any undefined symbols (eg. from missing LIB_SYS_LIBS)
# breaks on older ncurses (circa RHEL6) not using the INPUT() trick to pull in libtinfo.so
USR_LDFLAGS_Linux += -Wl,--no-undefined -Wl,--no-allow-shlib-undefined
endif
#USR_LDFLAGS_Linux += -Wl,--no-undefined -Wl,--no-allow-shlib-undefined
EXPANDVARS += PVXS_MAJOR_VERSION
EXPANDVARS += PVXS_MINOR_VERSION