gcc50: use DF stddef.h by adding max_align_t
authorJohn Marino <draco@marino.st>
Fri, 13 Feb 2015 22:09:44 +0000 (23:09 +0100)
committerJohn Marino <draco@marino.st>
Sat, 14 Feb 2015 07:05:23 +0000 (08:05 +0100)
C11 and C++11 need the max_align_t type definition.  In order to get it,
the gcc version was installed at /usr/libdata/gcc50/stddef.h.  We'd
rather the base gcc use only system-provided headers, so the max_align_t
structure has been added to /usr/include/stddef.h

patch-from: swildner

Makefile_upgrade.inc
gnu/lib/gcc50/libgcc/Makefile
include/stddef.h

index 428cee7..d6eea2f 100644 (file)
@@ -2819,6 +2819,7 @@ TO_REMOVE+=/usr/share/man/man1/g++44.1.gz
 TO_REMOVE+=/usr/share/man/man1/gcc44.1.gz
 TO_REMOVE+=/usr/share/man/man1/gcov44.1.gz
 TO_REMOVE+=/usr/share/mk/bsd.cpu.gcc44.mk
+TO_REMOVE+=/usr/libdata/gcc50/stddef.h
 
 .if ${MACHINE_ARCH} == "x86_64"
 TO_REMOVE+=/usr/sbin/stlstats
index 2622d24..5a77be8 100644 (file)
@@ -97,8 +97,7 @@ EXTRA_HEADERS = \
        ${GCCDIR}/gcc/config/i386/avx512vbmivlintrin.h \
        ${GCCDIR}/gcc/config/i386/clwbintrin.h \
        ${GCCDIR}/gcc/config/i386/pcommitintrin.h \
-       ${GCCDIR}/gcc/ginclude/tgmath.h \
-       ${GCCDIR}/gcc/ginclude/stddef.h
+       ${GCCDIR}/gcc/ginclude/tgmath.h
 
 #generated sources
 SRCS+= mm_malloc.h unwind.h
index acf07dc..5fc9dba 100644 (file)
@@ -70,4 +70,12 @@ typedef __wchar_t    wchar_t;        /* open group */
 
 #define        offsetof(type, member)  __offsetof(type, member)
 
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) || \
+    (defined(__cplusplus) && __cplusplus >= 201103L))
+typedef struct {
+       long long __max_align_nonce1 __aligned(__alignof(long long));
+       long double __max_align_nonce2 __aligned(__alignof(long double));
+} max_align_t;
+#endif
+
 #endif /* _STDDEF_H_ */