libsanitizer: use gnu++14

Message ID a89b005d-6ec7-afce-f361-3922d381d971@suse.cz
State New
Headers show
Series
  • libsanitizer: use gnu++14
Related show

Commit Message

Martin Liška June 8, 2020, 2:53 p.m.
Hi.

Thank you for the report. It's caused by fact that LLVM switch in 4d474e078ac7
to c++14. So that I suggest to use gnu++14.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
I also verified that abidiff is equal for all libsanitizer shared libraries.
I'm going to install the patch if there are no objections.

Thanks,
Martin

Comments

Martin Liška June 9, 2020, 8:09 a.m. | #1
On 6/8/20 4:53 PM, Martin Liška wrote:
> Hi.

> 

> Thank you for the report. It's caused by fact that LLVM switch in 4d474e078ac7

> to c++14. So that I suggest to use gnu++14.

> 

> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

> I also verified that abidiff is equal for all libsanitizer shared libraries.

> I'm going to install the patch if there are no objections.

> 

> Thanks,

> Martin


Installed as 942a384ef9f.
@Andreas: Can you please check the riscv64 build?

Martin
Martin Sebor via Gcc-patches June 9, 2020, 4:32 p.m. | #2
On Tue, Jun 9, 2020 at 10:09 AM Martin Liška <mliska@suse.cz> wrote:
>

> On 6/8/20 4:53 PM, Martin Liška wrote:

> > Hi.

> >

> > Thank you for the report. It's caused by fact that LLVM switch in 4d474e078ac7

> > to c++14. So that I suggest to use gnu++14.

> >

> > Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

> > I also verified that abidiff is equal for all libsanitizer shared libraries.

> > I'm going to install the patch if there are no objections.

> >

> > Thanks,

> > Martin

>

> Installed as 942a384ef9f.

> @Andreas: Can you please check the riscv64 build?


Note we need to document (and configure test?) the build
requirement for non-bootstrap and asan/ubsan bootstraps.

For now we only document the requirement of a C++11
host compiler.  Also not sure whether using -std=gnu++1y
would allow more released compilers to build the code?
For example GCC 4.8.5 knows -std=gnu++1y but not
-std=gnu++14 and GCC 4.8.3 is required for bootstrap anyway.

Richard.

> Martin
Martin Liška June 9, 2020, 7:16 p.m. | #3
On 6/9/20 6:32 PM, Richard Biener wrote:
> On Tue, Jun 9, 2020 at 10:09 AM Martin Liška <mliska@suse.cz> wrote:

>>

>> On 6/8/20 4:53 PM, Martin Liška wrote:

>>> Hi.

>>>

>>> Thank you for the report. It's caused by fact that LLVM switch in 4d474e078ac7

>>> to c++14. So that I suggest to use gnu++14.

>>>

>>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

>>> I also verified that abidiff is equal for all libsanitizer shared libraries.

>>> I'm going to install the patch if there are no objections.

>>>

>>> Thanks,

>>> Martin

>>

>> Installed as 942a384ef9f.

>> @Andreas: Can you please check the riscv64 build?

> 

> Note we need to document (and configure test?) the build

> requirement for non-bootstrap and asan/ubsan bootstraps.


My impression was that libsanitizer is always built with just built GCC?
Note that similarly the run-time needed c++11 since:

commit c5be964a423f952e2ec16e2152ae504639bf8f07
Author: Kostya Serebryany <kcc@google.com>
Date:   Thu Nov 13 20:41:38 2014 +0000

     libsanitizer merge from upstream r221802
     
     From-SVN: r217518

which was a time when GCC was likely built with c++98.

> 

> For now we only document the requirement of a C++11

> host compiler.  Also not sure whether using -std=gnu++1y

> would allow more released compilers to build the code?

> For example GCC 4.8.5 knows -std=gnu++1y but not

> -std=gnu++14 and GCC 4.8.3 is required for bootstrap anyway.


Do we really care about these compilers as one typically (always?)
use newly built GCC?

Martin

> 

> Richard.

> 

>> Martin
Martin Sebor via Gcc-patches June 10, 2020, 10:47 a.m. | #4
On Tue, Jun 9, 2020 at 9:16 PM Martin Liška <mliska@suse.cz> wrote:
>

> On 6/9/20 6:32 PM, Richard Biener wrote:

> > On Tue, Jun 9, 2020 at 10:09 AM Martin Liška <mliska@suse.cz> wrote:

> >>

> >> On 6/8/20 4:53 PM, Martin Liška wrote:

> >>> Hi.

> >>>

> >>> Thank you for the report. It's caused by fact that LLVM switch in 4d474e078ac7

> >>> to c++14. So that I suggest to use gnu++14.

> >>>

> >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

> >>> I also verified that abidiff is equal for all libsanitizer shared libraries.

> >>> I'm going to install the patch if there are no objections.

> >>>

> >>> Thanks,

> >>> Martin

> >>

> >> Installed as 942a384ef9f.

> >> @Andreas: Can you please check the riscv64 build?

> >

> > Note we need to document (and configure test?) the build

