platform/upstream/linaro-gcc.git
6 years agoPR other/86198 10/182010/2
Denis Khalikov [Tue, 19 Jun 2018 10:12:36 +0000 (13:12 +0300)]
PR other/86198

* elf.c (elf_add): Increase ".note.gnu.build-id" section size
checking up to 36 bytes.

Change-Id: I5a6046a551395ad61c8013a347c875ad22b33599

6 years agoPR sanitizer/86090 32/181532/3
Denis Khalikov [Thu, 14 Jun 2018 12:59:00 +0000 (15:59 +0300)]
PR sanitizer/86090

  libsanitizer/
  * configure.ac: Check for lstat and readlink.
  * configure, config.h.in: Rebuild.

Change-Id: I3c81a03c34828604f3be9db3906c4ecffafc360c

6 years agoPR other/67165 54/181154/2
Denis Khalikov [Thu, 7 Jun 2018 12:36:22 +0000 (15:36 +0300)]
PR other/67165

* elf.c (__builtin_prefetch): Define if not __GNUC__.
(unlikely): Define.
(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
(b_elf_chdr): Define type.
(enum debug_section): Add ZDEBUG_xxx values.
(debug_section_names): Add names for new sections.
(struct debug_section_info): Add compressed field.
(elf_zlib_failed, elf_zlib_fetch): New static functions.
(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
(HUFFMAN_SECONDARY_SHIFT): Define.
(ZDEBUG_TABLE_SIZE): Define.
(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
(final_next_secondary): New static variable if
BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
(elf_zlib_inflate_table): New static function.
(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
function to produce fixed Huffman table.
(elf_zlib_default_table): New static variable.
(elf_zlib_inflate): New static function.
(elf_zlib_verify_checksum): Likewise.
(elf_zlib_inflate_and_verify): Likewise.
(elf_uncompress_zdebug): Likewise.
(elf_uncompress_chdr): Likewise.
(backtrace_uncompress_zdebug): New extern function.
(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
sections, and uncompress them.
* internal.h (backtrace_compress_zdebug): Declare.
* ztest.c: New file.
* configure.ac: Check for -lz and check whether the linker
supports --compress-debug-sections.
* Makefile.am (ztest_SOURCES): New variable.
(ztest_CFLAGS, ztest_LDADD): New variables.
(check_PROGRAMS): Add ztest.
(ctestg_SOURCES): New variable.
(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
(ctesta_SOURCES): New variable.
(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
(check_PROGRAMS): Add ctestg and ctesta.
* configure, config.h.in, Makefile.in: Rebuild.
* xcoff.c: Initial support for DWARF debug sections in XCOFF.
(STYP_DWARF, SSUBTYP_DW*): Define.
(enum dwarf_section): Define.
(struct dwsect_info): Define.
(xcoff_add): Look for DWARF sections, pass them to
backtrace_dwarf_add.
* configure.ac: Check for clock_gettime.
* config.h.in: Regenerate.
* configure: Likewise.
* ztest.c (average_time, test_large): Conditionalize test timing
on clock_gettime availability.
* Makefile.am: Append the content of clock_gettime_link to
ztest_LDADD.
* configure.ac: Test for the case that clock_gettime is in librt.
* Makefile.in: Regenerate.
* configure: Likewise.
* ztest.c: #include <errno.h>.
(TEST_TIMING): Don't define, don't test.
(xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
(clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
(ZLIB_CLOCK_GETTIME_ARG): Define.
* configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
* Makefile.am: Likewise.
* configure, Makefile.in: Rebuild.
* elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
Read a four byte integer.
(elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
boundary before ever calling elf_zlib_fetch.
* ztest.c (test_large): Simplify print statements a bit.
* ztest.c (test_large): Pass unsigned long *, not size_t *, to
zlib uncompress function.
* configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
* aclocal.m4: Regenerate.
* Makefile.in: Likewise.
* configure: Likewise.
* elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
288.
(main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
(elf_zlib_default_table): Update.
(elf_zlib_default_dist_table): New static array.
(elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
for block type 1.
* ztest.c (struct zlib_test): Add uncompressed_len.
(tests): Initialize uncompressed_len field.  Add new test case.
(test_samples): Use uncompressed_len field.

Change-Id: I1dd4780768695f66177983c50942001365ff75ed

6 years agoPR sanitizer/77631 53/181153/2
Denis Khalikov [Thu, 7 Jun 2018 11:24:16 +0000 (14:24 +0300)]
PR sanitizer/77631

Support for external debug info.
* elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
(S_ISLNK): Define if not defined.
(xstrnlen): Define if strnlen is not available.
(b_elf_note): Define type.
(NT_GNU_BUILD_ID): Define macro.
(elf_crc32, elf_crc32_file): New static functions.
(elf_is_symlink, elf_readlink): New static functions.
(elf_open_debugfile_by_buildid): New static function.
(elf_try_debugfile): New static function.
(elf_find_debugfile_by_debuglink): New static function.
(elf_open_debugfile_by_debuglink): New static function.
(elf_add): Add filename and debuginfo parameters.  Adjust all
callers.  Look for external debug info notes, and try to fetch
debug info from external file.
(struct phdr_data): Add exe_filename field.
(phdr_callback): Pass filename to elf_add.
(backtrace_initialize): Add filename parameter.
* internal.h (backtrace_initialize): Add filename parameter.
* fileline.c (fileline_initialize): Pass filename to
backtrace_initialize.
* pecoff.c (fileline_initialize): Add unused filename parameter.
* unknown.c (fileline_initialize): Likewise.
* xcoff.c (fileline_initialize): Likewise.
* configure.ac: Check for objcopy --add-gnu-debuglink.
* Makefile.am (dtest): New test target.
* configure, Makefile.in: Rebuild.
* elf.c (backtrace_initialize): Set pd.exe_filename.
* configure.ac: Check for lstat and readlink.
* elf.c (lstat, readlink): Provide dummy versions if real versions
are not available.
* configure, config.h.in: Rebuild.

Change-Id: Ia723266f2d1a9d075202c0b6904e62fa18b75123

6 years agolibbacktrace: backport from mainline. 52/181152/2
Denis Khalikov [Thu, 7 Jun 2018 10:20:04 +0000 (13:20 +0300)]
libbacktrace: backport from mainline.

* btest.c (test5): Replace #ifdef guard with 'unused' attribute
to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
* dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
(read_line_header): Don't allocate dirs if dirs_count == 0.
* edtest.c: New file.
* edtest2.c: New file.
* Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
(check_PROGRAMS): Add edtest.
(edtest2_build.c, gen_edtest2_build): New targets.
* Makefile.in: Rebuild.
* elf.c (backtrace_initialize): Always set *fileline_fn.
* ttest.c: New file.
* btest.c: Move support functions into testlib.c.  Change calls to
check to pass file name.
* testlib.c: New file, copied from (part of) btest.c.
* testlib.h: New file, declarations for testlib.c.
* edtest.c: Use testlib.h and testlib.c.
* configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
* Makefile.am (btest_SOURCES): Add testlib.c.
(edtest_SOURCES): Likewise.
(CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
(ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
* configure, Makefile.in: Rebuild.
* configure.ac: Add AC_SYS_LARGEFILE.
* config.h.in: Regenerate.
* configure: Likewise.
* filetype.awk: Add AIX XCOFF type detection.
* configure.ac: Recognize xcoff format.
* Makefile.am (FORMAT_FILES): Add xcoff.c.
* fileline.c: Include <unistd.h>.
(fileline_initialize): Add case for AIX procfs.
* xcoff.c: New file.
* configure, Makefile.in: Rebuild.
* configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
* filetype.awk: Separate AIX XCOFF32 and XCOFF64.
* xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
* configure, config.h.in: Regenerate.
* fileline.c (fileline_initialize): Print pid_t as long.
* xcoff.c: Don't leak a file descriptor if an archive is malformed.
* xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
* libbacktrace/Makefile.in
(HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
* Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
* Makefile.in: Regenerate.

Change-Id: Ib61ad222b79b9c3a38d35705608f74041acc767a

6 years agoRevert Tizen version of PR sanitizer/77631. 51/181151/3
Denis Khalikov [Wed, 6 Jun 2018 16:40:01 +0000 (19:40 +0300)]
Revert Tizen version of PR sanitizer/77631.

Revert commit related to PR sanitizer/77631 implementation
for the Tizen GCC. The feature should has an upstream
implementation.

Change-Id: I1ddf629e229d667877a69d80dd0d6295400b533a

6 years ago[ESan] EfficiencySanitizer implementation. 59/174159/9
Denis Khalikov [Wed, 24 Jan 2018 10:55:22 +0000 (13:55 +0300)]
[ESan] EfficiencySanitizer implementation.

EfficiencySanitizer (WorkingSet tool and CacheFragmentation tool)
implementation for X86_64 and armv7l.

The ESan is a set of compiler-based tools for analyzing targeted
performance problems.

This patch includes:

1. GCC pass.

1.1. GCC pass for WorkingSet tool.
Special compiler pass instruments every memory access in the program.
Memory accesses are simply prepended with a function call like
__esan_aligned_load(addr), __esan_aligned_store(addr).

1.2. GCC pass for CacheFragmentation tool.
Special compiler pass instruments every memory access to the struct
field. Creates fields counter array, each cell of that array
counts memory access to the special field. Creates array of
struct, where every instance of the struct represetnts meta info
of the real struct and so on.

A call to __esan_init is inserted to the static constructor.
A call to __esan_exit is inserted to the static destructor.

2. Runtime library.

2.1. WorkingSet tool.
The runtime library simply manages shadow memory and computes statistic
of the program efficiency. The tool maps one cashe line (64 bytes) of
the program to the one byte of the shadow memory. Runtime library measures
the data working set size of an application at each snapshot during
execution. It can help understand phased behavior as well as providing basic
direction for futher effort by the developer: e.g., knowing whether the working
set is close to fitting in current L3 cashes or is many times larger can help
to determine where to spend effort.

2.2. CacheFragmentation tool.
The runtime part prints statistics about an amount of field accesses and
detailed information about which field was actually accessed.

3. Testsuite.
Simple testsuite.

4. HOW TO USE:

4.1. WorkingSet tool.
To measure the working set size, you should build your binary or shared library
with compile time flag -fsanitize=efficiency-working-set and
set runtime options ESAN_OPTIONS=process_range_access=1:record_snapshots=1

4.2. CacheFragmentation tool.
To enable CacheFragmentation tool you should compile your binary or
shared library with compile time flag -fsanitize=efficiency-cache-frag
and set runtime options ESAN_OPTIONS=build_mode=0:verbosity=1

Change-Id: Ie3231d3defa183712997e6fca39b1e8b4586e9b7

6 years agopackaging: Add -marm and -fno-omit-frame-pointer 48/183448/2
Denis Khalikov [Thu, 5 Jul 2018 10:04:58 +0000 (13:04 +0300)]
packaging: Add -marm and -fno-omit-frame-pointer

To enable "fastunwinder" work on armv7l we should explicitly
build libasan with -marm and -fno-omit-frame-pointer.

Change-Id: I28e763fa7b088aa26a81e7bb6d3a7fa9ba7a714b

6 years ago[ASan] Intercept mcheck and mprobe on Linux 67/175667/3 accepted/tizen/base/20180413.181204 accepted/tizen/base/20180420.170848 submit/tizen_base/20180412.024656 submit/tizen_base/20180417.073401
Slava Barinov [Wed, 11 Apr 2018 09:57:23 +0000 (12:57 +0300)]
[ASan] Intercept mcheck and mprobe on Linux

This patch addresses https://github.com/google/sanitizers/issues/804.

Users can use mcheck and mprobe functions to verify heap state so we should
intercept them to avoid breakage of valid code.

Differential Revision: https://reviews.llvm.org/D32589
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302001 91177308-0d34-0410-b5e6-96231b

Change-Id: I310e0e06d0ad4450acf779630acfb71cde9ea1d2
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
6 years agopackaging: Bootstrap compiler optimization 52/162552/7 submit/tizen_base/20180411.052502
Oleg Ogurtsov [Thu, 11 Jan 2018 09:53:42 +0000 (12:53 +0300)]
packaging: Bootstrap compiler optimization

Change-Id: Ie1e12ff3ae5c0550254f58da4750830e5739d3f5

6 years ago[ASan] Fix for TTC-5 (PR sanitizer/81697). 31/173031/1 accepted/tizen/base/20180406.180244 accepted/tizen/base/20180416.213938 submit/tizen_base/20180330.064117 submit/tizen_base/20180416.141938
Denis Khalikov [Mon, 19 Mar 2018 06:43:09 +0000 (09:43 +0300)]
[ASan] Fix for TTC-5 (PR sanitizer/81697).

gcc/

2017-11-30  Maxim Ostapenko  <m.ostapenko@samsung.com>

PR sanitizer/81697
* asan.c (asan_protect_global): Add new ignore_decl_rtl_set_p
parameter. Return true if ignore_decl_rtl_set_p is true and other
conditions are satisfied.
* asan.h (asan_protect_global): Add new parameter.
* varasm.c (categorize_decl_for_section): Pass true as second parameter
to asan_protect_global calls.

gcc/testsuite/

2017-11-30  Maxim Ostapenko  <m.ostapenko@samsung.com>

PR sanitizer/81697
* c-c++-common/asan/pr81697.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255283 138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: I4568c3d228286d2a372c1e5c3a1dde62561ace74

6 years ago[ASan] Revert commit related to TTC-5 (PR sanitizer/81697). 30/173030/1
Denis Khalikov [Mon, 19 Mar 2018 06:08:53 +0000 (09:08 +0300)]
[ASan] Revert commit related to TTC-5 (PR sanitizer/81697).

We might have a strange situation with ASan and TLS,
when TLS_index struct should be defined as
.word   .LANCHOR0(tlsldm),
but patch for TTC-5 assumes that is no ANCHOR sections
with ASan at all. So, in this specific case we pass TLS_index
struct with wrong alignment to __tls_get_addr () function
which cause a SEGV.

Next commit fix sanitizer/81697 with patch from upstream.

Change-Id: I9ee35ade027d246870bf57387f40217226efb7cc

6 years ago[Sanitizers] Revert commit related to SUMMARY report 98/163498/3
Denis Khalikov [Mon, 11 Dec 2017 14:01:48 +0000 (17:01 +0300)]
[Sanitizers] Revert commit related to SUMMARY report

The commit with Change-Id: Ia258f1e3906bb095ca0d33d3354dd9b1f640c89f
adds SanitizerToolName to the report buffer, but the same name
is adding later at the line 200, so as result we will get
SanitzerToolName twice at the same buffer, therefore this
patch breaks thread_leaks1.c test, because the test expects
that report includes SanitizerToolname only once.

Change-Id: Ia98811936e4845e12cdde7a7f1286058a0766ada

6 years agoMerge "[asan_build] Enable asaned glibc work." into tizen_base accepted/tizen/base/20180126.040727 submit/tizen_base/20180124.094033
Jaehun Jeong [Wed, 24 Jan 2018 09:31:10 +0000 (09:31 +0000)]
Merge "[asan_build] Enable asaned glibc work." into tizen_base

6 years agoMerge "[ASAN] Add interceptor for __longjmp_chk" into tizen_base
Jaehun Jeong [Wed, 24 Jan 2018 09:30:17 +0000 (09:30 +0000)]
Merge "[ASAN] Add interceptor for __longjmp_chk" into tizen_base

6 years ago[ASan] Add interceptor for printf_chk 07/164507/1
Denis Khalikov [Tue, 19 Dec 2017 09:47:55 +0000 (12:47 +0300)]
[ASan] Add interceptor for printf_chk

Differential Revision: https://reviews.llvm.org/D40951

Change-Id: I7c32945659da4cf80e995370cb26fb063bb7930c

6 years ago[TTC-11] Embed UBSan into ASan runtime 63/158063/5 accepted/tizen/base/20171215.171112 submit/tizen_base/20171208.084018
Maxim Ostapenko [Fri, 27 Oct 2017 12:14:27 +0000 (15:14 +0300)]
[TTC-11] Embed UBSan into ASan runtime

Change the way we use ASan and UBSan together. Instead of keeping two
separate runtimes (libasan.so and libubsan.so), embed UBSan into ASan.
UBSan initialization code (e.g. flag parsing) is directly called
from ASan initialization, so we are able to enforce correct
initialization order.

This mirrors the approach we already use for ASan+LSan. This change
doesn't modify the way we use standalone UBSan.

gcc/
* config/gnu-user.h: append -lstdc++ if we link against ASan
runtime.
* gcc.c: Do not link against libubsan.so if
-fsanitize=address,undefined is used.

gcc/testsuite/
* c-c++-common/asan/asan_and_ubsan-1.c: New test.

libsanitizer/

* Makefile.am: Build UBSan strictly before ASan.
* Makefile.in: Regenerate.
* asan/Makefile.am: Embed UBSan into ASan runtime.
* asan/Makefile.in: Regenerate.
* configure.ac: Configure UBSan strictly before ASan.
* configure: Regenerate.
ubsan/ubsan_diag.cc (__sanitizer_print_stack_trace): Move to ...
ubsan/ubsan_diag_standalone.cc: ... here.
* ubsan/Makefile.am: Create a "plugin" library to be embedded
into ASan runtime.
* ubsan/Makefile.in: Regenerate.

Change-Id: Ia848a93929effb4b0ec057243c7343c1bd94fbfb
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
6 years agoUpdate ChangeLog.Tizen 19/163119/1 accepted/tizen/base/20171208.204010 submit/tizen_base/20171207.085008
Dongkyun Son [Thu, 7 Dec 2017 08:46:37 +0000 (17:46 +0900)]
Update ChangeLog.Tizen

Change-Id: If40d54536b967f821dc54eb15d71d81600df7395
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
6 years ago[TSan] Support cross building. 20/159920/5
Denis Khalikov [Fri, 17 Nov 2017 12:37:07 +0000 (15:37 +0300)]
[TSan] Support cross building.

In case we want to build binary with TSan for aarch64
CPU under qemu-user on x86_64 CPU, we should make sure
that we don't make any architecture dependent checks at
the runtime.
To support this, new flag "run_under_qemu" was added and
now available under TSAN_OPTIONS.

Change-Id: Ifad929d284d30b720afd60a60a88fa129f37d4a6

6 years ago[TSan] TSan options. 68/155968/3
Denis Khalikov [Mon, 16 Oct 2017 16:03:16 +0000 (19:03 +0300)]
[TSan] TSan options.

Enable TSan to read options from file.

Change-Id: I86286365a72ba1b1f9971018125140b9d7e518e4

6 years ago[TSan] Fix TSan initializaion. 89/152589/3
Denis Khalikov [Tue, 26 Sep 2017 09:34:21 +0000 (12:34 +0300)]
[TSan] Fix TSan initializaion.

TSan uses procfs for every ThreadContext.
We should ensure that procfs is mounted, to
avoid an error when TSan is initializing.

Change-Id: I8e9a3ec6f8920c95b5246bda56f5c55ef9fffb0e

6 years agopackaging: Add tsan_interface_atomic header. 76/155276/2
Denis Khalikov [Thu, 12 Oct 2017 14:19:17 +0000 (17:19 +0300)]
packaging: Add tsan_interface_atomic header.

Change-Id: I8f51690ede737591606612f674f6c7729113d587

6 years agoAdd a runtime flag Wprint-abs-path 34/161434/3
Oleg Ogurtsov [Thu, 23 Nov 2017 09:30:36 +0000 (12:30 +0300)]
Add a runtime flag Wprint-abs-path

A runtime flag for printing a real path to the source file on warning.

gcc/
* Makefile.in: added dependencies of linking.
* common.opt: added a flag description.
* diagnostic.c: added the dependence of the runtime flag and
implementation.

Change-Id: I3eb9178892f3c230845dc8e5c9ab4e1b1613f6f0

6 years ago[ASAN] Add interceptor for __longjmp_chk 77/162177/1
Peter Wu [Wed, 29 Nov 2017 10:35:54 +0000 (13:35 +0300)]
[ASAN] Add interceptor for __longjmp_chk

Summary:
glibc on Linux calls __longjmp_chk instead of longjmp (or _longjmp) when
_FORTIFY_SOURCE is defined. Ensure that an ASAN-instrumented program
intercepts this function when a system library calls it, otherwise the
stack might remain poisoned and result in CHECK failures and false
positives.

Fixes https://github.com/google/sanitizers/issues/721

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D32408

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302152 91177308-0d34-0410-b5e6-96231b3b80d8
Change-Id: I756e6a66139bc4ee95d3af1be792b025efe39ce0

6 years ago[UBSan] Add __sanitizer_print_stack_trace() for UBSan 81/157681/5 submit/tizen_base/20171123.084139
Dmitriy Nikiforov [Wed, 25 Oct 2017 17:31:52 +0000 (20:31 +0300)]
[UBSan] Add __sanitizer_print_stack_trace() for UBSan

libsanitizer/
* ubsan/ubsan_diag.cc (__sanitizer_print_stack_trace): New function.
* ubsan/ubsan_diag.cc (PrintStackTrace): New function.

Change-Id: I270b3765a571381fcf400b8e54f66dfa291e4862

7 years agoUpdate Commit Date and Hash on ChangeLog.Tizen 74/160174/1
Dongkyun Son [Tue, 14 Nov 2017 23:33:51 +0000 (08:33 +0900)]
Update Commit Date and Hash on ChangeLog.Tizen

Change-Id: If32843d528c75e302fd7b749412164a3dd4b6520
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
7 years agoUpdate ChangeLog.Tizen 70/160070/1 accepted/tizen/base/20171117.154048 submit/tizen_base/20171114.100800
Dongkyun Son [Tue, 14 Nov 2017 09:51:27 +0000 (18:51 +0900)]
Update ChangeLog.Tizen

Change-Id: I3033eda2a4765879ed889935b17cbc6600944474
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
7 years ago[asan_build] Enable asaned glibc work. 01/152901/6
Denis Khalikov [Tue, 26 Sep 2017 18:51:35 +0000 (21:51 +0300)]
[asan_build] Enable asaned glibc work.

Modify GetPageSize () function to return
4096 for arm and arch64 architectures. We can
not call sysconf from libc befor libc is inited.

Mark libasan as initfirst, in this case "patched" rtld
will be able to initiazlie libasan before libc.so

Change-Id: I56a582fdeafcf55b9dbab8fcd1b39be850cccc04

7 years ago[ISan] Fix ICE with ISan and -ftree-loop-vectorize 53/159253/3
Denis Khalikov [Tue, 7 Nov 2017 16:10:03 +0000 (19:10 +0300)]
[ISan] Fix ICE with ISan and -ftree-loop-vectorize

In case we want to vectorize the loop, we can not
rely only on TREE_OVERFLOW flag, while folding the INTEGER_CST,
which represents the step of vectorization.
We still should check TYPE_OVERFLOW_WRAPS flag instead
TYPE_OVERFLOW_SANITIZED flag, because the step could
be already marked as TREE_OVERFLOW == 1.

Change-Id: I1288b7e3b587c5773b184636bdfdada168b8941f

7 years ago[ISan] Fix issue with constexpr. 84/158084/8
Denis Khalikov [Mon, 30 Oct 2017 16:12:50 +0000 (19:12 +0300)]
[ISan] Fix issue with constexpr.

The semantic of the constexpr does not allow us
to convert POINTER type to INTERGER type inside constexpr.
All ISAN instrumentation should be folded, but it's
little bit tricky, in case we should convert INTEGER
type back to POINTER type, because INTEGER type could
not be assigned to POINTER type.
Another issue is that some actual value of PARM_DECL
could not be getting by "constexpr context" and
could not be folded.
So, just disable ISAN insrumentation and pointer
conversions for constexpr semantic. In this case we
can rely on current_function_decl while processing function,
but also should handle constexpr with pointers:
constexpr unsigned *pointer = ptr + index;

Change-Id: I68eb660438a1acd881207219c3d72045c445dcb7

7 years agoImplement suppression list support for ISan. 18/158718/2 sandbox/ibaravy/isan
Ivan Baravy [Thu, 2 Nov 2017 13:02:53 +0000 (16:02 +0300)]
Implement suppression list support for ISan.

Change-Id: I41a8c572d30626caa45acf30758e00219b40bf03

7 years agoImplement ISan: unsigned integer overflow checker. 17/158717/1
Maxim Ostapenko [Thu, 1 Jun 2017 13:21:11 +0000 (16:21 +0300)]
Implement ISan: unsigned integer overflow checker.

ISan in FE.
Handle all s and u cases.
Add unit and regression tests.

Change-Id: I3f60f751598d904683264372541c2d3be0076768

7 years agopackaging: add %arm to lsan_arch 25/157225/2
Dongkyun Son [Tue, 24 Oct 2017 01:22:21 +0000 (10:22 +0900)]
packaging: add %arm to lsan_arch

libasan.so.* are installed, but unpackaged in armv7hl.

Change-Id: I713fdcc3b157f3578995fa26b9d8d4754f937bfa
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
7 years ago[TTC-8][Sanitizers] Add tests for allocator_may_return_null=1 flag 38/149938/2 accepted/tizen/base/20171027.152140 submit/tizen_base/20171024.003248
Slava Barinov [Wed, 13 Sep 2017 15:13:49 +0000 (18:13 +0300)]
[TTC-8][Sanitizers] Add tests for allocator_may_return_null=1 flag

The LLVM test has been rewritten to be able to run inside GCC test suite.

Change-Id: Ifaf9e3681ddacfaad73a314a01ab3c6c7704d40b
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years ago[TTC-8][Sanitizers] 64 bit allocator respects allocator_may_return_null flag 37/149937/3
Alex Shlyapnikov [Wed, 13 Sep 2017 13:22:49 +0000 (16:22 +0300)]
[TTC-8][Sanitizers] 64 bit allocator respects allocator_may_return_null flag

Summary:
Make SizeClassAllocator64 return nullptr when it encounters OOM, which
allows the entire sanitizer's allocator to follow
allocator_may_return_null=1 policy
(LargeMmapAllocator: D34243, SizeClassAllocator64: D34433).

Reviewers: eugenis

Subscribers: srhines, kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D34540

Change-Id: I0e72b4b22a440eb644dcc370da0ba9aa0e71c2d5
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306342 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TTC-8][Sanitizers] 32 bit allocator respects allocator_may_return_null flag 36/149936/2
Alex Shlyapnikov [Wed, 13 Sep 2017 12:57:12 +0000 (15:57 +0300)]
[TTC-8][Sanitizers] 32 bit allocator respects allocator_may_return_null flag

Summary:
Make SizeClassAllocator32 return nullptr when it encounters OOM, which
allows the entire sanitizer's allocator to follow allocator_may_return_null=1
policy, even for small allocations (LargeMmapAllocator is already fixed
by D34243).

Will add a test for OOM in primary allocator later, when
SizeClassAllocator64 can gracefully handle OOM too.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D34433

Change-Id: I2853a00cff5202189c5d4b15b1934c63d5206708
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305972 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TTC-8][Sanitizers] Secondary allocator respects allocator_may_return_null=1. 35/149935/2
Alex Shlyapnikov [Wed, 13 Sep 2017 12:50:25 +0000 (15:50 +0300)]
[TTC-8][Sanitizers] Secondary allocator respects allocator_may_return_null=1.

Summary:
Context: https://github.com/google/sanitizers/issues/740.

Making secondary allocator to respect allocator_may_return_null=1 flag
and return nullptr when "out of memory" happens.

More changes in primary allocator and operator new will follow.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D34243

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305569 91177308-0d34-0410-b5e6-96231b3b80d8

Change-Id: I534117600099ec8953a6d83c559da0cf3bdfb5ad

7 years ago[TTC-9] Make LSan compliant with recovery mode when running on top of ASan 63/150163/4
Slava Barinov [Thu, 14 Sep 2017 09:42:17 +0000 (12:42 +0300)]
[TTC-9] Make LSan compliant with recovery mode when running on top of ASan

Don't overwrite exit code in LSan when running on top of ASan in recovery mode
to avoid breakage of users code due to found leaks.

Change-Id: I172f59734837d3df350c9e586ace2547ae9f3f23
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoAdd armv7hl support. 10/129010/5
Mikhail Kashkarov [Fri, 5 May 2017 14:00:49 +0000 (17:00 +0300)]
Add armv7hl support.

Change-Id: Ib611ee4659af5e30b2a9c46ded7588b5a5c139fa

7 years agopackaging: clean-up sanitizer macros. 37/151137/2
Dongkyun Son [Tue, 19 Sep 2017 05:33:20 +0000 (14:33 +0900)]
packaging: clean-up sanitizer macros.

sanitizer related macros moved to 'gcc-contrib' package.

Change-Id: Ic8ed52aac4a502f2bf44053225b2e29e721699d6
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
7 years agopackaging: provide libasan(64bit) on 32bit build env 89/147289/5 accepted/tizen/base/20170915.204826 submit/tizen_base/20170914.121419
Dongkyun Son [Fri, 1 Sep 2017 15:35:56 +0000 (00:35 +0900)]
packaging: provide libasan(64bit) on 32bit build env

This is needed as it requires 64bit libs into i586 repo, sometimes.
(e.g, .NET toolchain asan build).

Change-Id: Ia18f132b19e8552b347132531f3e12000aa34514
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
7 years agoFixed aarch64 build. 25/149625/1
jakub [Tue, 24 Jan 2017 00:18:36 +0000 (00:18 +0000)]
Fixed aarch64 build.

PR sanitizer/79168
   * merge.sh (change_comment_headers): Don't remove 2nd and 3rd line
  if the 3rd line doesn't contain 'The LLVM Compiler Infrastructure'
  text.
  * sanitizer_common/sanitizer_linux_mips64.S: Regenerated.
  * sanitizer_common/sanitizer_linux_x86_64.S: Likewise.
  * tsan/tsan_ppc_regs.h: Likewise.
  * tsan/tsan_rtl_aarch64.S: Likewise.
  * tsan/tsan_rtl_mips64.S: Likewise.
  * tsan/tsan_rtl_ppc64.S: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244844 138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: I384d6d121d2e0fcd2947400c14082f7b83e8cb20
Signed-off-by: Michail Kashkarov <m.kashkarov@partner.samsung.com>
7 years ago[TTC-6] packaging: Support for gcc-contrib. 51/145951/5 submit/tizen_base/20170911.070012
Denis Khalikov [Fri, 18 Aug 2017 15:07:28 +0000 (18:07 +0300)]
[TTC-6] packaging: Support for gcc-contrib.

This patch deletes all scripts from gcc *spec files.
All scripts moved to gcc-contrib package.

Change-Id: I847a5c61b69cc74aadf59c31e3b04a404a4d13b0

7 years ago[TTC-5] Forbid section anchors for ASan build (PR sanitizer/81697) 36/143336/3 accepted/tizen/base/20170908.223910 submit/tizen_base/20170905.003244 submit/tizen_base/20170907.223110
Slava Barinov [Thu, 3 Aug 2017 13:14:59 +0000 (16:14 +0300)]
[TTC-5] Forbid section anchors for ASan build (PR sanitizer/81697)

       gcc/
       * varasm.c (use_object_blocks_p): Forbid section anchors for ASan

       gcc/testsuite/
       * g++.dg/asan/global-alignment.C: New test to test global
       variables alignment.

Change-Id: I3887e356397c599ec74793de6d60bc285a2c872b
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoAdd ChangeLog.Tizen 74/138574/5 accepted/tizen/base/20170908.223816 submit/tizen_base/20170830.083645
Sangmin Seo [Wed, 9 Aug 2017 05:18:33 +0000 (14:18 +0900)]
Add ChangeLog.Tizen

ChangeLog.Tizen is to keep track of private patches for Tizen GCC.

Change-Id: I2fbde58d410ab4a7ddbda361be86a48de9d891e3

7 years agopackaging: Add libasan as requires for asan-runtime-env 83/145083/3
Hoyub Lee [Mon, 21 Aug 2017 07:10:12 +0000 (16:10 +0900)]
packaging: Add libasan as requires for asan-runtime-env

Installing asan-runtime-env without libasan invokes error from ld.so.
Therefore, it is correct to add libasan as requires.

Change-Id: I9d2e2a3f60369b1332d7280b6cc6253a73e36439
Signed-off-by: Hoyub Lee <hoyub.lee@samsung.com>
7 years agopackaging: Set shadow address space to unlimited for ASan 09/146109/3
Chan Lee [Fri, 25 Aug 2017 01:46:44 +0000 (10:46 +0900)]
packaging: Set shadow address space to unlimited for ASan

Currently, at the beginning of gbs build, shadow address space is set
according to the environment of the host machine. It makes ASan build
fail because ASan needs a whole shadow address space.

Actually ASan tries to set the value to unlimited at init time( ASanInitInternal() )
but it failes because of lack of permission like below.

[   39s] ==6800==ERROR: AddressSanitizer setrlimit() failed 1

The value could be set at package install time because the user
is 'root' at this time.
Using ulimit can only set the value for current user('root') not 'abuild'
which is the user at build time so we need to set /etc/security/limits.conf directly.

Change-Id: Ia03911a37a689c186d0e028d01b665cf6a0c3073
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
7 years agopackaging: Force options for native compiler only 55/143555/2
Slava Barinov [Thu, 10 Aug 2017 08:05:46 +0000 (11:05 +0300)]
packaging: Force options for native compiler only

If both native and cross-compiler are installed (e. g. in qemu-accel build) the
gcc-force-options should only accelerate native compiler in order to keep
gcc-unforce-options work.

Change-Id: I1454fb199e6f849b89f7b16129e005894d800cbc
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agopackaging: remain ld.so.preload.org 28/145728/2
Chan Lee [Wed, 23 Aug 2017 11:28:57 +0000 (20:28 +0900)]
packaging: remain ld.so.preload.org

Original file should be remained to restore when uninstalling rpm.

Change-Id: Id5e5b82ff327e14db966b142248d6a5a3e17917c
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
7 years agoPR sanitizer/77631 56/134256/16
Denis Khalikov [Sat, 29 Jul 2017 19:18:59 +0000 (22:18 +0300)]
PR sanitizer/77631

    * Makefile.am: Updated.
    * configure.ac: Updated.
    * configure: Regenerated.
    * Makefile.in: Regenerated.
    * elf.c (enum type_of_file): New enum.
    (enum type_of_elf): New enum.
    (enum debug_path): New enum.
    (get_uint32): New function.
    (get_crc32): New function.
    (base_name_len): New function.
    (check_sum): New function. Verify sum.
    (process_elf_header): New function. Process elf header.
    (elf_get_section_by_name): New function. Get section by name.
    (backtrace_readlink): New function. Get type of file from filename.
    (resolve_realname): New function. Resolve real name if file is link.
    (backtrace_resolve_realname): New function. Resolve real name for any
    file type.
    (search_for_debugfile): New function. Search for debug file in known
    paths.
    (open_debugfile_by_gnulink): New function. Open debug file with
    gnulink.
    (hex): New function. Convert to hex.
    (get_build_id_name): New function. Generate build-id name.
    (open_debugfile_by_build_id): New function. Open debug file with
    build-id.
    (backtrace_open_debugfile): New function. Open debug file.
    (get_exec_filename): New function. Get pathname of the executable.
    (elf_add): Move code which reads elf header, headers section and names
    section to process_elf_header.
    Call backtrace_open_debugfile_file for executable.
    (phdr_callback): Call backtrace_open_debugfile function for shared
    library.
    * crc32.c: New file.
    (gnu_debuglink_crc32): New function. Generate crc32 sum.

Change-Id: I30d9fbcfa24b3aadf3b7c54525dccedd60cd1a5d

7 years ago[ubsan] Fix ICE 79/136679/7 accepted/tizen/base/20170901.225743 submit/tizen_base/20170823.100418
Denis Khalikov [Sun, 2 Jul 2017 15:47:03 +0000 (18:47 +0300)]
[ubsan] Fix ICE

   While we have a current_function_decl in this case,
   still create_tmp_var's called gimple_add_tmp_var and
   mark_addressable don't work too well when the current
   function is a C++ ctor or dtor that the FE then duplicates

   2017-06-27  Jakub Jelinek  <jakub@redhat.com>

   PR sanitizer/81209
   * ubsan.c (ubsan_encode_value): Initialize DECL_CONTEXT on var.
   * g++.dg/ubsan/pr81209.C: New test.

   2017-06-20  Jakub Jelinek  <jakub@redhat.com>

   PR sanitizer/81125
   * ubsan.h (ubsan_encode_value): Workaround buggy clang++ parser
   by removing enum keyword.
   (ubsan_type_descriptor): Likewise.  Formatting fix.

   2017-06-19  Jakub Jelinek  <jakub@redhat.com>

   PR sanitizer/81125
   * ubsan.h (enum ubsan_encode_value_phase): New.
   (ubsan_encode_value): Change second argument to
   enum ubsan_encode_value_phase with default value of
   UBSAN_ENCODE_VALUE_GENERIC.
   * ubsan.c (ubsan_encode_value): Change second argument to
   enum ubsan_encode_value_phase PHASE from bool IN_EXPAND_P,
   adjust uses, for UBSAN_ENCODE_VALUE_GENERIC use just
   create_tmp_var_raw instead of create_tmp_var and use a
   TARGET_EXPR.
   (ubsan_expand_bounds_ifn, ubsan_build_overflow_builtin,
   instrument_bool_enum_load, ubsan_instrument_float_cast): Adjust
   ubsan_encode_value callers.

   PR sanitizer/81111
   * ubsan.c (ubsan_encode_value): If current_function_decl is NULL,
   use create_tmp_var_raw instead of create_tmp_var, mark it addressable
   just by setting TREE_ADDRESSABLE on the result and use a TARGET_EXPR.

   PR sanitizer/81125
   * g++.dg/ubsan/pr81125.C: New test.

   PR sanitizer/81111
   * g++.dg/ubsan/pr81111.C: New test.

   git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@249480 138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: I3b7816b4f9b1bb5916adf3684dcbcc5284e50954

7 years ago[UBSAN] Fix systemd initialization with UBSan. 27/143127/1
Denis Khalikov [Tue, 8 Aug 2017 13:35:33 +0000 (16:35 +0300)]
[UBSAN] Fix systemd initialization with UBSan.

In case systemd was build with UBSan we should
ensure that /proc is mounted, to prevent booting
error.

Change-Id: I52016a5e440f311c85f6fe2cad1dfd7966976651
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
7 years ago[asan] Revert ABI changes after ASan patches backporting 65/138565/3 accepted/tizen/4.0/base/20170811.092812 accepted/tizen/4.0/base/20170828.221138 accepted/tizen/base/20170804.132713 submit/tizen_4.0_base/20170811.071500 submit/tizen_4.0_base/20170828.000000 submit/tizen_4.0_base/20170828.000001 submit/tizen_base/20170804.023302
Slava Barinov [Wed, 12 Jul 2017 08:21:11 +0000 (11:21 +0300)]
[asan] Revert ABI changes after ASan patches backporting

       gcc/
       * asan.c: Remove __odr_indicator usage.
       * asan_globals.cc: Likewise.
       libsanitizer/
       * asan/asan_init_version.h: Revert asan version to 6.
       * asan/asan_interface_internal.h: Remove __odr_indicator.
       * asan/libtool-version: Revert shared object version to 3.

Change-Id: I9f1c1766b7d00d659f9f47468f9293aeb52a0faf
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agogcc/ 64/138564/5
chefmax [Tue, 8 Nov 2016 22:16:58 +0000 (22:16 +0000)]
gcc/

* asan.h (asan_intercepted_p): Handle BUILT_IN_STRCSPN,
BUILT_IN_STRPBRK, BUILT_IN_STRSPN and BUILT_IN_STRSTR.

Change-Id: I1560e575cd81bbe1c732f696bed559abe0f4ed9c
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241984 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agogcc/ 63/138563/3
chefmax [Tue, 8 Nov 2016 22:15:35 +0000 (22:15 +0000)]
gcc/

* asan.h (ASAN_STACK_MAGIC_PARTIAL): Remove.
* asan.c (ASAN_STACK_MAGIC_PARTIAL): Replace with
ASAN_STACK_MAGIC_MIDDLE.

gcc/testsuite/

* c-c++-common/asan/null-deref-1.c: Adjust testcase.

Change-Id: I348a6339d17a2cb7faf293cefdc615d1d53d237a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241983 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agolibsanitizer/ 62/138562/3
chefmax [Tue, 8 Nov 2016 22:07:50 +0000 (22:07 +0000)]
libsanitizer/

* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
compiled code with GCC when extracting the caller PC for ARM if no
valid frame pointer is available.

Change-Id: Ic974dcb0800c15eabf74a2c78f791c6cedc1aa44
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241980 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agoPR sanitizer/63958 61/138561/4
chefmax [Tue, 8 Nov 2016 22:06:02 +0000 (22:06 +0000)]
PR sanitizer/63958

Reapply:
2014-10-14  David S. Miller  <davem@davemloft.net>

* sanitizer_common/sanitizer_platform_limits_linux.cc (time_t):
Define at __kernel_time_t, as needed for sparc.
(struct __old_kernel_stat): Don't check if __sparc__ is defined.
* libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
(__sanitizer): Define struct___old_kernel_stat_sz,
struct_kernel_stat_sz, and struct_kernel_stat64_sz for sparc.
(__sanitizer_ipc_perm): Adjust for sparc targets.
(__sanitizer_shmid_ds): Likewsie.
(__sanitizer_sigaction): Likewise.
(IOC_SIZE): Likewsie.

Change-Id: Iccdb7e974d8cb8fe5f6581da6b74b33c5bae7a9b
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241978 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agolibsanitizer/ 60/138560/5
chefmax [Tue, 8 Nov 2016 22:04:09 +0000 (22:04 +0000)]
libsanitizer/

* All source files: Merge from upstream 285547.
* configure.tgt (SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): New
variable.
* configure.ac (SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): Handle it.
* asan/Makefile.am (asan_files): Add new files.
* asan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Likewise.
* lsan/Makefile.in: Likewise.
* tsan/Makefile.am (tsan_files): Add new files.
* tsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add new files.
(EXTRA_libsanitizer_common_la_SOURCES): Define.
(libsanitizer_common_la_LIBADD): Likewise.
(libsanitizer_common_la_DEPENDENCIES): Likewise.
* sanitizer_common/Makefile.in: Regenerate.
* interception/Makefile.in: Likewise.
* libbacktace/Makefile.in: Likewise.
* Makefile.in: Likewise.
* configure: Likewise.
* merge.sh: Handle builtins/assembly.h merging.
* builtins/assembly.h: New file.
* asan/libtool-version: Bump the libasan SONAME.

Change-Id: I47a2591215c7529613d22a117644607b20db065b
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241977 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agoFix cleanup location for try_finally_expr. 59/138559/4
Slava Barinov [Thu, 6 Jul 2017 13:14:58 +0000 (16:14 +0300)]
Fix cleanup location for try_finally_expr.

        gcc/
        * tree.def: Add STATEMENT_LIST_END tree code.
        * tree.c: Add STATEMENT_LIST_END handling as TS_COMMON.
        * gimplify.c (gimplify_expr): Use STATEMENT_LIST_END location to
        provide right information for try_finally_expr.
        * tree-eh.c (lower_try_finally_onedest): Set finally location
        * c-family/c-semantics.c (pop_stmt_list): Support single-statement
        lists extraction with STATEMENT_LIST_END in the end.
        * fold-const.c (operand_equal_p): Add STATEMENT_LIST_END support.
        gcc/cp/
        * parser.c (cp_parser_compound_statement): Use STATEMENT_LIST_END
        to keep the location of closing brace.
        * pt.c: Handle STATEMENT_LIST_END.
        * constraint.cc (check_function_concept): Handle concept definitions
        with STATEMENT_LIST_END.
        * error.c (dump_expr): Add STATEMENT_LIST_END support.
        gcc/testsuite/
        * g++.dg/ext/statement-list-end.C: New.

Change-Id: Id22e953b97b52d0f2a2ba44065337a59639578db
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agopackaging: Enable ASan bootstrap for ASan projects 50/141350/3
Slava Barinov [Tue, 25 Jul 2017 08:44:17 +0000 (11:44 +0300)]
packaging: Enable ASan bootstrap for ASan projects

GCC will be built in ASan projects.

To test the GCC package the rpm macro `asanbootstrap' should be defined in
project config.

Change-Id: Id91425e2895f63ec92c8e83fb96f93aaade67728
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoPR libstdc++/77356 07/141007/3
timshen [Sat, 27 Aug 2016 02:03:23 +0000 (02:03 +0000)]
PR libstdc++/77356

* include/bits/regex_compiler.tcc(_M_insert_bracket_matcher,
_M_expression_term): Modify to support dash literal.
* include/bits/regex_scanner.h: Add dash as a token type to make
a different from the mandated dash literal by escaping.
* include/bits/regex_scanner.tcc(_M_scan_in_bracket): Emit dash
token in bracket expression parsing.
* testsuite/28_regex/regression.cc: Add new testcases.

(cherry-picked from commit 6f2116bed6e87668a914dc27fff34c7a68576d4e)

Change-Id: I8f516ef995f0fb7db479c441c9e7714bab518806
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239794 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agoPR libstdc++/70745 06/141006/3
timshen [Sat, 23 Apr 2016 03:58:37 +0000 (03:58 +0000)]
PR libstdc++/70745

* include/bits/regex_executor.tcc (_Executor<>::_M_word_boundary):
Fix the match_not_bow and match_not_eow behavior.
* testsuite/28_regex/regression.cc: Add testcase.

(cherry-picked from commit 566d49d6947f4590609562dd5f33d0e6b24a4267)

Change-Id: Ie38f6f857575432c90f9ae17576ddff4c7bc021a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235382 138bc75d-0d04-0410-961f-82ee72b054a4

7 years agoRemove target-libgfortran from default targets 67/138767/3
Slava Barinov [Thu, 13 Jul 2017 12:59:38 +0000 (15:59 +0300)]
Remove target-libgfortran from default targets

       * configure.ac: Make target-libgfortran a configure option.
       * configure: Regenerate.

This fixes on-host build broken by 58909fae.

Now OBS build works as usual since it provides --enable-libgfortran explicitly
and on-host test builds are not broken with error
`GNU Fortran compiler is not working'

Change-Id: I39ea37ddb0e52c1e2b43e3d304da1389ce615010
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoSwitch on detect_leaks on 64-bit platforms by default 27/138927/2
Slava Barinov [Fri, 14 Jul 2017 08:25:35 +0000 (11:25 +0300)]
Switch on detect_leaks on 64-bit platforms by default

       libsanitizer/
       * asan/asan_flags.cc: Switch on leak detection for 64-bit target.
       * lsan/lsan.cc: Likewise.
       * sanitizer_common/sanitizer_flags.inc: Likewise.

Neither the OBS build nor sanitized firmware build are affected.

When Tizen application developer enables ASan for his own package only and run
it in 64-bit emulator (without any additional setup) ASan will report leaks
additionally to all other error messages.

Change-Id: Id16017e9bbe5221778330287c707bdf1846f0760
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years ago[TTC-3] Fix asan_symbolize.py output frame numbers. 08/139808/8
Mikhail Kashkarov [Thu, 20 Jul 2017 11:19:13 +0000 (14:19 +0300)]
[TTC-3] Fix asan_symbolize.py output frame numbers.

If input line already symbolized and has format
'#0 0x7f6e35cf2e45 in func foo:46' - fix internal frame number.

packaging/
    * asan_symbolized.py (have_line_to_symbolized): New function.

Change-Id: I2c52c58f9e2d6dfce709e87dee2abd62b642bcad

7 years ago[TTC-2] Fix asan_symbolize.py for C++ function prototypes detection. 77/138777/3
Mikhail Kashkarov [Thu, 13 Jul 2017 14:02:39 +0000 (17:02 +0300)]
[TTC-2] Fix asan_symbolize.py for C++ function prototypes detection.

Change-Id: Iffa30dce19f99506312a93b79cc8deb05404a82a

7 years agopackaging: append -ldl -lpthread to ASan force options. 96/138496/8
Sangmin Seo [Wed, 12 Jul 2017 09:37:50 +0000 (18:37 +0900)]
packaging: append -ldl -lpthread to ASan force options.

When building for address sanitization, some packages complain about
missing symbols due to omitted -ldl or -pthread.  This patch appends
-ldl and -lpthread to the ASan force options in order to resolve this
kind of issue.  Note that since -ldl and -lpthread are already needed
by libasan, adding them to the ASan force options should not cause any
problems.

This patch also adds -Wl,--as-needed before -ldl -lpthread in the
force options to prevent libdl or libpthread from being linked when
unnecessary.

Change-Id: Ic50059d4684e15773f56c589cfacda0bc944d955
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
7 years agopackaging: create a wrapper for collect2 in gcc-force-options 55/139255/6
Sangmin Seo [Tue, 18 Jul 2017 05:01:23 +0000 (14:01 +0900)]
packaging: create a wrapper for collect2 in gcc-force-options

gcc-force-options used to prepend/append all force options to the
gcc/g++ wrappers.  This approach worked well for most packages but
caused some configure scripts to behave differently when linker flags
are included in the force options.  For example, if g++ is called with
-ldl appended, it always goes to the linking phase.  As a result, when
configure has expanded AC_PROG_CXXCPP macro, variables related to
preprocessor are not properly set and actual build ends up using
incorrect compile and link flags.

Since prepending or appending linker flags to the linker makes more
sense than carrying them from the compilation phase, this patch
basically divides the force options into compiler flags and linker
ones, and inserts them to corresponding wrappers.  Consequently, a
wrapper for collect2 is created, as we did for gcc and g++, in order
to pass the linker flags to the linker.  Note that collect2 bridges
the compiler and the actual linker, and thus creating a wrapper for
collect2 is more portable and succinct than doing so for linkers.

Change-Id: I8733bf14c5a2c04bfebe38a339c94e7a738cf17c
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
7 years agopackaging: Add %gcc_force_options and %gcc_unforce_options macros 61/138761/5
Slava Barinov [Thu, 13 Jul 2017 10:35:02 +0000 (13:35 +0300)]
packaging: Add %gcc_force_options and %gcc_unforce_options macros

The macros can be used in certain .spec files to switch off sanitization of
parts or modules without hard-coding sanitizer flags into packages.

Change-Id: I1643a3bdd64a3d48855f02622feb064d482e3655
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
7 years agoDo not emit the -Wpsabi note for PR target/77728 16/136916/1 accepted/tizen/base/20170707.183909 submit/tizen_base/20170705.085733
Sangmin Seo [Thu, 29 Jun 2017 07:56:39 +0000 (16:56 +0900)]
Do not emit the -Wpsabi note for PR target/77728

Since PR target/77728 issue did not exist in Tizen/Linaro GCC 4.9.2
and has been resolved with the upstream patches, it does not make
sense to print the -Wpsabi note, which is "parameter passing for
argument of type ... changed in GCC 7.1." This patch removes the
-Wpsabi note generated by the commit
6da83d4adc857ba1c4370b2b8f32825d5cb13ebe
and dg-message comments from the test code.

gcc/config/
    * arm/arm.c (aapcs_layout_arg): Remove code emitting -Wpsabi note.
    (arm_function_arg): Likewise.
    (arm_function_arg_boundary): Likewise.
    (arm_setup_incoming_varargs): Likewise.

gcc/testsuite/
    * g++.dg/abi/pr77728-1.C: Remove dg-message comments.

Change-Id: I5432536052bf9d534e21157ddfd2ac57d25da59f
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
7 years ago Tests of AAPCS64 updates for alignment attribute 85/134285/2
Mikhail Kashkarov [Thu, 15 Jun 2017 16:47:33 +0000 (19:47 +0300)]
Tests of AAPCS64 updates for alignment attribute

    gcc/testsuite/

        * gcc.target/aarch64/aapcs64/aapcs64.exp: Also execute rec_*.c
        * gcc.target/aarch64/aapcs64/rec_align-5.c: New.
        * gcc.target/aarch64/aapcs64/rec_align-6.c: New.
        * gcc.target/aarch64/aapcs64/rec_align-7.c: New.
        * gcc.target/aarch64/aapcs64/rec_align-8.c: New.
        * gcc.target/aarch64/aapcs64/rec_align-9.c: New.
        * gcc.target/aarch64/aapcs64/test_align-5.c: New.
        * gcc.target/aarch64/aapcs64/test_align-6.c: New.
        * gcc.target/aarch64/aapcs64/test_align-7.c: New.
        * gcc.target/aarch64/aapcs64/test_align-8.c: New.
        * gcc.target/aarch64/aapcs64/test_align-9.c: New.
        * gcc.target/aarch64/aapcs64/rec_vaarg-1.c: New.
        * gcc.target/aarch64/aapcs64/rec_vaarg-2.c: New.

        Backported from trunk:
        84ee090575f413f92377812d277b705d023a4b0b

Change-Id: Idf931ee8b3b5f556b7341734eb940f9a0926a03f

7 years agoImplement AAPCS64 updates for alignment attribute. 84/134284/3
Mikhail Kashkarov [Thu, 15 Jun 2017 14:03:07 +0000 (17:03 +0300)]
Implement AAPCS64 updates for alignment attribute.

        PR target/77728
         gcc/
        * config/aarch64/aarch64.c(aarch64_function_arg_alignmentq):
        Rewrite, looking one level down for records and arrays.
        Ignore TYPE_FIELDS chain decls other than FIELD_DECLs.
        (aarch64_layout_arg): Adjust aarch64_function_arg_alignment caller.
        (aarch64_function_arg_boundary): Likewise.  Simplify using MIN/MAX.
        (aarch64_gimplify_va_arg_expr): Adjust aarch64_function_arg_alignment
         caller.
        testsuite/
        * g++.dg/abi/pr77728-2.C: New test.

        Backported from trunk:
        be35fa06e8f976e1cb880988d5c82813106922fd
        32cb614ad1f60267f914e38da26a73259299d720
        26312b0ea5f3dfc6e3d8d8d18c76d464d6fa328e

Change-Id: I4293167468353e9730dc918b87edda4484af8315

7 years agoPR target/77728 11/134411/3
jakub [Tue, 25 Apr 2017 16:47:32 +0000 (16:47 +0000)]
PR target/77728
* config/arm/arm.c: Include gimple.h.
(aapcs_layout_arg): Emit -Wpsabi note if arm_needs_doubleword_align
returns negative, increment ncrn only if it returned positive.
(arm_needs_doubleword_align): Return int instead of bool,
ignore DECL_ALIGN of non-FIELD_DECL TYPE_FIELDS chain
members, but if there is any such non-FIELD_DECL
> PARM_BOUNDARY aligned decl, return -1 instead of false.
(arm_function_arg): Emit -Wpsabi note if arm_needs_doubleword_align
returns negative, increment nregs only if it returned positive.
(arm_setup_incoming_varargs): Likewise.
(arm_function_arg_boundary): Emit -Wpsabi note if
arm_needs_doubleword_align returns negative, return
DOUBLEWORD_ALIGNMENT only if it returned positive.
testsuite/
* g++.dg/abi/pr77728-1.C: New test.

Backported from trunk:
0e6ba620ce829dbde3ece9cefdbe09355ddfbb74

Change-Id: Ia454a63c3ebb930e546188ded5f339a967d81754
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@247259 138bc75d-0d04-0410-961f-82ee72b054a4

7 years ago[ubsan] Fix for vptr check 29/131529/3 submit/tizen_base/20170613.074657 submit/tizen_base/20170705.023439
Denis Khalikov [Mon, 29 May 2017 17:35:03 +0000 (20:35 +0300)]
[ubsan] Fix for vptr check

Summary:
There can be a situation when vptr not initializing
by constructor of the object, and has a junk data
which should be properly checked, because c++ standard
says:

"If the new-initializer is omitted, the object is default-initialized (8.5).
[ Note: If no initialization is performed,
 the object has an indeterminate value. — end note ]

Change-Id: I6fd297dc10b2ddb54eaed9e6eb3a46310dafead4
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
7 years ago[asan] Fix ASan preload issue. 39/130739/27
Denis Khalikov [Thu, 8 Jun 2017 08:32:02 +0000 (11:32 +0300)]
[asan] Fix ASan preload issue.

There might be a situation when ASan initializing later
than shared library which has malloc in static constructor.
(rtld doesn't provide the order of initiazation)
In this case ASan doesn't initialize interceptors but already
intercepting malloc. If malloc is too big to be handled by static
local pool ASan will die with error:

Sanitizer CHECK failed: libsanitizer/asan/asan_malloc_linux.cc:40
((allocated_for_dlsym)) < ((kDlsymAllocPoolSize)) (1036, 1024)

Backported from LLVM mainline rL305058

Change-Id: I93c9662953629b373506fcacacee43edd791c68f
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
7 years agopackaging: enable log_exe_name sanitizer option for ASan 70/132070/2 accepted/tizen/base/20170609.215631 submit/tizen_base/20170609.081211
Chan Lee [Thu, 1 Jun 2017 03:28:22 +0000 (12:28 +0900)]
packaging: enable log_exe_name sanitizer option for ASan

This option shoule be 'log_exe_name' not 'log_exe_path'

According to SanitizerCommonFlags,
(https://github.com/google/sanitizers/wiki/SanitizerCommonFlags)
Enabling this option makes ASan mention name of executable when reporting error and append
executable name to logs (as in "log_path.exe_name.pid").

Change-Id: I0a49a2032355b6527ea7522faa1414ec8d567125
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
7 years agoPR sanitizer/80414 81/127881/7
Denis Khalikov [Fri, 2 Jun 2017 09:17:06 +0000 (12:17 +0300)]
PR sanitizer/80414

  * ubsan.c (ubsan_expand_bounds_ifn): Pass original index
  to ubsan_encode_value.

Change-Id: Id8e339c51aac586cd7d61e02a6711e875354948a
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
7 years ago[ubsan] Ported fix for PR sanitizer/79897 52/131652/5
Denis Khalikov [Mon, 17 Apr 2017 16:31:13 +0000 (19:31 +0300)]
[ubsan] Ported fix for PR sanitizer/79897

2017-03-07  Jakub Jelinek  <jakub@redhat.com>

       PR sanitizer/79897
       * ubsan.c (ubsan_encode_value): Call mark_addressable on the
       temporary.

Change-Id: I075edb26f51d4ec2eccc2e59dbbe489b43b3b5db
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
7 years agoPR c++/79296 - ICE mangling localized template instantiation 99/127499/2
nathan [Thu, 27 Apr 2017 10:56:35 +0000 (13:56 +0300)]
PR c++/79296 - ICE mangling localized template instantiation
        * decl2.c (determine_visibility): Use template fn context for
        local class instantiations.

        PR c++/79296
        * g++.dg/cpp0x/pr79296.C: New.

Change-Id: I51b9ba39a48a97a8836976baf5f598ede9ba695a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245398 138bc75d-0d04-0410-961f-82ee72b054a4

7 years ago[sanitizer-coverage] Add new coverage dump interface 43/128843/11 accepted/tizen/base/20170602.151755 submit/tizen_base/20170524.085448
Dmitriy Nikiforov [Thu, 11 May 2017 14:37:27 +0000 (17:37 +0300)]
[sanitizer-coverage] Add new coverage dump interface

libsanitizer/
* include/santizer/coverage_interface.h
(__sanitizer_dump_coverage): New function.
* sanitizer_common/sanitizer_interface_internal.h
(__sanitizer_dump_coverage): Likewise.
* sanitizer_common/sanitizer_coverage_libcdep_new.cc: New file.
* sanitizer/Makefile.am: Updated.
* sanitzer/Makefile.in: Updated.

Partially backported from LLVM mainline r289498, r291267, r291736, r289851.

Change-Id: I6c13ca8e6e7cfb3c98596970c8ba243296464eeb
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
7 years ago[sanitizer-coverage] Add interface for coverage symbolization 42/128842/11
Dmitriy Nikiforov [Thu, 11 May 2017 14:24:59 +0000 (17:24 +0300)]
[sanitizer-coverage] Add interface for coverage symbolization

libsanitizer/
* sanitizer_common/sanitizer_stacktrace_libcdep.cc:
(__sanitizer_symbolize_pc): New function.
(__sanitizer_get_module_and_offset_for_pc): New function.
* include/sanitizer/common_interface_defs.h
(__sanitizer_symbolize_pc): Likewise.
(__sanitizer_get_module_and_offset_for_pc): Likewise.
* sanitizer_common/sanitizer_interface_internal.h
(__sanitizer_get_module_and_offset_for_pc): Likewise.

Partially backported from LLVM mainline r281886, r279780, r288711,
r281668, r281015, r289498. Also, fixed argument names in declarations of
__sanitizer_get_module_and_offset_for_pc().

Change-Id: I3722eb8d3e1cd07b6b862f1a4421517b32b22c5a
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
7 years ago[sanitizer-coverage] Add stub for trace-pc instrumentation 41/128841/8
Dmitriy Nikiforov [Thu, 11 May 2017 14:21:34 +0000 (17:21 +0300)]
[sanitizer-coverage] Add stub for trace-pc instrumentation

libsanitizer/
* sanitizer_common/sanitizer_coverage_libcdep.cc (__sanitizer_cov_trace_pc):
New function.

Change-Id: I1ead302ccb56c8f20d1a6e29a7cdef8963fa4090
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
7 years agoMove static array from header to .c file (fixed increased memory usage bs-45) 74/129074/4 accepted/tizen/base/20170519.201131 submit/tizen_base/20170518.085959 tizen_4.0.m1_release
Mikhail Kashkarov [Wed, 10 May 2017 09:58:52 +0000 (12:58 +0300)]
Move static array from header to .c file (fixed increased memory usage bs-45)

Please, remove this commit when merging c1cb342.

        gcc/
        * config/arm/arm-opts.h: Move struct arm_arch_core_flag and
        static array arm_arch_core_flags to...
        * common/config/arm/arm-common.c: There.

Change-Id: Id71ddb5deac5372791b63f9bf03852e661477bf4

7 years agoDo not build libgfortran unless requested explicitly 65/127565/3 accepted/tizen/base/20170512.171103 submit/tizen_base/20170504.000140
Slava Barinov [Thu, 27 Apr 2017 08:20:09 +0000 (11:20 +0300)]
Do not build libgfortran unless requested explicitly

        * gcc/fortran/config-lang.in : add conditional target_libs setup.

This option does not make sense in upstream GCC - Fortran frontend is useless
without runtime, but will work with qemu-accel in Tizen OBS environment.

Change-Id: Ie42fa3201a0bc022ef46ef53b51be896ad091943
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agopackaging: add fortran compiler 58/126558/5
Chan Lee [Mon, 24 Apr 2017 07:11:01 +0000 (16:11 +0900)]
packaging: add fortran compiler

Change-Id: I139d3b29c690a05e29bcfcfa660350f63bbbdadc
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
7 years agocommit 6fdba17a20fd7c5f31f39556dc511abe3a537204 68/127468/1 sandbox/ibaravy/isan_base accepted/tizen/base/20170429.025027 submit/tizen_base/20170428.032130
Denis Khalikov [Wed, 26 Apr 2017 15:27:29 +0000 (18:27 +0300)]
commit 6fdba17a20fd7c5f31f39556dc511abe3a537204
Author: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
Date:   Fri Oct 28 06:49:53 2016 +0000

    [asan/lsan] Avoid possible deadlock in dynamic ASan runtime thread initialization.

    There is possible deadlock in dynamic ASan runtime when we dlopen() shared lib
    which creates a thread at the global initialization stage. The scenario:

    1) dlopen grabs a GI_pthread_mutex_lock in main thread.
    2) main thread calls pthread_create, ASan intercepts it, calls real pthread_create
       and waits for the second thread to be "fully initialized".
    3) Newly created thread tries to access a thread local disable_counter in LSan
       (to complete its "full initialization") and hangs in tls_get_addr_tail, because
       it also tries to acquire GI_pthread_mutex_lock.

     The issue is reproducible on relative recent Glibc versions e.g. 2.23.

     Differential Revision: https://reviews.llvm.org/D26028

Change-Id: I0ed82cb81dd9d37d0be96ece03b667090b72164a

7 years agoRemove hard-coded path to extract-ubsan-logs script 73/125673/1
Slava Barinov [Fri, 7 Apr 2017 10:06:58 +0000 (13:06 +0300)]
Remove hard-coded path to extract-ubsan-logs script

Change-Id: Id515f89e748fbe9a18f5a615e100eb530a0c5930
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoKeep to use version 6.2.1 accepted/tizen/base/20170413.143919 submit/tizen_base/20170412.005421
Dongkyun, Son [Thu, 6 Apr 2017 10:03:50 +0000 (19:03 +0900)]
Keep to use version 6.2.1

This is for the Tizen version policy (First released to 6.2.1 20161213)

Change-Id: I6aa5d673c922401eff605448fe4ab6b3512ccd71
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
7 years agopackaging: add license files to all sub components
Dongkyun, Son [Fri, 7 Apr 2017 01:27:29 +0000 (10:27 +0900)]
packaging: add license files to all sub components

The license files are added to only library components because they could be
included to target binary.

Change-Id: I7fb9885843794ea47c29833ead402386d890d663
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
7 years agopackaging: remove cloog
Chan Lee [Fri, 7 Apr 2017 07:04:02 +0000 (16:04 +0900)]
packaging: remove cloog

Cloog had been removed from gcc.

Related git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218348
138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: Ifc898f5f4b429382d082b43e3cbfd4e46b226e2f
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
7 years agopackaging: provide 64bit libs on 32bit build env
Chan Lee [Mon, 27 Mar 2017 01:30:18 +0000 (10:30 +0900)]
packaging: provide 64bit libs on 32bit build env

In some cases, especially .Net toolchain needs 64bit libs to execute
even though 32bit build environment.
It's a little weird but possble because almost archtecture of build machine is 64bit.

Change-Id: I0d8df53d4743a4fa1b2c00d6aeeeed77e8b964cf
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
7 years agoEnabling libcc1 build
Slava Barinov [Thu, 2 Mar 2017 08:47:59 +0000 (11:47 +0300)]
Enabling libcc1 build

Change-Id: I4485bdf215e020450a65970474b591e98a7367f1

7 years agoAdd liblsan packaging
Slava Barinov [Tue, 28 Feb 2017 12:17:45 +0000 (15:17 +0300)]
Add liblsan packaging

Change-Id: I44084744a83cdc87e69b2a1f25cc4138bac31913
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoBasing on 6.3.1 branch
Slava Barinov [Tue, 28 Feb 2017 11:35:47 +0000 (14:35 +0300)]
Basing on 6.3.1 branch

Change-Id: Idbb9664859cb4a000f1a5631bc948652b49e9fc4
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoMove SanitizerToolName definition before MaybeMountProcFS.
Maxim Ostapenko [Tue, 8 Nov 2016 10:45:49 +0000 (13:45 +0300)]
Move SanitizerToolName definition before MaybeMountProcFS.

The MaybeMountProcFS uses SanitizerToolName in its failure messages so we
need it defined at this point.

Change-Id: I6a568e1ebf3d646ecfbdb53fd8e48910e9b66559
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
7 years agoFix the UBSan inexpensive call sanitization
Ivan Baravy [Mon, 27 Feb 2017 08:44:27 +0000 (11:44 +0300)]
Fix the UBSan inexpensive call sanitization

The change imported in order to fix false positive -Wmaybe-uninitialized
in several packages in UBSan builds.

    * gimple.c: Include builtins.h
    (gimple_inexpensive_call_p): New function.
    * gimple.h (gimple_inexpensive_call_p): Declare.
    * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use it.
    * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise;
    fix formatting.

upstream hash: f18de397b1e0523fd840800399ec6ea21ec04af8
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237172 138bc75d-0d04-0410-961f-82ee72b054a4

Authored-by: hubicka
7 years agoMake lsan-force-options and lsan-build-env more usable. Factor out common
Ivan Baravy [Mon, 27 Feb 2017 08:07:23 +0000 (11:07 +0300)]
Make lsan-force-options and lsan-build-env more usable. Factor out common
code from {A, UB}San to sanitizer_common code.

Add -fno-omit-frame-pointer -U_FORTIFY_SOURCE to lsan-force-options because
LSan heavily relies on frame pointers. Disable LSan in QEMU builds through
LSAN_OPTIONS file. Refactor Tizen specific patches in ASan and UBSan.

7 years agoFix ASan tests.
Maxim Ostapenko [Thu, 4 Aug 2016 08:27:22 +0000 (11:27 +0300)]
Fix ASan tests.

Some ASan tests fail due to:
1) Unable to unwind malloc trace.
2) Return invalid code due to hant_on_error=false enabled by default.

Let's fix this.

Change-Id: I634c5bff0e21a693a4168eaa12f443cee114a83e
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
7 years agoSet detect_leaks = false and halt_on_error = false by default.
Ivan Baravy [Mon, 27 Feb 2017 08:00:20 +0000 (11:00 +0300)]
Set detect_leaks = false and halt_on_error = false by default.

Set detect_leaks and halt_on_error to false by default because mic
installs asan-build-env package too late.

7 years agoRemove redundant calls of MaybeMountProcFS and refactor it.
Maxim Ostapenko [Wed, 6 Jul 2016 10:04:28 +0000 (13:04 +0300)]
Remove redundant calls of MaybeMountProcFS and refactor it.

It seems that we have lots of redundant MaybeMountProcFS, in particular
each mapped sanitized shared library calls it from AsanInitializer constructor.
Remove redudant MaybeMountProcFS calls from AsanInitializer and __asan_init.

Also, it seems that under qemu-aarch64 opening /proc/self/maps for reading
might be very expensive, so replace OpenFile("/proc/self/maps", RdOnly) with
FileExists("/proc/self/maps") in MaybeMountProcFS to avoid expensive calls.

Change-Id: I8ba28dbbc102be519fa2b284520509f601ec5cf7
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>