libsanitizer: Replace memcpy with internal version in sanitizer_common

Message ID 20240116141139.3477027-1-cederman@gaisler.com
State New
Headers
Series libsanitizer: Replace memcpy with internal version in sanitizer_common |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed

Commit Message

Daniel Cederman Jan. 16, 2024, 2:11 p.m. UTC
  When GCC is configured with --enable-target-optspace the compiler generates
a memcpy call in the Symbolizer constructor in sanitizer_symbolizer.cpp
when compiling for SPARC V8. Add HAVE_AS_SYM_ASSIGN to replace it with a
call to __sanitizer_internal_memcpy.

libsanitizer/ChangeLog:

	* sanitizer_common/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
	* sanitizer_common/Makefile.in: Regenerate.
---
 libsanitizer/sanitizer_common/Makefile.am | 2 +-
 libsanitizer/sanitizer_common/Makefile.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jakub Jelinek Jan. 16, 2024, 2:44 p.m. UTC | #1
On Tue, Jan 16, 2024 at 03:11:39PM +0100, Daniel Cederman wrote:
> When GCC is configured with --enable-target-optspace the compiler generates
> a memcpy call in the Symbolizer constructor in sanitizer_symbolizer.cpp
> when compiling for SPARC V8. Add HAVE_AS_SYM_ASSIGN to replace it with a
> call to __sanitizer_internal_memcpy.
> 
> libsanitizer/ChangeLog:
> 
> 	* sanitizer_common/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
> 	* sanitizer_common/Makefile.in: Regenerate.

Ok.

	Jakub
  
Daniel Cederman Jan. 17, 2024, 8:17 a.m. UTC | #2
On 2024-01-16 15:44, Jakub Jelinek wrote:
> On Tue, Jan 16, 2024 at 03:11:39PM +0100, Daniel Cederman wrote:
>> When GCC is configured with --enable-target-optspace the compiler generates
>> a memcpy call in the Symbolizer constructor in sanitizer_symbolizer.cpp
>> when compiling for SPARC V8. Add HAVE_AS_SYM_ASSIGN to replace it with a
>> call to __sanitizer_internal_memcpy.
>>
>> libsanitizer/ChangeLog:
>>
>> 	* sanitizer_common/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
>> 	* sanitizer_common/Makefile.in: Regenerate.
> 
> Ok.
> 
> 	Jakub
> 

We have only been granted write approval for the SPARC port. Is it
ok to push this anyway or could you help us with it?

/Daniel
  
Jakub Jelinek Jan. 17, 2024, 9:17 a.m. UTC | #3
On Wed, Jan 17, 2024 at 09:17:09AM +0100, Daniel Cederman wrote:
> On 2024-01-16 15:44, Jakub Jelinek wrote:
> > On Tue, Jan 16, 2024 at 03:11:39PM +0100, Daniel Cederman wrote:
> > > When GCC is configured with --enable-target-optspace the compiler generates
> > > a memcpy call in the Symbolizer constructor in sanitizer_symbolizer.cpp
> > > when compiling for SPARC V8. Add HAVE_AS_SYM_ASSIGN to replace it with a
> > > call to __sanitizer_internal_memcpy.
> > > 
> > > libsanitizer/ChangeLog:
> > > 
> > > 	* sanitizer_common/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
> > > 	* sanitizer_common/Makefile.in: Regenerate.
> > 
> > Ok.
> 
> We have only been granted write approval for the SPARC port. Is it
> ok to push this anyway or could you help us with it?

I don't think anyone has write access only to a part of the git repository.
So, if you are Write After Approval (which seems you are according to
MAINTAINERS), you should be able to commit any patch approved by
maintainers or reviewers.

	Jakub
  

Patch

diff --git a/libsanitizer/sanitizer_common/Makefile.am b/libsanitizer/sanitizer_common/Makefile.am
index 02afe65620a2..9ed6ef88775a 100644
--- a/libsanitizer/sanitizer_common/Makefile.am
+++ b/libsanitizer/sanitizer_common/Makefile.am
@@ -3,7 +3,7 @@  AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) -isystem $(top_srcdir)/i
 # May be used by toolexeclibdir.
 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@
+DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@ @AS_SYM_ASSIGN_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++14
diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sanitizer_common/Makefile.in
index 45141930f9fa..31fff8236fee 100644
--- a/libsanitizer/sanitizer_common/Makefile.in
+++ b/libsanitizer/sanitizer_common/Makefile.in
@@ -245,7 +245,7 @@  CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@
+DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@ @AS_SYM_ASSIGN_DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@