From f5477163536cc240885298d639c4c0051f495bcf Mon Sep 17 00:00:00 2001 From: John Marino Date: Fri, 13 Feb 2015 23:09:44 +0100 Subject: [PATCH] gcc50: use DF stddef.h by adding max_align_t 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 | 1 + gnu/lib/gcc50/libgcc/Makefile | 3 +-- include/stddef.h | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index 428cee790e..d6eea2f3d1 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -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 diff --git a/gnu/lib/gcc50/libgcc/Makefile b/gnu/lib/gcc50/libgcc/Makefile index 2622d2492f..5a77be8a06 100644 --- a/gnu/lib/gcc50/libgcc/Makefile +++ b/gnu/lib/gcc50/libgcc/Makefile @@ -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 diff --git a/include/stddef.h b/include/stddef.h index acf07dc035..5fc9dbad0b 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -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_ */ -- 2.41.0