[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-22 Thread Rainer Orth via Phabricator via cfe-commits
ro abandoned this revision. ro added a comment. Superceded by D119829 and D120048 . If absolutely necessary, D120059 could be revived if Illumos cannot implement `dlpi_tls_modid`. Reposito

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-17 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment. In D91605#3329375 , @ro wrote: > > As an experiment, I've tried to use `GetStaticTlsBoundary` instead. It does > indeed work on recent Solaris 11.4 and the resulting patch is at D120048 > . I'm

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-17 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment. In D91605#3322312 , @ro wrote: > In D91605#3321554 , @MaskRay wrote: > >> `GetTls` is about the static TLS block size. It consists of the main >> executable's TLS, and initially loaded shared ob

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-15 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment. In D91605#3321556 , @MaskRay wrote: > The Clang driver change should be in a separate patch with clang/test/Driver > tests. Done now: D119829 . Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-15 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment. In D91605#3321554 , @MaskRay wrote: > `GetTls` is about the static TLS block size. It consists of the main > executable's TLS, and initially loaded shared objects' TLS, `struct pthread`, > and padding. > Solaris should be able to just

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-14 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. The Clang driver change should be in a separate patch with clang/test/Driver tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91605/new/ https://reviews.llvm.org/D91605 ___

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-14 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. `GetTls` is about the static TLS block size. It consists of the main executable's TLS, and initially loaded shared objects' TLS, `struct pthread`, and padding. Solaris should be able to just use the code path like Linux musl: #elif SANITIZER_FREEBSD || SANITIZER_LINUX

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-14 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment. @vitalybuka , @MaskRay could I persuade you to review the revision version which should be much less controversial and completely Solaris-specific? Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91605/new/ https://revi

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2022-02-14 Thread Rainer Orth via Phabricator via cfe-commits
ro updated this revision to Diff 408389. ro added a subscriber: nikic. ro added a comment. Since the build-time check for the `ld -z relax=transtls` option was met with massive resistance and was only necessary for Illumos anyway, this revision just uses it unconditionally. Tested on `amd64-pc-

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-25 Thread Rainer Orth via Phabricator via cfe-commits
ro added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) MaskRay wrote: > MaskRay wrote: > > ro wrote: > > > MaskRay wrote: > > > > ro wrote: > > > > > MaskRay wrote

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-24 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) MaskRay wrote: > ro wrote: > > MaskRay wrote: > > > ro wrote: > > > > MaskRay wrote: > > > > > ro wrote

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-24 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) ro wrote: > MaskRay wrote: > > ro wrote: > > > MaskRay wrote: > > > > ro wrote: > > > > > MaskRay wrote

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-24 Thread Rainer Orth via Phabricator via cfe-commits
ro added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) MaskRay wrote: > ro wrote: > > MaskRay wrote: > > > ro wrote: > > > > MaskRay wrote: > > > > > ro wrote: > >

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) ro wrote: > MaskRay wrote: > > ro wrote: > > > MaskRay wrote: > > > > ro wrote: > > > > > MaskRay wrote

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-23 Thread Rainer Orth via Phabricator via cfe-commits
ro updated this revision to Diff 307067. ro added a comment. Herald added a project: LLVM. - Move declarations to new `sanitizer_solaris.h`. - Augment `check_linker_flag` do reject unknown `-z` options that GNU ld noisily accepts. Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-23 Thread Rainer Orth via Phabricator via cfe-commits
ro added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) MaskRay wrote: > ro wrote: > > MaskRay wrote: > > > ro wrote: > > > > MaskRay wrote: > > > > > GNU ld report

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-20 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) ro wrote: > MaskRay wrote: > > ro wrote: > > > MaskRay wrote: > > > > GNU ld reports a warning instead

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-20 Thread Rainer Orth via Phabricator via cfe-commits
ro added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) MaskRay wrote: > ro wrote: > > MaskRay wrote: > > > GNU ld reports a warning instead of an error when an unk

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-19 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/tools/driver/CMakeLists.txt:123 + +check_linker_flag("-Wl,-z,relax=transtls" LINKER_SUPPORTS_Z_RELAX_TRANSTLS) ro wrote: > MaskRay wrote: > > GNU ld reports a warning instead of an error when an unknown `-z` is see

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Other than file issue, compiler-rt part is LGTM leaving the rest to @MaskRay Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:455-520 +#if SANITIZER_SOLARIS +// dlpi_tls_modid is only available since Solaris 11.4 SRU 10. Use

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-19 Thread Rainer Orth via Phabricator via cfe-commits
ro added inline comments. Comment at: clang/lib/Driver/ToolChains/Solaris.cpp:150 + const SanitizerArgs &SA = getToolChain().getSanitizerArgs(); + if (LINKER_SUPPORTS_Z_RELAX_TRANSTLS && + getToolChain().getTriple().getArch() == llvm::Triple::x86_64 &&

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/Solaris.cpp:150 + const SanitizerArgs &SA = getToolChain().getSanitizerArgs(); + if (LINKER_SUPPORTS_Z_RELAX_TRANSTLS && + getToolChain().getTriple().getArch() == llvm::Triple::x86_64 && ---

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/Solaris.cpp:150 + const SanitizerArgs &SA = getToolChain().getSanitizerArgs(); + if (LINKER_SUPPORTS_Z_RELAX_TRANSTLS && + getToolChain().getTriple().getArch() == llvm::Triple::x86_64 && ---

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-18 Thread Rainer Orth via Phabricator via cfe-commits
ro added inline comments. Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:455-520 +#if SANITIZER_SOLARIS +// dlpi_tls_modid is only available since Solaris 11.4 SRU 10. Use +// dlinfo(RTLD_DI_LINKMAP) instead which works on both Solaris 11.3 and Illumos

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:455-520 +#if SANITIZER_SOLARIS +// dlpi_tls_modid is only available since Solaris 11.4 SRU 10. Use +// dlinfo(RTLD_DI_LINKMAP) instead which works on both Solaris 11.3 and

[PATCH] D91605: [sanitizers] Implement GetTls on Solaris

2020-11-17 Thread Rainer Orth via Phabricator via cfe-commits
ro created this revision. ro added reviewers: vitalybuka, MaskRay. ro added a project: Sanitizers. Herald added subscribers: Sanitizers, pengfei, fedor.sergeev, mgorny, jyknight. Herald added a project: clang. ro requested review of this revision. In the initial Solaris ASan port, `GetTls` was lef