summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-11-10packaging: Enable LSan for %armtizen_base_dev_featuresSlava Barinov5-5/+5
Change-Id: I7427bea84bf7593ac72c27d24148ad6296616fad Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-11-10[ASan] Add __libc_siglongjmp/__libc_longjmp interceptorsMikhail Kashkarov2-0/+24
Change-Id: Ic247cb33f17743fa597b3a74baf7cf31c075165d
2023-11-10[LSan] Add dynamic loading support for LSan libraryVyacheslav Cherkashin1-2/+10
The LSan library has very big static TLS section Problem: - LSan library could not be loaded dynamically because it had a very big static TLS section. AllocatorCache: ~15KB for 32bit ~53KB for 64bit Solution: - Store in the TLS section only a pointer to the AllocatorCache and dynamically allocate memory for it. Change-Id: I6e90e6682e277c90825938f5732867b6564d62b4 Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
2023-11-10[THUMB2] Frame pointer for arm with THUMB2 mode.Denis Khalikov4-29/+240
Set frame pointer to the predictable location in the stack frame for arm with THUMB2 mode. Denis Khalikov <d.khalikov@partner.samsung.com> * config/arm/arm.c (arm_emit_multi_reg_pop_no_return): New function. (arm_compute_initial_elimination_offset): Add support for TARGET_THUMB_STACK_UNWIND. (arm_expand_prologue): Emit function prologue related to TARGET_THUMB_STACK_UNWIND. (thumb2_expand_return): Emit function epilogue related to TARGET_THUMB_STACK_UNWIND. (arm_expand_epilogue): Emit function epilogue related to TARGET_THUMB_STACK_UNWIND. * config/arm/arm.h (TARGET_THUMB_STACK_UNWIND): New define. (INITIAL_ELIMINATION_OFFSET): Add support for TARGET_THUMB_STACK_UNWIND. * config/arm/arm.opt: Add compile-time option THUMB_FP. * gcc/testsuite/c-c++-common/asan/fast-unwind-thumb.c: New tests. Change-Id: I45a68a1216f3115c5199e5cea14c344fabe11fc1
2023-09-14[ASan] Add FORTIFY_SOURCE interceptorsDenis Khalikov16-1/+871
List of interceptors: __strcat_chk, __strncat_chk, __strcpy_chk, __strncpy_chk. __poll_chk, __ppoll_chk, __read_chk, __recv_chk, __recvfrom_chk, __pread_chk, __pread64_chk. __getgroups_chk, __getcwd_chk, __realpath_chk, __confstr_chk. __mbstowcs_chk, __mbsrtowcs_chk, __mbsnrtowcs_chk, __wcstombs_chk, __wcsrtombs_chk, __wcsnrtombs_chk, __wcrtomb_chk, __ttyname_r_chk. Change-Id: I16ef4d2d80089b96e5c51ea5160b706b35f9ce18
2023-09-14[ASan] Add teests of interceptor for printf_chkDenis Khalikov4-0/+133
Differential Revision: https://reviews.llvm.org/D40951 Change-Id: I7c32945659da4cf80e995370cb26fb063bb7930c
2023-09-14[TTC-8][Sanitizers] Add tests for allocator_may_return_null=1 flagSlava Barinov9-0/+186
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>
2023-09-14[TTC-9] Make LSan compliant with recovery mode when running on top of ASanSlava Barinov3-0/+40
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>
2023-09-14Add ChangeLog.TizenSangmin Seo1-0/+337
ChangeLog.Tizen is to keep track of private patches for Tizen GCC. Change-Id: I2fbde58d410ab4a7ddbda361be86a48de9d891e3
2023-09-14Fix cleanup location for try_finally_expr.Slava Barinov16-6/+127
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>
2023-09-14[UBSAN] Fix systemd initialization with UBSan.Denis Khalikov1-0/+1
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>
2023-09-14Switch on detect_leaks on 64-bit platforms by defaultSlava Barinov3-3/+3
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>
2023-09-14[sanitizer-coverage] Add stub for trace-pc instrumentationDmitriy Nikiforov1-0/+1
libsanitizer/ * sanitizer_common/sanitizer_coverage_libcdep_new.cc (__sanitizer_cov_trace_pc): New function. Change-Id: I1ead302ccb56c8f20d1a6e29a7cdef8963fa4090 Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
2023-09-14Move SanitizerToolName definition before MaybeMountProcFS.Maxim Ostapenko2-2/+2
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>
2023-09-13Support asan runtime without /ASAN_OPTIONS fileMikhail Kashkarov1-1/+4
Allow nice host builds with Tizen libasan.
2023-09-13Make lsan-force-options and lsan-build-env more usable. Factor out common ↵Ivan Baravy8-43/+57
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. Change-Id: I5365daee191dd1f61229757b8f47d102390d59a0
2023-09-13Fix ASan tests.Maxim Ostapenko9-19/+79
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>
2023-09-13Set detect_leaks = false and halt_on_error = false by default.Ivan Baravy4-4/+4
Set detect_leaks and halt_on_error to false by default because mic installs asan-build-env package too late. Change-Id: I497f1f8e6a1e9425e40c8087ea50b14d176a04ce
2023-09-13Remove redundant calls of MaybeMountProcFS and refactor it.Maxim Ostapenko1-7/+2
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>
2023-09-13Add git-merge-changelog supportMikhail Kashkarov1-0/+1
Change-Id: I84fc05f8672a17ee7c862595d9c25c86c9f18f27
2023-09-13Fix c-c++-common/asan/pr64820.c testcase to pass output pattern tests underIvan Baravy2-2/+16
qemu-aarch64. Adjust halt_on_error tests. gcc/testsuite/ * c-c++-common/asan/pr64820.c: Adjust output patterns. * c-c++-common/asan/halt_on_error-1.c: Adjust. * c-c++-common/asan/halt_on_error-1.c: Likewise.
2023-09-13Move lsan_check_in_progress definition to lsan_common.cc.Maxim Ostapenko2-1/+3
This commit fixes undefined reference error from libasan.so: /lib/libasan.so: undefined reference to `lsan_check_in_progress' occurred due to ASan runtime embeds part of LSan runtime and misses lsan_check_in_progress symbol. To overcome the issue, just move lsan_check_in_progress definition to lsan_common.cc. Change-Id: I9ed7f4d490d525bbf7ce054285afaec24716f35a Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
2023-09-13Add mmap/munmap interceptors.Maxim Ostapenko4-4/+60
Some allocators may use mmap for their local pools that may cause false positive reports because LSan currently doesn't intercept mmap call mainly due to its complexity (we don't know whether a particular mmap would contain live pointers). However for some cases (e.g. anonymous rw mmaps) we can guess that they would contain live pointers thus we can add them into root regions. Thus, now we intercept mmap/munmap calls, add anonymous rw mappings into root regions and call real mmap. Change-Id: Ie0bde91497a31ab670f15d67b34d328969dc0981 Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
2023-09-13Make {A, L}San allocator more compact.Maxim Ostapenko2-2/+2
This change tries to reduce memory consumption of {A, L}Saned image by hacking primary allocator internals: * Reduce region size 2^20 -> 2^17. * Make largest chunk size in primary allocator 2^17 -> 2^16. The change appears to be quite useful for LSan'ed image: Stock version: total used free shared buffers cached Mem: 964 828 136 3 4 92 Patched version: total used free shared buffers cached Mem: 964 688 275 5 13 185 Change-Id: I80b95f7dfb5a7be0e7208567a31606a3d027256c Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
2023-09-13Set 0777 mode to sanitizer tool reportSlava Barinov1-1/+1
There are processes which are executed with root permissions and then change the user during run on target. Without setting up the file mode to 0777 trying to write log causes write error and process exits. Change-Id: I88c6738625d67f4db2efea76cc8928d4f58b6e7c Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-09-13Support print_cmdline in LSan.Maxim Ostapenko2-1/+3
Change-Id: I65d37582e6b5c3d54f8628e96edbaf4cbfc7c337 Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com> Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
2023-09-13Switch off UBSan for sha1 to reduce number of log messagesSlava Barinov1-0/+1
The sha1 contains intentional unaligned access Change-Id: I5bb6d0c9bf274e8ed0fe4c87c341dee054623202 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-09-13Force halt_on_error=true in ASan testsSlava Barinov2-0/+2
Since our ASan does not fail application on error by default we should switch this behaviour on explicitly to keep testsuite work. Change-Id: I4344f82427bc62a40604a75f5f09f62333b6782d Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-09-13* gcc.dg/ubsan/static-init-null.c: New testcaseIvan Baravy1-0/+25
2023-09-13Set 0644 mode to sanitizer tool reportSlava Barinov1-1/+8
Without setting up the file mode explicitly its impossible to read the logs by users in OBS. Change-Id: Icaa540b434fc6266cbd0b1ad3391e21b8cbb692f Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-09-13Add binary name printing support to UBSanSlava Barinov2-1/+7
The binary name is needed for reporting with log_path since PID is not always enough to identify the process right. Change-Id: Ibefe22bac9f4d2a89eaacb40e6d7dc860b08d5f9 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-09-13Deliver LSan fixes for Tizen.Maxim Ostapenko8-3/+69
* Read LSAN_OPTIONS from /LSAN_OPTIONS file. * Add MaybeMountProcFS stuff for LSan. This would allow us to preload liblsan.so even for systemd when /proc/ isn't mounted yet. * Add ARM and x86 ports for LSan. * Add PointsIntoChunk method to protect against segfault when pointer points to metadata. * Make cf.exitcode = 0 by default. commit a6549ffda72b4f84bbd2c763640181eaeccf6582 Change-Id: I20b10bd29f4ed25e78a61b70dfb82b12c1be352e
2023-09-13Backport Tizen specific stuff from VDLinux 6.Ivan Baravy3-4/+63
Backport from VDLinux 5. Optionally mount /proc in __asan_init to allow systemd sanitization. 2014-10-21 Yury Gribov <y.gribov@samsung.com> JIRA: MAVDT-64 * libsanitizer/asan/asan_rtl.cc (MaybeMountProcFS): New function. (__asan_init): Call MaybeMountProcFS. Mount /proc not only in AsanInitInternal, but also in __asan_init and AsanInitializer to ensure we have proc mounted when needed. * libsanitizer/asan/asan_rtl.cc (__asan_init): Call MaybeMountProcFS. * (AsanInitializer): Likewise. Set address space unlimited if it is not. * libsanitizer/asan/asan_rtl.cc (MaybeDisableUlimit): New function. (AsanInitInternal): Call it. Read ASan and UBSan options from predefined file if it is available. * libsanitizer/asan/asan_flags.cc: Read ASAN_OPTIONS from predefined file if available. * libsanitizer/ubsan/ubsan_flags.cc: Likewise. Change-Id: Ibfa7a3bb032f757e28cf7baac19882a8e4367cae
2023-07-28Add .gbs.conf to align upstream branch with tagsubmit/tizen_base_dev/20230731.024114Dongkyun Son1-0/+5
Change-Id: Icf28ce7c590f459e6e7a851d9de0ac5b997cce34 Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
2023-07-28riscv64: add /lib64 and /usr/lib64 to libdir for gcc driverSlava Barinov1-1/+3
At least until a decision on system-wide %_libdir for RISC-V 64 is made Change-Id: I509acf5263a3f06afd4395b4d72b931789e44454 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: Add riscv64 platformSlava Barinov6-21/+1382
Change-Id: I377f05d4a027040f22b9c22d361efd9865584132 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28Revert "Do not build libgfortran unless requested explicitly"Dongkyun Son1-5/+2
This reverts commit 15f23fa790a5c3396ce177981d8395152b679266.
2023-07-28packaging: libstdc++exp addedSlava Barinov4-0/+8
Change-Id: I5495f7a6c39462b22f3470380982f5ae1bbd48b1 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: enable HWASan for x86_64Slava Barinov4-4/+4
Now the library is built by default Change-Id: I60d5f8a4b82d54556ecf8f70deb597a7047371aa Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: Bump to 13.1.0Slava Barinov4-4/+4
Change-Id: I64c7fc98d709773616da57490647f5a1ae0ea53d
2023-07-28packaging: update math libraries versionDongkyun Son10-24/+24
* gmp-6.1.2 -> 6.2.1 * mpfr-4.0.2 -> 4.2.0 * mpc-1.1.0 -> 1.3.1 Change-Id: Iffc8a68e30dfff976e1b8628f64bcc406b778148 Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
2023-07-28packaging: Bump version to 12.2.0Dongkyun Son4-84/+188
Change-Id: I1e5119b75e065ffd7a27715627de7347d873716f Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com> Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28Revert "packaging: Enable gcc build with mthumb-fp"Dongkyun Son4-4/+4
This reverts commit da017a93fe239dfb8d97447dd576a0e2b01f5257. Change-Id: Ibe93e8fb70df007ab0f75c01f49f4fb821e654a3
2023-07-28Tizen configuration enabled for aarch64 buildSlava Barinov2-1/+41
2021-06-22 Vyacheslav Barinov <v.barinov@samsung.com> * gcc/config.gcc: Use tizen.h config for AArc64 Tizen builds. * gcc/config/aarch64/tizen.h: New file. Change-Id: Ibdbbfa4e6352d2a8f23193004ec998697c490d54 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: disable gcc_run_tests of cross gccDongkyun Son4-32/+36
Cross-toolchain testing is not straightforward. Change-Id: I8292ea0fd2df95195f651daae9b3262a815b051c Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
2023-07-28packaging: Fix armv7hl buildSlava Barinov4-8/+16
The fix prevents cc1: error: '-mfloat-abi=hard': selected processor lacks an FPU Change-Id: I68419bd16b9ca73ef4d5aac174a68a8c4166a65f Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: Add configure-dumper supportSlava Barinov4-0/+132
Change-Id: I1b83928110a067023e527983046700612deb509f Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: Remove -fno-omit-frame-pointer flagSlava Barinov4-7/+37
The flag causes libsanitizer build fail. Change-Id: I3b0eddb5cca8ee8d3ccef2050191978df571627a Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: Support 32bit build for armv8-a CPUSlava Barinov1-1/+11
Change-Id: If7635ee83e866faae7fc6f04ba02da3918e0fdc7 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2023-07-28packaging: Move static libs to separate packageSlava Barinov4-20/+272
Change-Id: Ic5a6f0024ba8bd4c41fdd77d9a1e70b6eee70d62 Signed-off-by: Slava Barinov <v.barinov@samsung.com>