This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Implement -fsanitize=null + new sanopt pass
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 13 Nov 2013 06:45:06 +0100
- Subject: Re: [PATCH] Implement -fsanitize=null + new sanopt pass
- Authentication-results: sourceware.org; auth=none
- References: <20131112231348 dot GU30062 at redhat dot com>
On 2013.11.13 at 00:13 +0100, Marek Polacek wrote:
> 2) bootstrap-ubsan almost passes, but the bootstrap fails when building
> all-fixincludes. The problem here is that libiberty.a is built
> with -fsanitize=undefined, but fixincludes, when linking,
> don't link libubsan in. My attemps to tweak
> FIXINC_CFLAGS/LDFLAGS/BOOT_LDFLAGS and whatnot weren't successfull.
I'm using the following patch locally as a part to enable
slim-lto-bootstrap. Maybe it helps in your case, too?
diff --git a/Makefile.in b/Makefile.in
index f9e8e0d5cb79..5db913fa0b8d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2930,6 +2930,7 @@ configure-build-fixincludes:
test ! -f $(BUILD_SUBDIR)/fixincludes/Makefile || exit 0; \
$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/fixincludes ; \
$(BUILD_EXPORTS) \
+ CFLAGS="$(STAGE_CFLAGS)"; export CFLAGS; \
echo Configuring in $(BUILD_SUBDIR)/fixincludes; \
cd "$(BUILD_SUBDIR)/fixincludes" || exit 1; \
case $(srcdir) in \
@@ -2965,6 +2966,7 @@ all-build-fixincludes: configure-build-fixincludes
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/fixincludes && \
$(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
+ CFLAGS="$(STAGE_CFLAGS)" \
$(TARGET-build-fixincludes))
@endif build-fixincludes
@@ -7813,6 +7815,7 @@ configure-fixincludes:
test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes ; \
$(HOST_EXPORTS) \
+ CFLAGS="$(STAGE_CFLAGS)"; export CFLAGS; \
echo Configuring in $(HOST_SUBDIR)/fixincludes; \
cd "$(HOST_SUBDIR)/fixincludes" || exit 1; \
case $(srcdir) in \
@@ -7847,6 +7850,7 @@ all-fixincludes: configure-fixincludes
$(HOST_EXPORTS) \
(cd $(HOST_SUBDIR)/fixincludes && \
$(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \
+ CFLAGS="$(STAGE_CFLAGS)" \
$(TARGET-fixincludes))
@endif fixincludes
--
Markus