> > requirement for non-bootstrap and asan/ubsan bootstraps.

>

> My impression was that libsanitizer is always built with just built GCC?


I guess you are right.

> Note that similarly the run-time needed c++11 since:

>

> commit c5be964a423f952e2ec16e2152ae504639bf8f07

> Author: Kostya Serebryany <kcc@google.com>

> Date:   Thu Nov 13 20:41:38 2014 +0000

>

>      libsanitizer merge from upstream r221802

>

>      From-SVN: r217518

>

> which was a time when GCC was likely built with c++98.

>

> >

> > For now we only document the requirement of a C++11

> > host compiler.  Also not sure whether using -std=gnu++1y

> > would allow more released compilers to build the code?

> > For example GCC 4.8.5 knows -std=gnu++1y but not

> > -std=gnu++14 and GCC 4.8.3 is required for bootstrap anyway.

>

> Do we really care about these compilers as one typically (always?)

> use newly built GCC?

>

> Martin

>

> >

> > Richard.

> >

> >> Martin

>

Patch

From d5cc8547786f296931c93c63b3431c65ed8e7d3d Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 8 Jun 2020 16:04:31 +0200
Subject: [PATCH] libsanitizer: use gnu++14

libsanitizer/ChangeLog:

	* asan/Makefile.am: Replace gnu++11 with gnu++14.
	* interception/Makefile.am: Likewise.
	* libbacktrace/Makefile.am: Likewise.
	* lsan/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* ubsan/Makefile.am: Likewise.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Likewise.
	* libbacktrace/Makefile.in: Likewise.
	* lsan/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.
	* ubsan/Makefile.in: Likewise.
---
 libsanitizer/asan/Makefile.am             | 2 +-
 libsanitizer/asan/Makefile.in             | 2 +-
 libsanitizer/interception/Makefile.am     | 2 +-
 libsanitizer/interception/Makefile.in     | 2 +-
 libsanitizer/libbacktrace/Makefile.am     | 2 +-
 libsanitizer/libbacktrace/Makefile.in     | 2 +-
 libsanitizer/lsan/Makefile.am             | 2 +-
 libsanitizer/lsan/Makefile.in             | 2 +-
 libsanitizer/sanitizer_common/Makefile.am | 2 +-
 libsanitizer/sanitizer_common/Makefile.in | 2 +-
 libsanitizer/tsan/Makefile.am             | 2 +-
 libsanitizer/tsan/Makefile.in             | 2 +-
 libsanitizer/ubsan/Makefile.am            | 2 +-
 libsanitizer/ubsan/Makefile.in            | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am
index 7bba555b171..2e6385509b4 100644
--- a/libsanitizer/asan/Makefile.am
+++ b/libsanitizer/asan/Makefile.am
@@ -9,7 +9,7 @@  DEFS += -DMAC_INTERPOSE_FUNCTIONS -DMISSING_BLOCKS_SUPPORT
 endif
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -fno-ipa-icf
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config
 
diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in
index bad15b7984f..29622bf466a 100644
--- a/libsanitizer/asan/Makefile.in
+++ b/libsanitizer/asan/Makefile.in
@@ -419,7 +419,7 @@  AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
 	-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
 	-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
 	-Wno-variadic-macros -fno-ipa-icf \
-	$(LIBSTDCXX_RAW_CXX_CXXFLAGS) -std=gnu++11 $(EXTRA_CXXFLAGS)
+	$(LIBSTDCXX_RAW_CXX_CXXFLAGS) -std=gnu++14 $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config
 toolexeclib_LTLIBRARIES = libasan.la
 nodist_toolexeclib_HEADERS = libasan_preinit.o
diff --git a/libsanitizer/interception/Makefile.am b/libsanitizer/interception/Makefile.am
index a22e0b4e2af..efa90a49aa1 100644
--- a/libsanitizer/interception/Makefile.am
+++ b/libsanitizer/interception/Makefile.am
@@ -6,7 +6,7 @@  gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/interception/Makefile.in
index c8868faa0c3..a20f52ea4b8 100644
--- a/libsanitizer/interception/Makefile.in
+++ b/libsanitizer/interception/Makefile.in
@@ -337,7 +337,7 @@  AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
 	-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
 	-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
 	-Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
-	-std=gnu++11 $(EXTRA_CXXFLAGS)
+	-std=gnu++14 $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 noinst_LTLIBRARIES = libinterception.la
 interception_files = \
diff --git a/libsanitizer/libbacktrace/Makefile.am b/libsanitizer/libbacktrace/Makefile.am
index 9c752272be1..16accd468df 100644
--- a/libsanitizer/libbacktrace/Makefile.am
+++ b/libsanitizer/libbacktrace/Makefile.am
@@ -41,7 +41,7 @@  CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
 AM_CFLAGS = $(C_WARN_FLAGS)
 AM_CFLAGS += $(EXTRA_CFLAGS)
 AM_CXXFLAGS = $(CXX_WARN_FLAGS) -fno-rtti -fno-exceptions
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 
 noinst_LTLIBRARIES = libsanitizer_libbacktrace.la
