From: Martin Liska Date: Thu, 10 May 2018 10:15:42 +0000 (+0200) Subject: Improve boostrap-ubsan config (PR bootstrap/64914). X-Git-Tag: basepoints/gcc-10~6891 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84ec5aea4833897a100ca6a3a257ebab23b44f93;p=thirdparty%2Fgcc.git Improve boostrap-ubsan config (PR bootstrap/64914). 2018-05-10 Martin Liska PR bootstrap/64914 * bootstrap-ubsan.mk: Define UBSAN_BOOTSTRAP. 2018-05-10 Martin Liska PR bootstrap/64914 * md5.c: Use strict alignment with UBSAN_BOOTSTRAP. From-SVN: r260112 --- diff --git a/config/ChangeLog b/config/ChangeLog index 3a488a1ae351..ef58a91545bb 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2018-05-10 Martin Liska + + PR bootstrap/64914 + * bootstrap-ubsan.mk: Define UBSAN_BOOTSTRAP. + 2018-05-09 Joshua Watt * ax_pthread.m4: Add file. diff --git a/config/bootstrap-ubsan.mk b/config/bootstrap-ubsan.mk index d2615e8f807b..1d85fe1c836d 100644 --- a/config/bootstrap-ubsan.mk +++ b/config/bootstrap-ubsan.mk @@ -1,8 +1,8 @@ # This option enables -fsanitize=undefined for stage2 and stage3. -STAGE2_CFLAGS += -fsanitize=undefined -STAGE3_CFLAGS += -fsanitize=undefined -POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan \ +STAGE2_CFLAGS += -fsanitize=undefined -DUBSAN_BOOTSTRAP +STAGE3_CFLAGS += -fsanitize=undefined -DUBSAN_BOOTSTRAP +POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -DUBSAN_BOOTSTRAP \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/ \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/.libs diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index a116d3731001..b249226155c9 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2018-05-10 Martin Liska + + PR bootstrap/64914 + * md5.c: Use strict alignment with UBSAN_BOOTSTRAP. + 2018-04-30 Daniel van Gerpen * argv.c (expandargv): Fix memory leak for copied argv. diff --git a/libiberty/md5.c b/libiberty/md5.c index f106d2262cad..4dd5186a69a1 100644 --- a/libiberty/md5.c +++ b/libiberty/md5.c @@ -231,7 +231,7 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) /* Process available complete blocks. */ if (len > 64) { -#if !_STRING_ARCH_unaligned +#if !_STRING_ARCH_unaligned || defined UBSAN_BOOTSTRAP /* To check alignment gcc has an appropriate operator. Other compilers don't. */ # if __GNUC__ >= 2