gcc80: Partially implement TOOLCHAIN_CHECKING.
authorzrj <rimvydas.jasinskas@gmail.com>
Thu, 17 May 2018 08:30:16 +0000 (11:30 +0300)
committerzrj <zrj@dragonflybsd.org>
Thu, 17 May 2018 12:11:31 +0000 (15:11 +0300)
Will be needed for special feature testing in newer binutils.

gnu/usr.bin/cc80/cc_prep/auto-host.h
gnu/usr.bin/cc80/libbackend/Makefile
gnu/usr.bin/cc80/support-libs/libcommon-target/Makefile
gnu/usr.bin/cc80/support-libs/libcommon/Makefile
gnu/usr.bin/cc80/support-libs/libcpp/config.h

index 24d199e..bc1a799 100644 (file)
 /* Define to 0/1 if you want more run-time sanity checks. This one gets a grab
    bag of miscellaneous but relatively cheap checks. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 #define CHECKING_P 0
+#else
+#define CHECKING_P 1
+#endif
 #endif
 
 
 /* Define to 0/1 if you want extra run-time checking that might affect code
    generation. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 #define ENABLE_EXTRA_CHECKING 0
+#else
+#define ENABLE_EXTRA_CHECKING 1
+#endif
 #endif
 
 
 /* Define if you want the garbage collector to do object poisoning and other
    memory allocation checks. This is quite expensive. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 /* #undef ENABLE_GC_CHECKING */
+#else
+#define ENABLE_GC_CHECKING 1
+#endif
 #endif
 
 
    high-level optimizers) to be checked for dynamic type safety at runtime.
    This is moderately expensive. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 /* #undef ENABLE_GIMPLE_CHECKING */
+#else
+#define ENABLE_GIMPLE_CHECKING 1
+#endif
 #endif
 
 
 /* Define if you want RTL flag accesses to be checked against the RTL codes
    that are supported for each access macro. This is relatively cheap. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 /* #undef ENABLE_RTL_FLAG_CHECKING */
+#else
+#define ENABLE_RTL_FLAG_CHECKING 1
+#endif
 #endif
 
 
    front ends) to be checked for dynamic type safety at runtime. This is
    moderately expensive. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 /* #undef ENABLE_TREE_CHECKING */
+#else
+#define ENABLE_TREE_CHECKING 1
+#endif
 #endif
 
 
 /* Define if you want all gimple types to be verified after gimplifiation.
    This is cheap. */
 #ifndef USED_FOR_TARGET
+#ifndef TOOLCHAIN_CHECKING
 /* #undef ENABLE_TYPES_CHECKING */
+#else
+#define ENABLE_TYPES_CHECKING 1
+#endif
 #endif
 
 
index 973c5d6..f259a1c 100644 (file)
@@ -98,14 +98,12 @@ BACKEND_OBJS= \
        explow.o \
        expmed.o \
        expr.o \
-       fibonacci_heap.o \
        file-prefix-map.o \
        final.o \
        fixed-value.o \
        fold-const.o \
        fold-const-call.o \
        function.o \
-       function-tests.o \
        fwprop.o \
        gcc-rich-location.o \
        gcse.o \
@@ -143,8 +141,6 @@ BACKEND_OBJS= \
        graphite.o \
        gtype-desc.o \
        haifa-sched.o \
-       hash-map-tests.o \
-       hash-set-tests.o \
        hsa-common.o \
        hsa-gen.o \
        hsa-regalloc.o \
@@ -257,7 +253,6 @@ BACKEND_OBJS= \
        resource.o \
        rtl-chkp.o \
        rtl-error.o \
-       rtl-tests.o \
        rtl.o \
        rtlhash.o \
        rtlanal.o \
@@ -270,8 +265,6 @@ BACKEND_OBJS= \
        sel-sched-ir.o \
        sel-sched-dump.o \
        sel-sched.o \
-       selftest-rtl.o \
-       selftest-run-tests.o \
        sese.o \
        shrink-wrap.o \
        simplify-rtx.o \
@@ -388,7 +381,6 @@ BACKEND_OBJS= \
        tree-vector-builder.o \
        tree-vrp.o \
        tree.o \
-       typed-splay-tree.o \
        valtrack.o \
        value-prof.o \
        var-tracking.o \
@@ -402,6 +394,13 @@ BACKEND_OBJS= \
        $(EXTRA_OBJS) \
        $(host_hook_obj)
 
+.if ${CFLAGS:M-DTOOLCHAIN_CHECKING}
+BACKEND_OBJS+= fibonacci_heap.o function-tests.o \
+               hash-map-tests.o hash-set-tests.o \
+               rtl-tests.o selftest-rtl.o \
+               selftest-run-tests.o typed-splay-tree.o
+.endif
+
 # only whwn HAVE_isl
 #BACKEND_OBJS+= \
        graphite-isl-ast-to-gimple.o \
@@ -420,8 +419,11 @@ BACKEND_OBJS= \
        xcoffout.o
 
 OBJS=  ${BACKEND_OBJS}
-SRCS=  gimple-loop-interchange.cc unique-ptr-tests.cc \
-       wide-int.cc wide-int-print.cc
+SRCS=  gimple-loop-interchange.cc wide-int.cc wide-int-print.cc
+
+.if ${CFLAGS:M-DTOOLCHAIN_CHECKING}
+SRCS+= unique-ptr-tests.cc
+.endif
 
 # for gimple-ssa-sprintf.c
 .if ${CCVER:Mgcc47}
index f36cec8..9403cc8 100644 (file)
@@ -9,10 +9,14 @@ INTERNALLIB=  YES
 # Almost verbatim from Makefile
 OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
        opts.o opts-common.o options.o vec.o hooks.o common-targhooks.o \
-       hash-table.o file-find.o spellcheck.o selftest.o
+       hash-table.o file-find.o spellcheck.o
 
 common_out_object_file=        i386-common.o
 
+.if ${CFLAGS:M-DTOOLCHAIN_CHECKING}
+OBJS-libcommon-target+=        selftest.o
+.endif
+
 OBJS=          ${OBJS-libcommon-target}
 CFLAGS+=       -DPREFIX=\"${TOOLS_PREFIX}/usr\"
 
index 1986a9e..a22b934 100644 (file)
@@ -6,8 +6,11 @@ INTERNALLIB=   YES
 # verbatim from Makefile
 OBJS-libcommon= diagnostic.o diagnostic-color.o diagnostic-show-locus.o \
        edit-context.o pretty-print.o intl.o sbitmap.o \
-       vec.o input.o version.o hash-table.o ggc-none.o \
-       selftest.o selftest-diagnostic.o
+       vec.o input.o version.o hash-table.o ggc-none.o
+
+.if ${CFLAGS:M-DTOOLCHAIN_CHECKING}
+OBJS-libcommon+=       selftest.o selftest-diagnostic.o
+.endif
 
 SRCS+=         memory-block.cc
 OBJS+=         ${OBJS-libcommon}
index 6ba73d4..01fa1a8 100644 (file)
@@ -5,7 +5,11 @@
 /* #undef AC_APPLE_UNIVERSAL_BUILD */
 
 /* Define to 1 if you want more run-time sanity checks. */
+#ifndef TOOLCHAIN_CHECKING
 #define CHECKING_P 0
+#else
+#define CHECKING_P 1
+#endif
 
 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
    systems. This function is required for `alloca.c' support on those systems.