diff --git a/libsanitizer/libbacktrace/Makefile.in b/libsanitizer/libbacktrace/Makefile.in
index 8e6507872e7..c843bcee0e4 100644
--- a/libsanitizer/libbacktrace/Makefile.in
+++ b/libsanitizer/libbacktrace/Makefile.in
@@ -389,7 +389,7 @@  WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \
 C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
 CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
 AM_CFLAGS = $(C_WARN_FLAGS) $(EXTRA_CFLAGS)
-AM_CXXFLAGS = $(CXX_WARN_FLAGS) -fno-rtti -fno-exceptions -std=gnu++11 \
+AM_CXXFLAGS = $(CXX_WARN_FLAGS) -fno-rtti -fno-exceptions -std=gnu++14 \
 	$(EXTRA_CXXFLAGS)
 noinst_LTLIBRARIES = libsanitizer_libbacktrace.la
 libsanitizer_libbacktrace_la_SOURCES = \
diff --git a/libsanitizer/lsan/Makefile.am b/libsanitizer/lsan/Makefile.am
index 62ea17dccec..c76d8a3aa8f 100644
--- a/libsanitizer/lsan/Makefile.am
+++ b/libsanitizer/lsan/Makefile.am
@@ -6,7 +6,7 @@  gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/libsanitizer/lsan/Makefile.in b/libsanitizer/lsan/Makefile.in
index acc76ca1342..23a6fa69ec6 100644
--- a/libsanitizer/lsan/Makefile.in
+++ b/libsanitizer/lsan/Makefile.in
@@ -382,7 +382,7 @@  AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
 	-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
 	-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
 	-Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
-	-std=gnu++11 $(EXTRA_CXXFLAGS)
+	-std=gnu++14 $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 noinst_LTLIBRARIES = libsanitizer_lsan.la
 @LSAN_SUPPORTED_TRUE@toolexeclib_LTLIBRARIES = liblsan.la
diff --git a/libsanitizer/sanitizer_common/Makefile.am b/libsanitizer/sanitizer_common/Makefile.am
index 9653f27c09f..7cba5342647 100644
--- a/libsanitizer/sanitizer_common/Makefile.am
+++ b/libsanitizer/sanitizer_common/Makefile.am
@@ -6,7 +6,7 @@  gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 if LIBBACKTRACE_SUPPORTED
 AM_CXXFLAGS += -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE \
diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sanitizer_common/Makefile.in
index d04416f1852..299de50b34a 100644
--- a/libsanitizer/sanitizer_common/Makefile.in
+++ b/libsanitizer/sanitizer_common/Makefile.in
@@ -374,7 +374,7 @@  AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
 	-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
 	-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
 	-Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
-	-std=gnu++11 $(EXTRA_CXXFLAGS) $(am__append_1)
+	-std=gnu++14 $(EXTRA_CXXFLAGS) $(am__append_1)
 AM_CCASFLAGS = $(EXTRA_ASFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 noinst_LTLIBRARIES = libsanitizer_common.la
diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am
index 5d37abd20de..fb20ff7e311 100644
--- a/libsanitizer/tsan/Makefile.am
+++ b/libsanitizer/tsan/Makefile.am
@@ -6,7 +6,7 @@  gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DCAN_SANITIZE_UB=0
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in
index 74896427edf..bfbdfe0d89c 100644
--- a/libsanitizer/tsan/Makefile.in
+++ b/libsanitizer/tsan/Makefile.in
@@ -411,7 +411,7 @@  AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
 	-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
 	-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
 	-Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
-	-std=gnu++11 $(EXTRA_CXXFLAGS)
+	-std=gnu++14 $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 toolexeclib_LTLIBRARIES = libtsan.la
 nodist_toolexeclib_HEADERS = libtsan_preinit.o
diff --git a/libsanitizer/ubsan/Makefile.am b/libsanitizer/ubsan/Makefile.am
index 46021d6c8fa..9654fb2afc4 100644
--- a/libsanitizer/ubsan/Makefile.am
+++ b/libsanitizer/ubsan/Makefile.am
@@ -6,7 +6,7 @@  gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DPIC -DCAN_SANITIZE_UB=1 -DUBSAN_CAN_USE_CXXABI=1
 AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long  -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
 AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
-AM_CXXFLAGS += -std=gnu++11
+AM_CXXFLAGS += -std=gnu++14
 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.in
index 654cb648540..312d6a5e513 100644
--- a/libsanitizer/ubsan/Makefile.in
+++ b/libsanitizer/ubsan/Makefile.in
@@ -376,7 +376,7 @@  AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \
 	-Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \
 	-fomit-frame-pointer -funwind-tables -fvisibility=hidden \
 	-Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
-	-std=gnu++11 $(EXTRA_CXXFLAGS)
+	-std=gnu++14 $(EXTRA_CXXFLAGS)
 ACLOCAL_AMFLAGS = -I m4
 toolexeclib_LTLIBRARIES = libubsan.la
 ubsan_plugin_files = \
-- 
2.26.2