r340522 - Update avr attributes test for output change in r340519
Author: arichardson Date: Thu Aug 23 03:21:36 2018 New Revision: 340522 URL: http://llvm.org/viewvc/llvm-project?rev=340522&view=rev Log: Update avr attributes test for output change in r340519 After this commit there is an addrspace(1) before the attribute #. Since these tests are only checking the value of the attribute add a {{.*}} to make the test resilient to future output changes. Modified: cfe/trunk/test/CodeGen/avr/attributes/interrupt.c cfe/trunk/test/CodeGen/avr/attributes/signal.c Modified: cfe/trunk/test/CodeGen/avr/attributes/interrupt.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avr/attributes/interrupt.c?rev=340522&r1=340521&r2=340522&view=diff == --- cfe/trunk/test/CodeGen/avr/attributes/interrupt.c (original) +++ cfe/trunk/test/CodeGen/avr/attributes/interrupt.c Thu Aug 23 03:21:36 2018 @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm %s -o - | FileCheck %s -// CHECK: define void @foo() #0 +// CHECK: define void @foo(){{.*}}#0 __attribute__((interrupt)) void foo(void) { } // CHECK: attributes #0 = {{{.*interrupt.*}}} Modified: cfe/trunk/test/CodeGen/avr/attributes/signal.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avr/attributes/signal.c?rev=340522&r1=340521&r2=340522&view=diff == --- cfe/trunk/test/CodeGen/avr/attributes/signal.c (original) +++ cfe/trunk/test/CodeGen/avr/attributes/signal.c Thu Aug 23 03:21:36 2018 @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm %s -o - | FileCheck %s -// CHECK: define void @foo() #0 +// CHECK: define void @foo(){{.*}}#0 __attribute__((signal)) void foo(void) { } // CHECK: attributes #0 = {{{.*signal.*}}} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r315871 - Convert clang::LangAS to a strongly typed enum
Author: arichardson Date: Sun Oct 15 11:48:14 2017 New Revision: 315871 URL: http://llvm.org/viewvc/llvm-project?rev=315871&view=rev Log: Convert clang::LangAS to a strongly typed enum Summary: Convert clang::LangAS to a strongly typed enum Currently both clang AST address spaces and target specific address spaces are represented as unsigned which can lead to subtle errors if the wrong type is passed. It is especially confusing in the CodeGen files as it is not possible to see what kind of address space should be passed to a function without looking at the implementation. I originally made this change for our LLVM fork for the CHERI architecture where we make extensive use of address spaces to differentiate between capabilities and pointers. When merging the upstream changes I usually run into some test failures or runtime crashes because the wrong kind of address space is passed to a function. By converting the LangAS enum to a C++11 we can catch these errors at compile time. Additionally, it is now obvious from the function signature which kind of address space it expects. I found the following errors while writing this patch: - ItaniumRecordLayoutBuilder::LayoutField was passing a clang AST address space to TargetInfo::getPointer{Width,Align}() - TypePrinter::printAttributedAfter() prints the numeric value of the clang AST address space instead of the target address space. However, this code is not used so I kept the current behaviour - initializeForBlockHeader() in CGBlocks.cpp was passing LangAS::opencl_generic to TargetInfo::getPointer{Width,Align}() - CodeGenFunction::EmitBlockLiteral() was passing a AST address space to TargetInfo::getPointerWidth() - CGOpenMPRuntimeNVPTX::translateParameter() passed a target address space to Qualifiers::addAddressSpace() - CGOpenMPRuntimeNVPTX::getParameterAddress() was using llvm::Type::getPointerTo() with a AST address space - clang_getAddressSpace() returns either a LangAS or a target address space. As this is exposed to C I have kept the current behaviour and added a comment stating that it is probably not correct. Other than this the patch should not cause any functional changes. Reviewers: yaxunl, pcc, bader Reviewed By: yaxunl, bader Subscribers: jlebar, jholewinski, nhaehnle, Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D38816 Modified: cfe/trunk/include/clang/AST/ASTContext.h cfe/trunk/include/clang/AST/Type.h cfe/trunk/include/clang/Basic/AddressSpaces.h cfe/trunk/include/clang/Basic/TargetInfo.h cfe/trunk/lib/AST/ASTContext.cpp cfe/trunk/lib/AST/ItaniumMangle.cpp cfe/trunk/lib/AST/RecordLayoutBuilder.cpp cfe/trunk/lib/AST/TypePrinter.cpp cfe/trunk/lib/Basic/TargetInfo.cpp cfe/trunk/lib/Basic/Targets/AMDGPU.cpp cfe/trunk/lib/Basic/Targets/AMDGPU.h cfe/trunk/lib/CodeGen/CGBlocks.cpp cfe/trunk/lib/CodeGen/CGDecl.cpp cfe/trunk/lib/CodeGen/CGExprConstant.cpp cfe/trunk/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp cfe/trunk/lib/CodeGen/CGValue.h cfe/trunk/lib/CodeGen/CodeGenFunction.cpp cfe/trunk/lib/CodeGen/CodeGenModule.cpp cfe/trunk/lib/CodeGen/CodeGenModule.h cfe/trunk/lib/CodeGen/CodeGenTypeCache.h cfe/trunk/lib/CodeGen/ConstantEmitter.h cfe/trunk/lib/CodeGen/TargetInfo.cpp cfe/trunk/lib/CodeGen/TargetInfo.h cfe/trunk/lib/Sema/SemaChecking.cpp cfe/trunk/lib/Sema/SemaDecl.cpp cfe/trunk/lib/Sema/SemaDeclAttr.cpp cfe/trunk/lib/Sema/SemaDeclObjC.cpp cfe/trunk/lib/Sema/SemaExpr.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp cfe/trunk/lib/Sema/SemaType.cpp cfe/trunk/tools/libclang/CXType.cpp Modified: cfe/trunk/include/clang/AST/ASTContext.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=315871&r1=315870&r2=315871&view=diff == --- cfe/trunk/include/clang/AST/ASTContext.h (original) +++ cfe/trunk/include/clang/AST/ASTContext.h Sun Oct 15 11:48:14 2017 @@ -496,7 +496,7 @@ private: CXXABI *createCXXABI(const TargetInfo &T); /// \brief The logical -> physical address space map. - const LangAS::Map *AddrSpaceMap; + const LangASMap *AddrSpaceMap; /// \brief Address space map mangling must be used with language specific /// address spaces (e.g. OpenCL/CUDA) @@ -1070,7 +1070,7 @@ public: /// The resulting type has a union of the qualifiers from T and the address /// space. If T already has an address space specifier, it is silently /// replaced. - QualType getAddrSpaceQualType(QualType T, unsigned AddressSpace) const; + QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const; /// \brief Remove any existing address space on the type and returns the type /// with qualifiers intact (or that's the idea anyway) @@ -2363,14 +2363,14 @@ public: return getTargetAddressSpace(Q.getAddressSpace());
[libcxx] r337824 - Stop wrapping __has_include in another macro
Author: arichardson Date: Tue Jul 24 05:40:56 2018 New Revision: 337824 URL: http://llvm.org/viewvc/llvm-project?rev=337824&view=rev Log: Stop wrapping __has_include in another macro Summary: This is not guaranteed to work since the characters after '__has_include(' have special lexing rules that can't possibly be applied when __has_include is generated by a macro. It also breaks the crash reproducers generated by -frewrite-includes (see https://llvm.org/pr37990). Reviewers: EricWF, rsmith, mclow.lists Reviewed By: mclow.lists Differential Revision: https://reviews.llvm.org/D49067 Modified: libcxx/trunk/include/__config libcxx/trunk/test/support/test_macros.h Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=337824&r1=337823&r2=337824&view=diff == --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Tue Jul 24 05:40:56 2018 @@ -149,10 +149,8 @@ #define __has_keyword(__x) !(__is_identifier(__x)) -#ifdef __has_include -# define __libcpp_has_include(__x) __has_include(__x) -#else -# define __libcpp_has_include(__x) 0 +#ifndef __has_include +#define __has_include(...) 0 #endif #if defined(__clang__) @@ -1066,7 +1064,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit defined(__APPLE__) || \ defined(__CloudABI__) || \ defined(__sun__) || \ - (defined(__MINGW32__) && __libcpp_has_include()) + (defined(__MINGW32__) && __has_include()) #define _LIBCPP_HAS_THREAD_API_PTHREAD # elif defined(_LIBCPP_WIN32API) #define _LIBCPP_HAS_THREAD_API_WIN32 Modified: libcxx/trunk/test/support/test_macros.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=337824&r1=337823&r2=337824&view=diff == --- libcxx/trunk/test/support/test_macros.h (original) +++ libcxx/trunk/test/support/test_macros.h Tue Jul 24 05:40:56 2018 @@ -27,10 +27,8 @@ #define TEST_HAS_FEATURE(X) 0 #endif -#ifdef __has_include -#define TEST_HAS_INCLUDE(X) __has_include(X) -#else -#define TEST_HAS_INCLUDE(X) 0 +#ifndef __has_include +#define __has_include(...) 0 #endif #ifdef __has_extension @@ -90,7 +88,7 @@ #endif // Attempt to deduce GCC version -#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE() +#if defined(_LIBCPP_VERSION) && __has_include() #include #define TEST_HAS_GLIBC #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] r325914 - Allow passing additional compiler/linker flags for the tests
Author: arichardson Date: Fri Feb 23 07:19:48 2018 New Revision: 325914 URL: http://llvm.org/viewvc/llvm-project?rev=325914&view=rev Log: Allow passing additional compiler/linker flags for the tests Summary: These flags can be specified using the CMake variables LIBCXX_TEST_LINKER_FLAGS and LIBCXX_TEST_COMPILER_FLAGS. When building the tests for CHERI I need to pass additional flags (such as -mabi=n64 or -mabi=purecap) to the compiler for our test configurations Reviewers: EricWF Reviewed By: EricWF Subscribers: christof, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D42139 Modified: libcxx/trunk/test/CMakeLists.txt libcxx/trunk/test/lit.site.cfg.in libcxx/trunk/utils/libcxx/test/config.py Modified: libcxx/trunk/test/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=325914&r1=325913&r2=325914&view=diff == --- libcxx/trunk/test/CMakeLists.txt (original) +++ libcxx/trunk/test/CMakeLists.txt Fri Feb 23 07:19:48 2018 @@ -9,6 +9,11 @@ endmacro() set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING "Configuration variant to use for LIT.") +set(LIBCXX_TEST_LINKER_FLAGS "" CACHE STRING +"Additonal linker flags to pass when compiling the tests") +set(LIBCXX_TEST_COMPILER_FLAGS "" CACHE STRING +"Additonal linker flags to pass when compiling the tests") + # The tests shouldn't link to any ABI library when it has been linked into # libc++ statically or via a linker script. if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT) Modified: libcxx/trunk/test/lit.site.cfg.in URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=325914&r1=325913&r2=325914&view=diff == --- libcxx/trunk/test/lit.site.cfg.in (original) +++ libcxx/trunk/test/lit.site.cfg.in Fri Feb 23 07:19:48 2018 @@ -22,6 +22,9 @@ config.sysroot = "@LIBC config.gcc_toolchain= "@LIBCXX_GCC_TOOLCHAIN@" config.generate_coverage= "@LIBCXX_GENERATE_COVERAGE@" config.target_info = "@LIBCXX_TARGET_INFO@" +config.test_linker_flags= "@LIBCXX_TEST_LINKER_FLAGS@" +config.test_compiler_flags = "@LIBCXX_TEST_COMPILER_FLAGS@" + config.executor = "@LIBCXX_EXECUTOR@" config.llvm_unwinder= "@LIBCXXABI_USE_LLVM_UNWINDER@" config.compiler_rt = "@LIBCXX_USE_COMPILER_RT@" Modified: libcxx/trunk/utils/libcxx/test/config.py URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=325914&r1=325913&r2=325914&view=diff == --- libcxx/trunk/utils/libcxx/test/config.py (original) +++ libcxx/trunk/utils/libcxx/test/config.py Fri Feb 23 07:19:48 2018 @@ -510,6 +510,9 @@ class Configuration(object): # and so that those tests don't have to be changed to tolerate # this insanity. self.cxx.compile_flags += ['-DNOMINMAX'] +additional_flags = self.get_lit_conf('test_compiler_flags') +if additional_flags: +self.cxx.compile_flags += shlex.split(additional_flags) def configure_default_compile_flags(self): # Try and get the std version from the command line. Fall back to @@ -794,6 +797,9 @@ class Configuration(object): self.use_system_cxx_lib] if self.is_windows and self.link_shared: self.add_path(self.cxx.compile_env, self.use_system_cxx_lib) +additional_flags = self.get_lit_conf('test_linker_flags') +if additional_flags: +self.cxx.link_flags += shlex.split(additional_flags) def configure_link_flags_abi_library_path(self): # Configure ABI library paths. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r335495 - Use Triple::isMIPS() instead of enumerating all Triples. NFC
Author: arichardson Date: Mon Jun 25 09:49:52 2018 New Revision: 335495 URL: http://llvm.org/viewvc/llvm-project?rev=335495&view=rev Log: Use Triple::isMIPS() instead of enumerating all Triples. NFC Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D48549 Modified: cfe/trunk/lib/Basic/Targets/Mips.cpp cfe/trunk/lib/Basic/Targets/Mips.h cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp cfe/trunk/lib/Driver/ToolChains/Arch/Mips.h cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp cfe/trunk/lib/Driver/ToolChains/Gnu.cpp cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp Modified: cfe/trunk/lib/Basic/Targets/Mips.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/Mips.cpp?rev=335495&r1=335494&r2=335495&view=diff == --- cfe/trunk/lib/Basic/Targets/Mips.cpp (original) +++ cfe/trunk/lib/Basic/Targets/Mips.cpp Mon Jun 25 09:49:52 2018 @@ -200,9 +200,7 @@ ArrayRef MipsTargetInfo:: bool MipsTargetInfo::validateTarget(DiagnosticsEngine &Diags) const { // microMIPS64R6 backend was removed. - if ((getTriple().getArch() == llvm::Triple::mips64 || - getTriple().getArch() == llvm::Triple::mips64el) && - IsMicromips && (ABI == "n32" || ABI == "n64")) { + if (getTriple().isMIPS64() && IsMicromips && (ABI == "n32" || ABI == "n64")) { Diags.Report(diag::err_target_unsupported_cpu_for_micromips) << CPU; return false; } @@ -222,9 +220,7 @@ bool MipsTargetInfo::validateTarget(Diag // FIXME: It's valid to use O32 on a mips64/mips64el triple but the backend //can't handle this yet. It's better to fail here than on the //backend assertion. - if ((getTriple().getArch() == llvm::Triple::mips64 || - getTriple().getArch() == llvm::Triple::mips64el) && - ABI == "o32") { + if (getTriple().isMIPS64() && ABI == "o32") { Diags.Report(diag::err_target_unsupported_abi_for_triple) << ABI << getTriple().str(); return false; @@ -233,9 +229,7 @@ bool MipsTargetInfo::validateTarget(Diag // FIXME: It's valid to use N32/N64 on a mips/mipsel triple but the backend //can't handle this yet. It's better to fail here than on the //backend assertion. - if ((getTriple().getArch() == llvm::Triple::mips || - getTriple().getArch() == llvm::Triple::mipsel) && - (ABI == "n32" || ABI == "n64")) { + if (getTriple().isMIPS32() && (ABI == "n32" || ABI == "n64")) { Diags.Report(diag::err_target_unsupported_abi_for_triple) << ABI << getTriple().str(); return false; Modified: cfe/trunk/lib/Basic/Targets/Mips.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/Mips.h?rev=335495&r1=335494&r2=335495&view=diff == --- cfe/trunk/lib/Basic/Targets/Mips.h (original) +++ cfe/trunk/lib/Basic/Targets/Mips.h Mon Jun 25 09:49:52 2018 @@ -69,10 +69,7 @@ public: UseIndirectJumpHazard(false), HasFP64(false) { TheCXXABI.set(TargetCXXABI::GenericMIPS); -setABI((getTriple().getArch() == llvm::Triple::mips || -getTriple().getArch() == llvm::Triple::mipsel) - ? "o32" - : "n64"); +setABI(getTriple().isMIPS32() ? "o32" : "n64"); CPU = ABI == "o32" ? "mips32r2" : "mips64r2"; Modified: cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp?rev=335495&r1=335494&r2=335495&view=diff == --- cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp Mon Jun 25 09:49:52 2018 @@ -20,11 +20,6 @@ using namespace clang::driver::tools; using namespace clang; using namespace llvm::opt; -bool tools::isMipsArch(llvm::Triple::ArchType Arch) { - return Arch == llvm::Triple::mips || Arch == llvm::Triple::mipsel || - Arch == llvm::Triple::mips64 || Arch == llvm::Triple::mips64el; -} - // Get CPU and ABI names. They are not independent // so we have to calculate them together. void mips::getMipsCPUAndABI(const ArgList &Args, const llvm::Triple &Triple, @@ -106,11 +101,7 @@ void mips::getMipsCPUAndABI(const ArgLis if (ABIName.empty()) { // Deduce ABI name from the target triple. -if (Triple.getArch() == llvm::Triple::mips || -Triple.getArch() == llvm::Triple::mipsel) - ABIName = "o32"; -else - ABIName = "n64"; +ABIName = Triple.isMIPS32() ? "o32" : "n64"; } if (CPUName.empty()) { Modified: cfe/trunk/lib/Driver/ToolChains/Arch/Mips.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/Mips.h?rev=335495&r1=335494&r2=335495&view=diff =
[clang] [mlir] [flang] [llvm] [lld] [ELF] Merge exportDynamic into versionId (PR #71272)
https://github.com/arichardson commented: This looks good to me, nice way of saving one of the bits. https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [flang] [lld] [mlir] [llvm] [ELF] Merge exportDynamic into versionId (PR #71272)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[flang] [clang] [lld] [mlir] [llvm] [ELF] Merge exportDynamic into versionId (PR #71272)
@@ -2518,9 +2521,9 @@ static void combineVersionedSymbol(Symbol &sym, sym.symbolKind = Symbol::PlaceholderKind; sym.isUsedInRegularObj = false; } else if (auto *sym1 = dyn_cast(&sym)) { -if (sym2->versionId > VER_NDX_GLOBAL -? config->versionDefinitions[sym2->versionId].name == suffix1 + 1 -: sym1->section == sym2->section && sym1->value == sym2->value) { +if (sym2->versionId == VER_NDX_GLOBAL || sym2->versionId == nonExported arichardson wrote: I think this would be easier to read with parens, the operator precedence is not necessarily obvious. https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[mlir] [clang] [llvm] [flang] [lld] [ELF] Merge exportDynamic into versionId (PR #71272)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[mlir] [flang] [clang] [llvm] [lld] [ELF] Merge exportDynamic into versionId (PR #71272)
@@ -2518,9 +2521,9 @@ static void combineVersionedSymbol(Symbol &sym, sym.symbolKind = Symbol::PlaceholderKind; sym.isUsedInRegularObj = false; } else if (auto *sym1 = dyn_cast(&sym)) { -if (sym2->versionId > VER_NDX_GLOBAL -? config->versionDefinitions[sym2->versionId].name == suffix1 + 1 -: sym1->section == sym2->section && sym1->value == sym2->value) { +if (sym2->versionId == VER_NDX_GLOBAL || sym2->versionId == nonExported arichardson wrote: In that case we should keep to the more common style. I think I just found it slightly harder to parse since I initially viewed this diff on mobile. https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[flang] [clang] [mlir] [llvm] [lld] [ELF] Merge exportDynamic into versionId (PR #71272)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/71272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)
https://github.com/arichardson approved this pull request. I'm happy with this as is but I'd wait for at least one other positive review before merging. https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] introduce _LIBUNWIND_TRACE_DWARF_EVAL for increased baremetal friendliness (PR #72040)
@@ -223,6 +223,21 @@ } while (0) #endif +#define _LIBUNWIND_TRACING_DWARF_EVAL (0) arichardson wrote: Maybe it would be best to follow the same pattern as above and allow turning it on for debug builds? But seeing as it's always been hardcoded to false, maybe the current preprocessor define makes more sense. It should be very rare that this kind of tracing is needed and a debugger might be better. https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)
https://github.com/arichardson approved this pull request. I would assume this is already transformed to memcpy but I guess it won't be for -O0 https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { // Create a mock exception object for force unwinding. _Unwind_Exception ex; memset(&ex, '\0', sizeof(ex)); - strcpy((char *)&ex.exception_class, "CLNGUNW"); + memcpy(&ex.exception_class, "CLNGUNW", sizeof(ex.exception_class)); arichardson wrote: Maybe use the string length here instead of the size of the exception class? https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { // Create a mock exception object for force unwinding. _Unwind_Exception ex; memset(&ex, '\0', sizeof(ex)); - strcpy((char *)&ex.exception_class, "CLNGUNW"); + memcpy(&ex.exception_class, "CLNGUNW", sizeof(ex.exception_class)); arichardson wrote: I agree this is fine as is. Assigning the integer directly will cause endian issues, so using memcpy is better. If we want to be extra safe, we could #define the string value and add a static_assert(). https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/72043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix an inconsistent indentation (NFC) (PR #72314)
https://github.com/arichardson commented: Making it consistent is good, but it sounds like we should update the .clang-format config file or reformat this whole file to not be indented. https://github.com/llvm/llvm-project/pull/72314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix an inconsistent indentation (NFC) (PR #72314)
arichardson wrote: > > Making it consistent is good, but it sounds like we should update the > > .clang-format config file or reformat this whole file to not be indented. > > I'm not sure what the clang-format policy for libunwind is. How about landing > this as is and updating `.clang-format` or excluding this file as a > follow-up, in a way you and other libunwind maintainers think is appropriate? Sorry if that wasn't obvious, I think your change should be merged. I just noticed that the current style does not match the configured one which should eventually be fixed as a follow up change. https://github.com/llvm/llvm-project/pull/72314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix an inconsistent indentation (NFC) (PR #72314)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/72314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix running tests with MSan (PR #67860)
arichardson wrote: > Gentle ping! Sorry for the delay - I was busy with the RISC-V summit last week, hoping to get to this PR later this week. https://github.com/llvm/llvm-project/pull/67860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)
@@ -672,7 +671,7 @@ inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf, Dl_info dyldInfo; if (dladdr((void *)addr, &dyldInfo)) { if (dyldInfo.dli_sname != NULL) { - snprintf(buf, bufLen, "%s", dyldInfo.dli_sname); + strncpy(buf, dyldInfo.dli_sname, bufLen); arichardson wrote: This will always write up to 512 '\0' bytes. maybe best to use memcpy+strlen instead? https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)
@@ -681,7 +680,7 @@ inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf, uint16_t nameLen; char *funcName = getFuncNameFromTBTable(addr, nameLen, offset); if (funcName != NULL) { -snprintf(buf, bufLen, "%.*s", nameLen, funcName); +strncpy(buf, funcName, nameLen < bufLen ? nameLen : bufLen); arichardson wrote: This will always write up to 512 '\0' bytes. maybe best to use memcpy+strlen instead? https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)
https://github.com/arichardson approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Remove unnecessary dependencies on fprintf and stdio.h for increased baremetal friendliness (PR #72040)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/72040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)
https://github.com/arichardson commented: All my comments have been resolved, thank you very much! https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] [llvm] [clang] [clang-tools-extra] [libc++] Allow running the test suite with optimizations (PR #68753)
@@ -121,6 +136,17 @@ def getStdFlag(cfg, std): AddCompileFlag(lambda cfg: getStdFlag(cfg, std)), ], ), +Parameter( +name="optimization", +choices=["none", "speed", "size"], +type=str, +help="The version of the standard to compile the test suite with.", arichardson wrote: Thanks for the explanation, that makes sense. https://github.com/llvm/llvm-project/pull/68753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] [llvm] [clang] [clang-tools-extra] [libc++] Allow running the test suite with optimizations (PR #68753)
@@ -87,6 +87,21 @@ def getStdFlag(cfg, std): return "-std=" + fallbacks[std] return None +def getSpeedOptimizationFlag(cfg): +if _isClang(cfg) or _isAppleClang(cfg) or _isGCC(cfg): +return "-O3" +elif _isMSVC(cfg): +return "/O2" +else: +raise RuntimeError("Can't figure out what compiler is used in the configuration") + +def getSizeOptimizationFlag(cfg): +if _isClang(cfg) or _isAppleClang(cfg) or _isGCC(cfg): +return "-Os" +elif _isMSVC(cfg): +return "/O1" +else: +raise RuntimeError("Can't figure out what compiler is used in the configuration") arichardson wrote: `black` is unhappy with this formatting: https://github.com/llvm/llvm-project/pull/68753#issuecomment-1756472184 Personally, I'm not massively keen on the `black` coding style but it probably makes sense to keep it to something enforceable by a tool. I do wonder if it would make sense to install it as a pre-commit hook to ensure the formatting stays consistent: https://github.com/akaihola/darker#using-as-a-pre-commit-hook https://github.com/llvm/llvm-project/pull/68753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix running tests with MSan (PR #67860)
@@ -43,6 +43,12 @@ #define LIBUNWIND_AVAIL #endif +#if defined(__SANITIZE_MEMORY__) || \ arichardson wrote: Sounds good. In that case I'll update the PR when I'm back in the office next Thursday. https://github.com/llvm/llvm-project/pull/67860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang][CodeGen] Stoping emitting alignment assumes for `align_{up,down}` (PR #71295)
https://github.com/arichardson approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [llvm] [clang] [clang-tools-extra] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // This code is heavily based on Abseil's 'address_is_readable.cc', + // which is Copyright Abseil Authors (2017), and provided under + // the Apache License 2.0. + + // Align to 8-bytes. + const auto alignedAddr = addr & ~pint_t{7}; + const auto sigsetAddr = reinterpret_cast(alignedAddr); + // We have to check that addr is nullptr because sigprocmask allows that + // as an argument without failure. + if (!sigsetAddr) +return false; + + // We MUST use the raw sigprocmask syscall here, as wrappers may try to + // access sigsetAddr which may cause a SIGSEGV. The raw syscall however is + // safe. Additionally, we need to pass the kernel_sigset_size, which is + // different from libc sizeof(sigset_t). Some archs have sigset_t + // defined as unsigned long, so let's use that. + const auto approxKernelSigsetSize = sizeof(unsigned long); + [[maybe_unused]] const int Result = + syscall(SYS_rt_sigprocmask, /*how=*/~0, sigsetAddr, sigsetAddr, + approxKernelSigsetSize); + // Because our "how" is invalid, this syscall should always fail, and our arichardson wrote: I would add a comment that this code relies on the Linux kernel checking copy_from_user success before checking the how argument is valid. I think this is somewhat fragile but I guess the kernel can't change this behaviour anymore without breaking userspace. https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [clang-tools-extra] [libunwind] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // This code is heavily based on Abseil's 'address_is_readable.cc', + // which is Copyright Abseil Authors (2017), and provided under + // the Apache License 2.0. + + // Align to 8-bytes. + const auto alignedAddr = addr & ~pint_t{7}; + const auto sigsetAddr = reinterpret_cast(alignedAddr); + // We have to check that addr is nullptr because sigprocmask allows that + // as an argument without failure. + if (!sigsetAddr) +return false; + + // We MUST use the raw sigprocmask syscall here, as wrappers may try to + // access sigsetAddr which may cause a SIGSEGV. The raw syscall however is + // safe. Additionally, we need to pass the kernel_sigset_size, which is + // different from libc sizeof(sigset_t). Some archs have sigset_t + // defined as unsigned long, so let's use that. + const auto approxKernelSigsetSize = sizeof(unsigned long); arichardson wrote: It is important that we get this right since otherwise the syscall returns EINVAL without trying to access the user memory: https://elixir.bootlin.com/linux/v6.6.7/source/kernel/signal.c#L3184 https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [clang-tools-extra] [libunwind] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
@@ -2974,6 +2966,39 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // This code is heavily based on Abseil's 'address_is_readable.cc', + // which is Copyright Abseil Authors (2017), and provided under + // the Apache License 2.0. + + // Align to 8-bytes. + const auto alignedAddr = addr & ~pint_t{7}; + const auto sigsetAddr = reinterpret_cast(alignedAddr); + // We have to check that addr is nullptr because sigprocmask allows that + // as an argument without failure. + if (!sigsetAddr) +return false; + + // We MUST use the raw sigprocmask syscall here, as wrappers may try to + // access sigsetAddr which may cause a SIGSEGV. The raw syscall however is + // safe. Additionally, we need to pass the kernel_sigset_size, which is + // different from libc sizeof(sigset_t). Some archs have sigset_t + // defined as unsigned long, so let's use that. + const auto approxKernelSigsetSize = sizeof(unsigned long); + [[maybe_unused]] const int Result = + syscall(SYS_rt_sigprocmask, /*how=*/~0, sigsetAddr, sigsetAddr, arichardson wrote: The check for valid `how` happens first (https://elixir.bootlin.com/linux/v6.6.7/source/kernel/signal.c#L3184) so we get EINVAL before this is checked. However, I agree there is no need to pass this argument. https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [libunwind] [clang-tools-extra] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
@@ -2817,7 +2817,7 @@ bool UnwindCursor::setInfoForSigReturn(Registers_s390x &) { const pint_t pc = static_cast(this->getReg(UNW_REG_IP)); // The PC might contain an invalid address if the unwind info is bad, so // directly accessing it could cause a SIGSEGV. - if (!isReadableAddr(pc) || !isReadableAddr(pc + 2)) + if (!isReadableAddr(pc)) arichardson wrote: We might get a false-negative `return false` here if the instruction happens to be the last four bytes before the end of the page boundary but I don't think it it matters. https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][WebAssembly] Don't build libunwind.cpp (PR #73196)
https://github.com/arichardson requested changes to this pull request. The commit message is slightly misleading, it appears there are some parts of the file that are actually used? https://github.com/llvm/llvm-project/pull/73196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][WebAssembly] Don't build libunwind.cpp (PR #73196)
arichardson wrote: > The commit message is slightly misleading, it appears there are some parts of > the file that are actually used? Other than this, the change looks good to me. https://github.com/llvm/llvm-project/pull/73196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][CodeGen] Emit atomic IR instead of libcalls for misaligned po… (PR #73176)
arichardson wrote: When I first came across this code I found it quite surprising that both clang and LLVM need handling for atomic libcalls. I feel it would be a lot nicer if this could all be handled inside the LLVM backend logic. Would it also be possible to emit the unoptimized libcall from LLVM instead of Clang and always emit the atomic IR operation and let the backend deal with lowering or am I missing something? https://github.com/llvm/llvm-project/pull/73176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][WebAssembly] Don't build libunwind.cpp (PR #73196)
arichardson wrote: > > The commit message is slightly misleading, it appears there are some parts > > of the file that are actually used? > > As the commit message says, we only use > https://github.com/llvm/llvm-project/blob/main/libunwind/src/Unwind-wasm.c > and not libunwind.cpp. We don't use any parts of libunwind.cpp. Do you have > any suggestions on how to improve the message to make it clearer? Looking at the file, there is some code that will still be compiled for wasm (at least for debug builds). If those functions are also not used for wasm they should be ifdef'd out as well? Commit message could be something like `Omit unused parts of libunwind.cpp for WASM`. https://github.com/llvm/llvm-project/pull/73196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][WebAssembly] Omit unused parts of libunwind.cpp for Wasm (PR #73196)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/73196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libunwind] [clang-tools-extra] [llvm] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
https://github.com/arichardson approved this pull request. Just one question otherwise this looks good to me. https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [libunwind] [clang-tools-extra] [clang] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
@@ -2974,6 +2966,37 @@ bool UnwindCursor::getFunctionName(char *buf, size_t bufLen, buf, bufLen, offset); } +#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +template +bool UnwindCursor::isReadableAddr(const pint_t addr) const { + // This code is heavily based on Abseil's 'address_is_readable.cc', + // which is Copyright Abseil Authors (2017). + + const auto sigsetAddr = reinterpret_cast(addr); + // We have to check that addr is nullptr because sigprocmask allows that + // as an argument without failure. + if (!sigsetAddr) +return false; + // We MUST use a raw syscall here, as wrappers may try to access + // sigsetAddr which may cause a SIGSEGV. A raw syscall however is + // safe. Additionally, we need to pass the kernel_sigset_size, which is + // different from libc sizeof(sigset_t). For the majority of architectures, + // it's 64 bits (_NSIG), and libc NSIG is _NSIG + 1. + const auto kernelSigsetSize = NSIG / 8; + const int Result = syscall(SYS_rt_sigprocmask, /*how=*/~0, sigsetAddr, + nullptr, kernelSigsetSize); + (void)Result; + // Because our "how" is invalid, this syscall should always fail, and our + // errno should always be EINVAL or an EFAULT. EFAULT is not guaranteed + // by the POSIX standard. Additionally, this relies on the Linux kernel + // to check copy_from_user before checking if the "how" argument is + // invalid. + assert(Result == -1); + assert(errno == EFAULT || errno == EINVAL); + return errno != EFAULT; arichardson wrote: Do we need to save+restore errno? Or is libunwind free to modify errno? https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-tools-extra] [libunwind] [llvm] [libunwind] Replace process_vm_readv with SYS_rt_sigprocmask (PR #74791)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/74791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Differentiate between identifier and string EnumArgument (PR #68550)
@@ -886,7 +893,7 @@ def ARMInterrupt : InheritableAttr, TargetSpecificAttr { // MSP430Interrupt's, MipsInterrupt's and AnyX86Interrupt's spellings // must match. let Spellings = [GCC<"interrupt">]; - let Args = [EnumArgument<"Interrupt", "InterruptType", + let Args = [EnumArgument<"Interrupt", "InterruptType", /*is_string=*/true, arichardson wrote: That makes sense - silent downstream breakage is not nice. I guess the other option would be to also use named arguments for `values` and/or `enums` but that will make the diff a bit larger. https://github.com/llvm/llvm-project/pull/68550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Add length info for dynamic .eh_frame registration (PR #77185)
https://github.com/arichardson commented: While I think this is a reasonable change, I don't think we can change this function signature without breaking the ABI. So it probably needs to be a new function instead. https://github.com/llvm/llvm-project/pull/77185 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Convert a few options from CACHE PATH to CACHE STRING (PR #77534)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/77534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [llvm] [libcxxabi] [libclc] [libcxx] [flang] [clang] [libunwind] [compiler-rt] [libc] [lld] [lldb] [builtins] Generate __multc3 for z/OS (PR #77554)
@@ -374,10 +376,10 @@ static __inline fp_t __compiler_rt_fmax(fp_t x, fp_t y) { #endif } -#elif defined(QUAD_PRECISION) && defined(CRT_HAS_TF_MODE) +#elif defined(QUAD_PRECISION) // The generic implementation only works for ieee754 floating point. For other // floating point types, continue to rely on the libm implementation for now. -#if defined(CRT_HAS_IEEE_TF) +#if defined(CRT_HAS_TF_MODE) && defined(CRT_HAS_IEEE_TF) arichardson wrote: ```suggestion #if defined(CRT_HAS_IEEE_TF) && defined(CRT_HAS_128BIT) ``` https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libc] [lldb] [clang-tools-extra] [libclc] [llvm] [libunwind] [clang] [lld] [compiler-rt] [libcxx] [libcxxabi] [flang] [builtins] Generate __multc3 for z/OS (PR #77554)
@@ -189,11 +189,15 @@ typedef long double tf_float; #define CRT_LDBL_IEEE_F128 #endif #define TF_C(x) x##L -#elif __LDBL_MANT_DIG__ == 113 -// Use long double instead of __float128 if it matches the IEEE 128-bit format. +#elif __LDBL_MANT_DIG__ == 113 || \ +(__FLT_RADIX__ == 16 && __LDBL_MANT_DIG__ == 28) +// Use long double instead of __float128 if it matches the IEEE 128-bit format +// or the IBM hexadecimal format. #define CRT_LDBL_128BIT +#if __LDBL_MANT_DIG__ == 113 #define CRT_HAS_F128 #define CRT_HAS_IEEE_TF +#endif #define CRT_LDBL_IEEE_F128 arichardson wrote: ```suggestion #define CRT_LDBL_128BIT #define CRT_HAS_F128 #if __LDBL_MANT_DIG__ == 113 #define CRT_HAS_IEEE_TF #define CRT_LDBL_IEEE_F128 #endif ``` I was suggesting to not define the tf_float is IEEE macros, CRT_HAS_F128 should still be set since we do have a 128-bit floating point type. https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [libunwind] [compiler-rt] [lld] [clang-tools-extra] [libc] [flang] [libcxx] [clang] [lldb] [libclc] [libcxxabi] [builtins] Generate __multc3 for z/OS (PR #77554)
@@ -15,8 +15,6 @@ #include "int_lib.h" #include "int_math.h" -#if defined(CRT_HAS_TF_MODE) arichardson wrote: I'm not sure if we support architectures without a "tf" floating point type. To be safe I believe we still need a guard here since this file is compiled unconditionally. We just have to replace it with "CRT_HAS_F128". A nice future cleanup would be to change CRT_HAS_TF_MODE to actually mean tf_float exists and explicitly guard for INT128 where needed. But that is a larger cleanup that probably shouldn't be part of this PR. https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[flang] [clang-tools-extra] [lld] [llvm] [libcxx] [compiler-rt] [clang] [libcxxabi] [libc] [libunwind] [lldb] [libclc] [builtins] Generate __multc3 for z/OS (PR #77554)
@@ -13,8 +13,6 @@ #define QUAD_PRECISION #include "fp_lib.h" -#if defined(CRT_HAS_TF_MODE) arichardson wrote: I'd suggest replacing this with CRT_HAS_F128 as noted below (unless you're will to audit all current uses of CRT_HAS_TF_MODE since that currently is a proxy for TF_MODE&&INT128 rather than just TF_MODE). https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [CodeGen][LLVM] Make the `va_list` related intrinsics generic. (PR #85460)
https://github.com/arichardson commented: Thanks, this looks great once all of @jrtc27's comments have been addressed. https://github.com/llvm/llvm-project/pull/85460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Tweak tests for musl support. (PR #85097)
@@ -11,20 +11,27 @@ // Basic test for float registers number are accepted. -#include #include #include #include +// Using __attribute__((section("main_func"))) is Linux specific, but then arichardson wrote: Nit: This is not specific to Linux it is specific to the behaviour of ELF linkers that automatically create these symbols for sections that are valid C identifiers. https://github.com/llvm/llvm-project/pull/85097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [CodeGen][LLVM] Make the `va_list` related intrinsics generic. (PR #85460)
@@ -792,13 +792,14 @@ EncompassingIntegerType(ArrayRef Types) { Value *CodeGenFunction::EmitVAStartEnd(Value *ArgValue, bool IsStart) { Intrinsic::ID inst = IsStart ? Intrinsic::vastart : Intrinsic::vaend; - return Builder.CreateCall(CGM.getIntrinsic(inst), ArgValue); + return Builder.CreateCall(CGM.getIntrinsic(inst, {ArgValue->getType()}), +ArgValue); } /// Checks if using the result of __builtin_object_size(p, @p From) in place of /// __builtin_object_size(p, @p To) is correct static bool areBOSTypesCompatible(int From, int To) { - // Note: Our __builtin_object_size implementation currently treats Type=0 and + // Note: Our __builtin_object_size implementation currently treats Type=0 andV arichardson wrote: ```suggestion // Note: Our __builtin_object_size implementation currently treats Type=0 and ``` typo https://github.com/llvm/llvm-project/pull/85460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [CodeGen][LLVM] Make the `va_list` related intrinsics generic. (PR #85460)
https://github.com/arichardson approved this pull request. LGTM thanks! Please wait for @jrtc27 to also approve before committing though. https://github.com/llvm/llvm-project/pull/85460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [CodeGen][LLVM] Make the `va_list` related intrinsics generic. (PR #85460)
arichardson wrote: CI looks unhappy, mlir also seems to need updates: MLIR :: Target/LLVMIR/llvmir.mlir MLIR :: mlir-cpu-runner/x86-varargs.mlir https://github.com/llvm/llvm-project/pull/85460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Compile the asm as well as the C++ source (PR #86351)
arichardson wrote: It might make sense to restore the `message(FATAL_ERROR)` since that is any easy mistake to make considering it used to be the default way of building libunwind. https://github.com/llvm/llvm-project/pull/86351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [mlir] [CodeGen][LLVM] Make the `va_list` related intrinsics generic. (PR #85460)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/85460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [NVPTX][AMDGPU][CodeGen] Fix `local_space nullptr` handling for NVPTX and local/private `nullptr` value for AMDGPU. (PR #78759)
@@ -0,0 +1,122 @@ +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s +void bar(int &Data) {} +// CHECK-DAG: define dso_local void @[[RAW_REF:[a-zA-Z0-9_]+]](ptr noundef nonnull align 4 dereferenceable(4) % +void bar2(int &Data) {} +// CHECK-DAG: define dso_local void @[[RAW_REF2:[a-zA-Z0-9_]+]](ptr noundef nonnull align 4 dereferenceable(4) % +void bar(__attribute__((opencl_local)) int &Data) {} +// CHECK-DAG: define dso_local void @[[LOCAL_REF:[a-zA-Z0-9_]+]](ptr addrspace(3) noundef align 4 dereferenceable(4) % +void foo(int *Data) {} +// CHECK-DAG: define dso_local void @[[RAW_PTR:[a-zA-Z0-9_]+]](ptr noundef % +void foo2(int *Data) {} +// CHECK-DAG: define dso_local void @[[RAW_PTR2:[a-zA-Z0-9_]+]](ptr noundef % +void foo(__attribute__((opencl_local)) int *Data) {} +// CHECK-DAG: define dso_local void @[[LOC_PTR:[a-zA-Z0-9_]+]](ptr addrspace(3) noundef % + +template +void tmpl(T t); +// See Check Lines below. + +void usages() { + __attribute__((opencl_global)) int *GLOB; + // CHECK-DAG: [[GLOB:%[a-zA-Z0-9]+]] = alloca ptr addrspace(1), align 8 + __attribute__((opencl_local)) int *LOC; + // CHECK-DAG: [[LOC:%[a-zA-Z0-9]+]] = alloca ptr addrspace(3), align 8 + LOC = nullptr; + // CHECK-DAG: store ptr addrspace(3) addrspacecast (ptr null to ptr addrspace(3)), ptr [[LOC]], align 8 + GLOB = nullptr; + // CHECK-DAG: store ptr addrspace(1) null, ptr [[GLOB]], align 8 + int *NoAS; + // CHECK-DAG: [[NoAS:%[a-zA-Z0-9]+]] = alloca ptr, align 8 + __attribute__((opencl_private)) int *PRIV; + // CHECK-DAG: [[PRIV:%[a-zA-Z0-9]+]] = alloca ptr, align 8 + __attribute__((opencl_global_device)) int *GLOBDEVICE; + // CHECK-DAG: [[GLOB_DEVICE:%[a-zA-Z0-9]+]] = alloca ptr addrspace(1), align 8 + __attribute__((opencl_global_host)) int *GLOBHOST; + // CHECK-DAG: [[GLOB_HOST:%[a-zA-Z0-9]+]] = alloca ptr addrspace(1), align 8 + NoAS = (int *)GLOB; + // CHECK-DAG: [[GLOB_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(1), ptr [[GLOB]], align 8 + // CHECK-DAG: [[GLOB_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr addrspace(1) [[GLOB_LOAD]] to ptr + // CHECK-DAG: store ptr [[GLOB_CAST]], ptr [[NoAS]], align 8 + NoAS = (int *)LOC; + // CHECK-DAG: [[LOC_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(3), ptr [[LOC]], align 8 + // CHECK-DAG: [[LOC_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr addrspace(3) [[LOC_LOAD]] to ptr + // CHECK-DAG: store ptr [[LOC_CAST]], ptr [[NoAS]], align 8 + NoAS = (int *)PRIV; + // CHECK-DAG: [[LOC_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[PRIV]], align 8 + // CHECK-DAG: store ptr [[LOC_LOAD]], ptr [[NoAS]], align 8 + GLOB = (__attribute__((opencl_global)) int *)NoAS; + // CHECK-DAG: [[NoAS_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[NoAS]], align 8 + // CHECK-DAG: [[NoAS_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr [[NoAS_LOAD]] to ptr addrspace(1) + // CHECK-DAG: store ptr addrspace(1) [[NoAS_CAST]], ptr [[GLOB]], align 8 + LOC = (__attribute__((opencl_local)) int *)NoAS; + // CHECK-DAG: [[NoAS_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[NoAS]], align 8 + // CHECK-DAG: [[NoAS_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr [[NoAS_LOAD]] to ptr addrspace(3) + // CHECK-DAG: store ptr addrspace(3) [[NoAS_CAST]], ptr [[LOC]], align 8 + PRIV = (__attribute__((opencl_private)) int *)NoAS; + // CHECK-DAG: [[NoAS_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[NoAS]], align 8 + // CHECK-DAG: store ptr [[NoAS_LOAD]], ptr [[PRIV]], align 8 + GLOB = (__attribute__((opencl_global)) int *)GLOBDEVICE; + // CHECK-DAG: [[GLOBDEVICE_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(1), ptr [[GLOB_DEVICE]], align 8 + // CHECK-DAG: store ptr addrspace(1) [[GLOBDEVICE_LOAD]], ptr %GLOB, align 8 + GLOB = (__attribute__((opencl_global)) int *)GLOBHOST; + // CHECK-DAG: [[GLOB_HOST_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(1), ptr [[GLOB_HOST]], align 8 + // CHECK-DAG: store ptr addrspace(1) [[GLOB_HOST_LOAD]], ptr [[GLOB]], align 8 + bar(*GLOB); arichardson wrote: Why are all these CHECK lines using CHECK-DAG? I would not expect them to be reordered, so `CHECK:` should work just fine? https://github.com/llvm/llvm-project/pull/78759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [NVPTX][AMDGPU][CodeGen] Fix `local_space nullptr` handling for NVPTX and local/private `nullptr` value for AMDGPU. (PR #78759)
@@ -285,6 +289,20 @@ void NVPTXTargetCodeGenInfo::addNVVMMetadata(llvm::GlobalValue *GV, bool NVPTXTargetCodeGenInfo::shouldEmitStaticExternCAliases() const { return false; } + +llvm::Constant * +NVPTXTargetCodeGenInfo::getNullPointer(const CodeGen::CodeGenModule &CGM, + llvm::PointerType *PT, + QualType QT) const { + auto &Ctx = CGM.getContext(); + if (PT->getAddressSpace() != Ctx.getTargetAddressSpace(LangAS::opencl_local)) +return llvm::ConstantPointerNull::get(PT); + + auto NPT = llvm::PointerType::get( + PT->getContext(), Ctx.getTargetAddressSpace(LangAS::opencl_generic)); + return llvm::ConstantExpr::getAddrSpaceCast( + llvm::ConstantPointerNull::get(NPT), PT); +} arichardson wrote: As far as I can tell the reason for the AMDGPU code using an addrspacecast is the following comment `// Currently LLVM assumes null pointers always have value 0, which results in incorrectly transformed IR.` so it can't use a `null` literal for all ones. Looking at the lang-ref I can't actually see anywhere that `ptr addrspace(X) null` is the zero value, so this should probably be clarified in the lagref: https://llvm.org/docs/LangRef.html#t-pointer https://github.com/llvm/llvm-project/pull/78759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [NVPTX][AMDGPU][CodeGen] Fix `local_space nullptr` handling for NVPTX and local/private `nullptr` value for AMDGPU. (PR #78759)
@@ -285,6 +289,20 @@ void NVPTXTargetCodeGenInfo::addNVVMMetadata(llvm::GlobalValue *GV, bool NVPTXTargetCodeGenInfo::shouldEmitStaticExternCAliases() const { return false; } + +llvm::Constant * +NVPTXTargetCodeGenInfo::getNullPointer(const CodeGen::CodeGenModule &CGM, + llvm::PointerType *PT, + QualType QT) const { + auto &Ctx = CGM.getContext(); + if (PT->getAddressSpace() != Ctx.getTargetAddressSpace(LangAS::opencl_local)) +return llvm::ConstantPointerNull::get(PT); + + auto NPT = llvm::PointerType::get( + PT->getContext(), Ctx.getTargetAddressSpace(LangAS::opencl_generic)); + return llvm::ConstantExpr::getAddrSpaceCast( + llvm::ConstantPointerNull::get(NPT), PT); +} arichardson wrote: Agreed. I believe that right now some LLVM passes assume a `null` constant is all zeroes, even though LangRef does not specify it so we need to either document those semantics or add a property to the data layout. https://github.com/llvm/llvm-project/pull/78759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [NVPTX][AMDGPU][CodeGen] Fix `local_space nullptr` handling for NVPTX and local/private `nullptr` value for AMDGPU. (PR #78759)
@@ -0,0 +1,122 @@ +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s +void bar(int &Data) {} +// CHECK-DAG: define dso_local void @[[RAW_REF:[a-zA-Z0-9_]+]](ptr noundef nonnull align 4 dereferenceable(4) % +void bar2(int &Data) {} +// CHECK-DAG: define dso_local void @[[RAW_REF2:[a-zA-Z0-9_]+]](ptr noundef nonnull align 4 dereferenceable(4) % +void bar(__attribute__((opencl_local)) int &Data) {} +// CHECK-DAG: define dso_local void @[[LOCAL_REF:[a-zA-Z0-9_]+]](ptr addrspace(3) noundef align 4 dereferenceable(4) % +void foo(int *Data) {} +// CHECK-DAG: define dso_local void @[[RAW_PTR:[a-zA-Z0-9_]+]](ptr noundef % +void foo2(int *Data) {} +// CHECK-DAG: define dso_local void @[[RAW_PTR2:[a-zA-Z0-9_]+]](ptr noundef % +void foo(__attribute__((opencl_local)) int *Data) {} +// CHECK-DAG: define dso_local void @[[LOC_PTR:[a-zA-Z0-9_]+]](ptr addrspace(3) noundef % + +template +void tmpl(T t); +// See Check Lines below. + +void usages() { + __attribute__((opencl_global)) int *GLOB; + // CHECK-DAG: [[GLOB:%[a-zA-Z0-9]+]] = alloca ptr addrspace(1), align 8 + __attribute__((opencl_local)) int *LOC; + // CHECK-DAG: [[LOC:%[a-zA-Z0-9]+]] = alloca ptr addrspace(3), align 8 + LOC = nullptr; + // CHECK-DAG: store ptr addrspace(3) addrspacecast (ptr null to ptr addrspace(3)), ptr [[LOC]], align 8 + GLOB = nullptr; + // CHECK-DAG: store ptr addrspace(1) null, ptr [[GLOB]], align 8 + int *NoAS; + // CHECK-DAG: [[NoAS:%[a-zA-Z0-9]+]] = alloca ptr, align 8 + __attribute__((opencl_private)) int *PRIV; + // CHECK-DAG: [[PRIV:%[a-zA-Z0-9]+]] = alloca ptr, align 8 + __attribute__((opencl_global_device)) int *GLOBDEVICE; + // CHECK-DAG: [[GLOB_DEVICE:%[a-zA-Z0-9]+]] = alloca ptr addrspace(1), align 8 + __attribute__((opencl_global_host)) int *GLOBHOST; + // CHECK-DAG: [[GLOB_HOST:%[a-zA-Z0-9]+]] = alloca ptr addrspace(1), align 8 + NoAS = (int *)GLOB; + // CHECK-DAG: [[GLOB_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(1), ptr [[GLOB]], align 8 + // CHECK-DAG: [[GLOB_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr addrspace(1) [[GLOB_LOAD]] to ptr + // CHECK-DAG: store ptr [[GLOB_CAST]], ptr [[NoAS]], align 8 + NoAS = (int *)LOC; + // CHECK-DAG: [[LOC_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(3), ptr [[LOC]], align 8 + // CHECK-DAG: [[LOC_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr addrspace(3) [[LOC_LOAD]] to ptr + // CHECK-DAG: store ptr [[LOC_CAST]], ptr [[NoAS]], align 8 + NoAS = (int *)PRIV; + // CHECK-DAG: [[LOC_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[PRIV]], align 8 + // CHECK-DAG: store ptr [[LOC_LOAD]], ptr [[NoAS]], align 8 + GLOB = (__attribute__((opencl_global)) int *)NoAS; + // CHECK-DAG: [[NoAS_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[NoAS]], align 8 + // CHECK-DAG: [[NoAS_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr [[NoAS_LOAD]] to ptr addrspace(1) + // CHECK-DAG: store ptr addrspace(1) [[NoAS_CAST]], ptr [[GLOB]], align 8 + LOC = (__attribute__((opencl_local)) int *)NoAS; + // CHECK-DAG: [[NoAS_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[NoAS]], align 8 + // CHECK-DAG: [[NoAS_CAST:%[a-zA-Z0-9]+]] = addrspacecast ptr [[NoAS_LOAD]] to ptr addrspace(3) + // CHECK-DAG: store ptr addrspace(3) [[NoAS_CAST]], ptr [[LOC]], align 8 + PRIV = (__attribute__((opencl_private)) int *)NoAS; + // CHECK-DAG: [[NoAS_LOAD:%[a-zA-Z0-9]+]] = load ptr, ptr [[NoAS]], align 8 + // CHECK-DAG: store ptr [[NoAS_LOAD]], ptr [[PRIV]], align 8 + GLOB = (__attribute__((opencl_global)) int *)GLOBDEVICE; + // CHECK-DAG: [[GLOBDEVICE_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(1), ptr [[GLOB_DEVICE]], align 8 + // CHECK-DAG: store ptr addrspace(1) [[GLOBDEVICE_LOAD]], ptr %GLOB, align 8 + GLOB = (__attribute__((opencl_global)) int *)GLOBHOST; + // CHECK-DAG: [[GLOB_HOST_LOAD:%[a-zA-Z0-9]+]] = load ptr addrspace(1), ptr [[GLOB_HOST]], align 8 + // CHECK-DAG: store ptr addrspace(1) [[GLOB_HOST_LOAD]], ptr [[GLOB]], align 8 + bar(*GLOB); arichardson wrote: Thanks. I think it would also be good to update clang/test/CodeGenSYCL/address-space-conversions.cpp as a NFC commit and rebase this PR on top of that. https://github.com/llvm/llvm-project/pull/78759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] Use relative includes to allow source-based dependencies without `-I` (PR #80443)
https://github.com/arichardson commented: It does seem like all other libunwind sources use `#include "` to find headers that are part of libunwind, so I think doing it for the includes that are installed should also be fine. I don't think installing these headers into separate directories and adding custom -isystem flags is a supported build configuration. It will also ensure that we always pick the matching header rather than one that happens to come first in the include order. https://github.com/llvm/llvm-project/pull/80443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-tools-extra] [compiler-rt] [flang] [libclc] [libcxx] [lld] [lldb] [llvm] [NFC] Remove trailing whitespace across all non-test related files (PR #82838)
arichardson wrote: This will cause huge merge conflicts for all downstreams. While they are easy to resolve it can be quite annoying. I think we should just do this as part of the global clang-format. https://github.com/llvm/llvm-project/pull/82838 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][CodeGen] Emit atomic IR in place of optimized libcalls. (PR #73176)
@@ -33,9 +33,9 @@ void test_i32_atomics(_Atomic(int32_t) * a, int32_t b) { } void test_i64_atomics(_Atomic(int64_t) * a, int64_t b) { - // LA32: call i64 @__atomic_load_8 - // LA32: call void @__atomic_store_8 - // LA32: call i64 @__atomic_fetch_add_8 + // LA32: load atomic i64, ptr %a seq_cst, align 8 + // LA32: store atomic i64 %b, ptr %a seq_cst, align 8 + // LA32: atomicrmw add ptr %a, i64 %b seq_cst // LA64: load atomic i64, ptr %a seq_cst, align 8 // LA64: store atomic i64 %b, ptr %a seq_cst, align 8 // LA64: atomicrmw add ptr %a, i64 %b seq_cst arichardson wrote: Also missing alignment here https://github.com/llvm/llvm-project/pull/73176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[compiler-rt] [libcxxabi] [lld] [lldb] [clang] [llvm] [libc] [libclc] [libunwind] [libcxx] [clang-tools-extra] [flang] [builtins] Generate __multc3 for z/OS (PR #77554)
https://github.com/arichardson approved this pull request. Thanks this looks good to me now and should not change anything for other targets. https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[compiler-rt] [lld] [clang-tools-extra] [libclc] [llvm] [libcxx] [libcxxabi] [lldb] [flang] [libc] [libunwind] [clang] [builtins] Generate __multc3 for z/OS (PR #77554)
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang-tools-extra] [libclc] [libc] [lld] [lldb] [clang] [libcxx] [libcxxabi] [flang] [libunwind] [compiler-rt] [builtins] Generate __multc3 for z/OS (PR #77554)
@@ -374,10 +376,10 @@ static __inline fp_t __compiler_rt_fmax(fp_t x, fp_t y) { #endif } -#elif defined(QUAD_PRECISION) && defined(CRT_HAS_TF_MODE) +#elif defined(QUAD_PRECISION) arichardson wrote: Looks like this was actually required. Probably needs to be changed to `#elif defined(QUAD_PRECISION) && defined(CRT_HAS_F128)`. @perry-ca Could you open a new PR with this change? See https://github.com/llvm/llvm-project/issues/77898 and https://github.com/llvm/llvm-project/issues/77880 https://github.com/llvm/llvm-project/pull/77554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Move errno.h and signal.h includes under the block where they're needed (PR #78054)
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/78054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][CodeGen] Emit atomic IR in place of optimized libcalls. (PR #73176)
https://github.com/arichardson commented: Overall this looks great to me, very happy to see reduced duplication between clang and llvm. It would be great if we could just emit the atomic IR in all cases but unfortunately non-power-of-two sizes result in a verifier error. We could probably emit the atomic IR for power-of-two sizes and let the expand pass deal with it but since we still need the fallback for other sizes we might as well keep it. https://github.com/llvm/llvm-project/pull/73176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix running tests with MSan (PR #67860)
@@ -43,6 +43,12 @@ #define LIBUNWIND_AVAIL #endif +#if defined(__SANITIZE_MEMORY__) || \ arichardson wrote: Ah I assumed it was needed for GCC since it doesn't have __has_feature(). https://github.com/llvm/llvm-project/pull/67860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Fix running tests with MSan (PR #67860)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/67860 >From e39c568ba557fbca5d3ef17f3d4f4d74f15e8205 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 29 Sep 2023 13:25:39 -0700 Subject: [PATCH 1/2] [libunwind] Fix running tests with MSan In order to run tests with MSan we have silence two false-positives: First, we have to tell the runtime that __unw_getcontext actually populates the buffer with initialized data. Ideally we would call __msan_unpoison directly from __unw_getcontext, but this would require adding assembly calls for all possible configurations which is rather error prone. We also can't implement __unw_getcontext as a C function that calls into the assembly code since that would result in potentially incorrect register values being saved. Instead, use a wrapper macro that calls __msan_unpoison directly after __unw_getcontext. And second, MSan does not intercept _dl_find_object, so we initialize the struct to zero before calling _dl_find_object. These two changes are sufficient to make the whole test suite pass my x86_64 Linux system. --- libunwind/include/libunwind.h| 18 ++ libunwind/src/AddressSpace.hpp | 3 +++ libunwind/src/libunwind_ext.h| 10 ++ libunwind/test/bad_unwind_info.pass.cpp | 3 --- libunwind/test/forceunwind.pass.cpp | 3 --- libunwind/test/libunwind_01.pass.cpp | 3 --- libunwind/test/libunwind_02.pass.cpp | 3 --- libunwind/test/remember_state_leak.pass.sh.s | 3 --- libunwind/test/signal_frame.pass.cpp | 3 --- libunwind/test/signal_unwind.pass.cpp| 3 --- libunwind/test/unw_resume.pass.cpp | 3 --- libunwind/test/unwind_leaffunction.pass.cpp | 3 --- 12 files changed, 31 insertions(+), 27 deletions(-) diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h index b2dae8feed9a3b5..a1b02c07a2c79e3 100644 --- a/libunwind/include/libunwind.h +++ b/libunwind/include/libunwind.h @@ -43,6 +43,12 @@ #define LIBUNWIND_AVAIL #endif +#if defined(__SANITIZE_MEMORY__) || \ +(defined(__has_feature) && __has_feature(memory_sanitizer)) +#define LIBUNWIND_HAVE_MSAN +#include +#endif + #if defined(_WIN32) && defined(__SEH__) #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16))) #else @@ -115,6 +121,18 @@ extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL; extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL; +#ifdef LIBUNWIND_HAVE_MSAN +// unw_getcontext is implemented in assembly so it is rather difficult to +// mark the MSan shadow as initialized from within the function. Instead we +// use a macro wrapper when compiling with MSan to avoid false-positives. +#define unw_getcontext(context) \ + ({ \ +int _result = (unw_getcontext)(context); \ +__msan_unpoison((context), sizeof(unw_context_t)); \ +_result; \ + }) +#endif + #ifdef __arm__ /* Save VFP registers in FSTMX format (instead of FSTMD). */ extern void unw_save_vfp_as_X(unw_cursor_t *) LIBUNWIND_AVAIL; diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp index 1abbc822546878d..f3e625037a64c57 100644 --- a/libunwind/src/AddressSpace.hpp +++ b/libunwind/src/AddressSpace.hpp @@ -621,6 +621,9 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr, } // Try to find the unwind info using `dl_find_object` dl_find_object findResult; + // _dl_find_object should fully initialize this struct, but we zero it to + // be safe in case this is not true (and to keep MSan quite). + memset(&findResult, 0, sizeof(findResult)); if (dlFindObject && dlFindObject((void *)targetAddr, &findResult) == 0) { if (findResult.dlfo_eh_frame == nullptr) { // Found an entry for `targetAddr`, but there is no unwind info. diff --git a/libunwind/src/libunwind_ext.h b/libunwind/src/libunwind_ext.h index 28db43a4f6eef20..d55d906ea1a066c 100644 --- a/libunwind/src/libunwind_ext.h +++ b/libunwind/src/libunwind_ext.h @@ -32,6 +32,16 @@ extern int __unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t); extern int __unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t); extern int __unw_resume(unw_cursor_t *); +#ifdef LIBUNWIND_HAVE_MSAN +// See comment above unw_getcontext (libunwind.h) for why this is needed. +#define __unw_getcontext(context) \ + ({ \ +int _result = (__unw_getcontext)(context);
[libunwind] [libunwind][test] Avoid calling back into libunwind on sanitizer errors (PR #67861)
@@ -28,6 +28,14 @@ if @LIBUNWIND_USES_ARM_EHABI@: if not @LIBUNWIND_ENABLE_THREADS@: config.available_features.add('libunwind-no-threads') +config.extra_executor_env = "" arichardson wrote: Agreed that would be way better, I'll see if I can get back to this at some point soon. https://github.com/llvm/llvm-project/pull/67861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][test] Avoid calling back into libunwind on sanitizer errors (PR #67861)
https://github.com/arichardson converted_to_draft https://github.com/llvm/llvm-project/pull/67861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests (PR #67201)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/67201 >From 6d650b781080d46ccae02793529cf63b18859f3f Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 6 Sep 2023 11:41:56 -0700 Subject: [PATCH 1/4] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests There is currently only limited support for passing target-specific flags (e.g. -mabi= or -march=) to the testsuites if you don't have a compiler (or wrapper script) that defaults to the expected flags. However, some targets (e.g. RISC-V) may require additional flags beyond the basic --target= that is already added by the current infrastructure. When cross-compiling with CMake, the recommended approach is to define a toolchain file that specifies the necessary flags needed to compile for a given target. There are two interesting variables here that we should also be passing when building the test binaries: - CMAKE_CXX_FLAGS_INIT defines the flags we need for compilation jobs and will specify flags such as -mabi= and -march= - CMAKE_EXE_LINKER_FLAGS_INIT defines the linker flags that are needed to cross-compile for a given target. When not cross-compiling these variables will generally be empty. --- libcxx/test/configs/apple-libc++-backdeployment.cfg.in| 4 ++-- libcxx/test/configs/apple-libc++-shared.cfg.in| 4 ++-- libcxx/test/configs/ibm-libc++-shared.cfg.in | 4 ++-- libcxx/test/configs/llvm-libc++-mingw.cfg.in | 4 ++-- libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in | 4 ++-- libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in | 4 ++-- .../configs/llvm-libc++-shared-no-vcruntime-clangcl.cfg.in| 4 ++-- libcxx/test/configs/llvm-libc++-shared.cfg.in | 4 ++-- libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in | 4 ++-- libcxx/test/configs/llvm-libc++-static.cfg.in | 4 ++-- libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in | 4 ++-- libcxxabi/test/configs/apple-libc++abi-shared.cfg.in | 4 ++-- libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in| 4 ++-- libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-mingw.cfg.in| 4 ++-- libcxxabi/test/configs/llvm-libc++abi-shared-clangcl.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-static-clangcl.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-static.cfg.in | 4 ++-- libunwind/test/configs/apple-libunwind-backdeployment.cfg.in | 4 ++-- libunwind/test/configs/ibm-libunwind-shared.cfg.in| 4 ++-- libunwind/test/configs/llvm-libunwind-merged.cfg.in | 4 ++-- libunwind/test/configs/llvm-libunwind-mingw.cfg.in| 4 ++-- libunwind/test/configs/llvm-libunwind-shared.cfg.in | 4 ++-- libunwind/test/configs/llvm-libunwind-static.cfg.in | 4 ++-- 25 files changed, 50 insertions(+), 50 deletions(-) diff --git a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in index b471c02709c060f..374ad38247f9f1f 100644 --- a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in +++ b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in @@ -45,10 +45,10 @@ config.substitutions.append(('%{flags}', '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' )) config.substitutions.append(('%{compile_flags}', -'-nostdinc++ -I %{include} -I %{libcxx}/test/support' +'@CMAKE_CXX_FLAGS_INIT@ -nostdinc++ -I %{include} -I %{libcxx}/test/support' )) config.substitutions.append(('%{link_flags}', -'-nostdlib++ -L %{lib} -lc++' +'@CMAKE_EXE_LINKER_FLAGS_INIT@ -nostdlib++ -L %{lib} -lc++' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- ' diff --git a/libcxx/test/configs/apple-libc++-shared.cfg.in b/libcxx/test/configs/apple-libc++-shared.cfg.in index af1926e3859b9e5..0c664ad2cf65fa3 100644 --- a/libcxx/test/configs/apple-libc++-shared.cfg.in +++ b/libcxx/test/configs/apple-libc++-shared.cfg.in @@ -13,10 +13,10 @@ config.substitutions.append(('%{flags}', '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' )) config.substitutions.append(('%{compile_flags}', -'-nostdinc++ -I %{include} -I %{libcxx}/test/support' +'@CMAKE_CXX_FLAGS_INIT@ -nostdinc++ -I %{include} -I %{libcxx}/test/support' )) config.substitutions.append(('%{link_flags}', -'-nostdlib++ -L %{lib} -lc++' +'@CMAKE_EXE_LINKER_FLAGS_INIT@ -nostdlib++ -L %{lib} -lc++' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib} -- ' diff --git a/libcxx/test/configs/ibm-libc++-shared.cfg.in b/libcxx/test/configs/ibm-libc+
[libunwind] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests (PR #67201)
arichardson wrote: Debugging shows that the reason this is failing on the clang-cl bots is that the CMAKE_CXX_FLAGS_INIT are using the MSVC syntax but we pass --driver-mode=g++ explicitly: ``` lit: C:\ws\src\libcxx\utils\libcxx\test\format.py:55: note: Command ["'C:/Program Files/LLVM/bin/clang-cl.exe' -xc++ nul -Werror -fsyntax-only --driver-mode=g++ /DWIN32 /D_WINDOWS /EHsc -fms-runtime-lib=dll -nostdinc++ -I C:/ws/src/build/clang-cl-dll/include/c++/v1 -I C:/ws/src/build/clang-cl-dll/include/c++/v1 -I C:/ws/src/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++03"] failed with code 1: clang-cl: error: no such file or directory: '/DWIN32' -- Â | clang-cl: error: no such file or directory: '/D_WINDOWS' Â | clang-cl: error: no such file or directory: '/EHsc' ``` https://github.com/llvm/llvm-project/pull/67201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests (PR #67201)
@@ -45,10 +45,10 @@ config.substitutions.append(('%{flags}', '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' )) config.substitutions.append(('%{compile_flags}', -'-nostdinc++ -I %{include} -I %{libcxx}/test/support' +'@CMAKE_CXX_FLAGS_INIT@ -nostdinc++ -I %{include} -I %{libcxx}/test/support' arichardson wrote: My original approach was to add a target flag (https://github.com/llvm/llvm-project/pull/65517) but @ldionne wasn't keen on that approach. https://github.com/llvm/llvm-project/pull/67201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)
@@ -6411,6 +6411,40 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +if (isa(Op0) || isa(Op1)) + return PoisonValue::get(Op0->getType()); + +// NOTE: We can't apply this simplifications based on the value of Op1 +// because we need to preserve provenance. +if (Q.isUndefValue(Op0) || match(Op0, m_Zero())) + return Constant::getNullValue(Op0->getType()); + +if (Op1->getType()->getScalarSizeInBits() == arichardson wrote: I believe this branch can be replaced with assert(Op1->getType()->getScalarSizeInBits() == Q.DL.getPointerIndexSizeInBits(Op0->getType()) since the verified now ensures the argument matches the index size since #69343 https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)
@@ -6411,6 +6411,40 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +if (isa(Op0) || isa(Op1)) + return PoisonValue::get(Op0->getType()); + +// NOTE: We can't apply this simplifications based on the value of Op1 +// because we need to preserve provenance. +if (Q.isUndefValue(Op0) || match(Op0, m_Zero())) + return Constant::getNullValue(Op0->getType()); + +if (Op1->getType()->getScalarSizeInBits() == arichardson wrote: It is redundant since it does not affect more than the index bits (see clarification in the langref added in https://github.com/llvm/llvm-project/pull/69343) https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests (PR #67201)
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/67201 There is currently only limited support for passing target-specific flags (e.g. -mabi= or -march=) to the testsuites if you don't have a compiler (or wrapper script) that defaults to the expected flags. However, some targets (e.g. RISC-V) may require additional flags beyond the basic --target= that is already added by the current infrastructure. When cross-compiling with CMake, the recommended approach is to define a toolchain file that specifies the necessary flags needed to compile for a given target. There are two interesting variables here that we should also be passing when building the test binaries: - CMAKE_CXX_FLAGS_INIT defines the flags we need for compilation jobs and will specify flags such as -mabi= and -march= - CMAKE_EXE_LINKER_FLAGS_INIT defines the linker flags that are needed to cross-compile for a given target. When not cross-compiling these variables will generally be empty. This patch only adds these flags to the default libc++ configurations, but if the clang-cl/gcc configurations could also benefit from this I'll update the patch. This should be a possible alternative to https://reviews.llvm.org/D151056 and https://github.com/llvm/llvm-project/pull/65517 >From 72464ba171bc303f692f9a73012a4d1060ca0dda Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 6 Sep 2023 11:41:56 -0700 Subject: [PATCH] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests There is currently only limited support for passing target-specific flags (e.g. -mabi= or -march=) to the testsuites if you don't have a compiler (or wrapper script) that defaults to the expected flags. However, some targets (e.g. RISC-V) may require additional flags beyond the basic --target= that is already added by the current infrastructure. When cross-compiling with CMake, the recommended approach is to define a toolchain file that specifies the necessary flags needed to compile for a given target. There are two interesting variables here that we should also be passing when building the test binaries: - CMAKE_CXX_FLAGS_INIT defines the flags we need for compilation jobs and will specify flags such as -mabi= and -march= - CMAKE_EXE_LINKER_FLAGS_INIT defines the linker flags that are needed to cross-compile for a given target. When not cross-compiling these variables will generally be empty. This patch only adds these flags to the default libc++ configurations, but if the clang-cl/gcc configurations could also benefit from this I'll update the patch. --- libcxx/test/configs/llvm-libc++-shared.cfg.in | 4 ++-- libcxx/test/configs/llvm-libc++-static.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in | 4 ++-- libcxxabi/test/configs/llvm-libc++abi-static.cfg.in | 4 ++-- libunwind/test/configs/llvm-libunwind-merged.cfg.in | 4 ++-- libunwind/test/configs/llvm-libunwind-shared.cfg.in | 4 ++-- libunwind/test/configs/llvm-libunwind-static.cfg.in | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libcxx/test/configs/llvm-libc++-shared.cfg.in b/libcxx/test/configs/llvm-libc++-shared.cfg.in index 143b3b3feae1109..82e7129d8f166a0 100644 --- a/libcxx/test/configs/llvm-libc++-shared.cfg.in +++ b/libcxx/test/configs/llvm-libc++-shared.cfg.in @@ -7,10 +7,10 @@ config.substitutions.append(('%{flags}', '-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '') )) config.substitutions.append(('%{compile_flags}', -'-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support' +'@CMAKE_CXX_FLAGS_INIT@ -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support' )) config.substitutions.append(('%{link_flags}', -'-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++' +'@CMAKE_EXE_LINKER_FLAGS_INIT@ -nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T -- ' diff --git a/libcxx/test/configs/llvm-libc++-static.cfg.in b/libcxx/test/configs/llvm-libc++-static.cfg.in index e866d4f52a0629d..3dc4af1c000d59f 100644 --- a/libcxx/test/configs/llvm-libc++-static.cfg.in +++ b/libcxx/test/configs/llvm-libc++-static.cfg.in @@ -7,10 +7,10 @@ config.substitutions.append(('%{flags}', '-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '') )) config.substitutions.append(('%{compile_flags}', -'-nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support' +'@CMAKE_CXX_FLAGS_INIT@ -nostdinc++ -I %{include} -I %{target-include} -I %{libcxx}/test/support' )) config.substitutions.append(('%{link_flags}', -'-nostdlib++ -L %{lib} -lc++ -lc++abi' +'@CMAKE_EXE_LINKER_FLAGS_INIT@ -nostdlib++ -L %{lib} -lc++ -lc++abi' )) config.substitutions.append(('%{exec}', '%{executor} --execdir %T -- ' diff --git a/libcx
[libunwind] [libunwind] Pass -Wl,--export-dynamic on all supported platforms (PR #67205)
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/67205 I was trying to run the tests on FreeBSD and noticed that we weren't printing symbol names. It turns out this is because of the missing -Wl,--export dynamic flag. Instead of hardcoding the name of the flag and only passing it for Linux hosts, use a pre-existing CMake variable instead. I was not aware of this flag, but it appears to have been supported for the past 16 years (with support for more platforms added later): https://gitlab.kitware.com/cmake/cmake/-/commit/66d1930f5674f08e09f455b3f0777f2de3e0717e >From 6f459b7cf539c17192e765578ac9f938e4f3af3f Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 22 Sep 2023 16:11:49 -0700 Subject: [PATCH] [libunwind] Pass -Wl,--export-dynamic on all supported platforms I was trying to run the tests on FreeBSD and noticed that we weren't printing symbol names. It turns out this is because of the missing -Wl,--export dynamic flag. Instead of hardcoding the name of the flag and only passing it for Linux hosts, use a pre-existing CMake variable instead. I was not aware of this flag, but it appears to have been supported for the past 16 years (with support for more platforms added later): https://gitlab.kitware.com/cmake/cmake/-/commit/66d1930f5674f08e09f455b3f0777f2de3e0717e --- libunwind/test/configs/llvm-libunwind-merged.cfg.in | 6 -- libunwind/test/configs/llvm-libunwind-shared.cfg.in | 6 -- libunwind/test/configs/llvm-libunwind-static.cfg.in | 6 -- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libunwind/test/configs/llvm-libunwind-merged.cfg.in b/libunwind/test/configs/llvm-libunwind-merged.cfg.in index 10650f7edf66a2f..e6fafd1edd9756f 100644 --- a/libunwind/test/configs/llvm-libunwind-merged.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-merged.cfg.in @@ -11,8 +11,10 @@ link_flags = [] if @LIBUNWIND_ENABLE_CET@: compile_flags.append('-fcf-protection=full') -if '@CMAKE_SYSTEM_NAME@' == 'Linux': -link_flags.append('-Wl,--export-dynamic') +# Add -Wl,--export-dynamic if supported by the linker (this CMake variable will +# be empty for Apple platforms). +if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'): +link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@') if '@CMAKE_DL_LIBS@': link_flags.append('-l@CMAKE_DL_LIBS@') diff --git a/libunwind/test/configs/llvm-libunwind-shared.cfg.in b/libunwind/test/configs/llvm-libunwind-shared.cfg.in index 97185e57234ff7f..f2e98c7a388dd32 100644 --- a/libunwind/test/configs/llvm-libunwind-shared.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-shared.cfg.in @@ -10,8 +10,10 @@ link_flags = [] if @LIBUNWIND_ENABLE_CET@: compile_flags.append('-fcf-protection=full') -if '@CMAKE_SYSTEM_NAME@' == 'Linux': -link_flags.append('-Wl,--export-dynamic') +# Add -Wl,--export-dynamic if supported by the linker (this CMake variable will +# be empty for Apple platforms). +if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'): +link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@') if '@CMAKE_DL_LIBS@': link_flags.append('-l@CMAKE_DL_LIBS@') diff --git a/libunwind/test/configs/llvm-libunwind-static.cfg.in b/libunwind/test/configs/llvm-libunwind-static.cfg.in index fc6a18d057f3884..1fbdec249855d4a 100644 --- a/libunwind/test/configs/llvm-libunwind-static.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-static.cfg.in @@ -13,8 +13,10 @@ if @LIBUNWIND_ENABLE_THREADS@: if @LIBUNWIND_ENABLE_CET@: compile_flags.append('-fcf-protection=full') -if '@CMAKE_SYSTEM_NAME@' == 'Linux': -link_flags.append('-Wl,--export-dynamic') +# Add -Wl,--export-dynamic if supported by the linker (this CMake variable will +# be empty for Apple platforms). +if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'): +link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@') if '@CMAKE_DL_LIBS@': link_flags.append('-l@CMAKE_DL_LIBS@') ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests (PR #67201)
arichardson wrote: > Is there a reason why _all_ configurations shouldn't be doing this? I think it would be good if all of them did it, the reason I didn't is that I limited it to the ones I can test locally. Seeing as there is probably CI coverage for all of the configs, should I try updating the remaining ones? https://github.com/llvm/llvm-project/pull/67201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Pass -Wl,--export-dynamic on all supported platforms (PR #67205)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/67205 >From 27c0526c4b21e2b19eeeae3c23928421437b885a Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 22 Sep 2023 16:11:49 -0700 Subject: [PATCH] [libunwind] Pass -Wl,--export-dynamic on all supported platforms I was trying to run the tests on FreeBSD and noticed that we weren't printing symbol names. It turns out this is because of the missing -Wl,--export-dynamic flag. Instead of hardcoding the name of the flag and only passing it for Linux hosts, use a pre-existing CMake variable instead. I was not aware of this flag, but it appears to have been supported for the past 16 years (with support for more platforms added later): https://gitlab.kitware.com/cmake/cmake/-/commit/66d1930f5674f08e09f455b3f0777f2de3e0717e --- libunwind/test/configs/llvm-libunwind-merged.cfg.in | 5 +++-- libunwind/test/configs/llvm-libunwind-shared.cfg.in | 5 +++-- libunwind/test/configs/llvm-libunwind-static.cfg.in | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libunwind/test/configs/llvm-libunwind-merged.cfg.in b/libunwind/test/configs/llvm-libunwind-merged.cfg.in index 10650f7edf66a2f..624caec987e15b2 100644 --- a/libunwind/test/configs/llvm-libunwind-merged.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-merged.cfg.in @@ -11,8 +11,9 @@ link_flags = [] if @LIBUNWIND_ENABLE_CET@: compile_flags.append('-fcf-protection=full') -if '@CMAKE_SYSTEM_NAME@' == 'Linux': -link_flags.append('-Wl,--export-dynamic') +# On ELF platforms, add -Wl,--export-dynamic if supported by the linker. +if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'): +link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@') if '@CMAKE_DL_LIBS@': link_flags.append('-l@CMAKE_DL_LIBS@') diff --git a/libunwind/test/configs/llvm-libunwind-shared.cfg.in b/libunwind/test/configs/llvm-libunwind-shared.cfg.in index 97185e57234ff7f..bd7a153ac6d1d54 100644 --- a/libunwind/test/configs/llvm-libunwind-shared.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-shared.cfg.in @@ -10,8 +10,9 @@ link_flags = [] if @LIBUNWIND_ENABLE_CET@: compile_flags.append('-fcf-protection=full') -if '@CMAKE_SYSTEM_NAME@' == 'Linux': -link_flags.append('-Wl,--export-dynamic') +# On ELF platforms, add -Wl,--export-dynamic if supported by the linker. +if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'): +link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@') if '@CMAKE_DL_LIBS@': link_flags.append('-l@CMAKE_DL_LIBS@') diff --git a/libunwind/test/configs/llvm-libunwind-static.cfg.in b/libunwind/test/configs/llvm-libunwind-static.cfg.in index fc6a18d057f3884..5956c32cc625b2b 100644 --- a/libunwind/test/configs/llvm-libunwind-static.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-static.cfg.in @@ -13,8 +13,9 @@ if @LIBUNWIND_ENABLE_THREADS@: if @LIBUNWIND_ENABLE_CET@: compile_flags.append('-fcf-protection=full') -if '@CMAKE_SYSTEM_NAME@' == 'Linux': -link_flags.append('-Wl,--export-dynamic') +# On ELF platforms, add -Wl,--export-dynamic if supported by the linker. +if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'): +link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@') if '@CMAKE_DL_LIBS@': link_flags.append('-l@CMAKE_DL_LIBS@') ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Pass -Wl,--export-dynamic on all supported platforms (PR #67205)
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/67205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libc++][lit] Allow overriding the executor for tests (PR #66545)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/66545 >From eb6f23cbc308bb30fd78094aba4259e3aae6657c Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 25 Sep 2023 08:22:27 -0700 Subject: [PATCH] [libunwind][libc++][libc++abi] Allow overriding the executor for tests This is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the --num-shards/--run-shard argument. In order to connect each shard to the right QEMU instances I need to customize the arguments passed to ssh.py (--extra-ssh-args and --extra-scp-args) but can't do this at configure time since the target port is only known when running the tests but not when calling CMake. This change allows me to pass `executor=ssh.py ` to lit once I know the right hostname/port for running the tests. This also deprecates the `LIB{CXX,CXXABI,UNWIND}_EXECUTOR` CMake variable as the same can be achieved by adding `executor=...` to the `LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS` variable. --- clang/cmake/caches/CrossWinToARMLinux.cmake | 6 +++--- libcxx/docs/ReleaseNotes/18.rst | 5 + libcxx/test/CMakeLists.txt | 8 +--- libcxx/test/configs/cmake-bridge.cfg.in | 1 - libcxx/utils/libcxx/test/params.py | 14 +- libcxxabi/test/CMakeLists.txt | 7 +-- libcxxabi/test/configs/cmake-bridge.cfg.in | 1 - libunwind/test/CMakeLists.txt | 7 +-- libunwind/test/configs/cmake-bridge.cfg.in | 1 - 9 files changed, 36 insertions(+), 14 deletions(-) diff --git a/clang/cmake/caches/CrossWinToARMLinux.cmake b/clang/cmake/caches/CrossWinToARMLinux.cmake index bbb4b9e71be2d3d..fd341b182fd6563 100644 --- a/clang/cmake/caches/CrossWinToARMLinux.cmake +++ b/clang/cmake/caches/CrossWinToARMLinux.cmake @@ -162,9 +162,9 @@ if(DEFINED REMOTE_TEST_HOST) "\\\"${Python3_EXECUTABLE}\\\" \\\"${LLVM_PROJECT_DIR}/llvm/utils/remote-exec.py\\\" --host=${REMOTE_TEST_USER}@${REMOTE_TEST_HOST}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") endif() set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 8869d0b07d39f74..f852e6ffc8b89fc 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -134,3 +134,8 @@ ABI Affecting Changes Build System Changes + +- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. If you are relying on this, the new replacement + is either passing ``-Dexecutor=...`` to `llvm-lit`` or to make it persistent in the generated configuration + file, ``-DLIBCXX_TEST_PARAMS=executor=...`` can be used. The same also applies to the ``LIBUWIND_EXECTOR`` + and ``LIBCXXABI_EXECUTOR`` CMake variables. LLVM 19 will completely remove support for these variables. diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index c7036b94dcc596e..fd194a36a28fc26 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -6,9 +6,6 @@ if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH) "The path to libc++abi library.") endif() -set(LIBCXX_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${CMAKE_CURRENT_LIST_DIR}/../utils/run.py" CACHE STRING -"Executor to use when running tests.") - set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") @@ -16,6 +13,11 @@ macro(serialize_lit_param param value) string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n") endmacro() +if (LIBCXX_EXECUTOR) + message(DEPRECATION "LIBCXX_EXECUTOR is deprecated, please add executor=... to LIBCXX_TEST_PARAMS") + serialize_lit_param(executor "\"${LIBCXX_EXECUTOR}\"") +endif() + if (NOT LIBCXX_ENABLE_EXCEPTIONS) serialize_lit_param(enab
[libunwind] [libc++][lit] Allow overriding the executor for tests (PR #66545)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/66545 >From eb6f23cbc308bb30fd78094aba4259e3aae6657c Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 25 Sep 2023 08:22:27 -0700 Subject: [PATCH] [libunwind][libc++][libc++abi] Allow overriding the executor for tests This is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the --num-shards/--run-shard argument. In order to connect each shard to the right QEMU instances I need to customize the arguments passed to ssh.py (--extra-ssh-args and --extra-scp-args) but can't do this at configure time since the target port is only known when running the tests but not when calling CMake. This change allows me to pass `executor=ssh.py ` to lit once I know the right hostname/port for running the tests. This also deprecates the `LIB{CXX,CXXABI,UNWIND}_EXECUTOR` CMake variable as the same can be achieved by adding `executor=...` to the `LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS` variable. --- clang/cmake/caches/CrossWinToARMLinux.cmake | 6 +++--- libcxx/docs/ReleaseNotes/18.rst | 5 + libcxx/test/CMakeLists.txt | 8 +--- libcxx/test/configs/cmake-bridge.cfg.in | 1 - libcxx/utils/libcxx/test/params.py | 14 +- libcxxabi/test/CMakeLists.txt | 7 +-- libcxxabi/test/configs/cmake-bridge.cfg.in | 1 - libunwind/test/CMakeLists.txt | 7 +-- libunwind/test/configs/cmake-bridge.cfg.in | 1 - 9 files changed, 36 insertions(+), 14 deletions(-) diff --git a/clang/cmake/caches/CrossWinToARMLinux.cmake b/clang/cmake/caches/CrossWinToARMLinux.cmake index bbb4b9e71be2d3d..fd341b182fd6563 100644 --- a/clang/cmake/caches/CrossWinToARMLinux.cmake +++ b/clang/cmake/caches/CrossWinToARMLinux.cmake @@ -162,9 +162,9 @@ if(DEFINED REMOTE_TEST_HOST) "\\\"${Python3_EXECUTABLE}\\\" \\\"${LLVM_PROJECT_DIR}/llvm/utils/remote-exec.py\\\" --host=${REMOTE_TEST_USER}@${REMOTE_TEST_HOST}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") endif() set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 8869d0b07d39f74..f852e6ffc8b89fc 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -134,3 +134,8 @@ ABI Affecting Changes Build System Changes + +- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. If you are relying on this, the new replacement + is either passing ``-Dexecutor=...`` to `llvm-lit`` or to make it persistent in the generated configuration + file, ``-DLIBCXX_TEST_PARAMS=executor=...`` can be used. The same also applies to the ``LIBUWIND_EXECTOR`` + and ``LIBCXXABI_EXECUTOR`` CMake variables. LLVM 19 will completely remove support for these variables. diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index c7036b94dcc596e..fd194a36a28fc26 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -6,9 +6,6 @@ if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH) "The path to libc++abi library.") endif() -set(LIBCXX_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${CMAKE_CURRENT_LIST_DIR}/../utils/run.py" CACHE STRING -"Executor to use when running tests.") - set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") @@ -16,6 +13,11 @@ macro(serialize_lit_param param value) string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n") endmacro() +if (LIBCXX_EXECUTOR) + message(DEPRECATION "LIBCXX_EXECUTOR is deprecated, please add executor=... to LIBCXX_TEST_PARAMS") + serialize_lit_param(executor "\"${LIBCXX_EXECUTOR}\"") +endif() + if (NOT LIBCXX_ENABLE_EXCEPTIONS) serialize_lit_param(enab
[libunwind] [libc++][lit] Allow overriding the executor for tests (PR #66545)
@@ -330,5 +330,14 @@ def getModuleFlag(cfg, enable_modules): AddCompileFlag("-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES"), ], ), +Parameter( arichardson wrote: Done now, tested both the default and the case where LIBCXX_EXECUTOR is set. Hope this works as expected for all CI configurations. https://github.com/llvm/llvm-project/pull/66545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libc++][lit] Allow overriding the executor for tests (PR #66545)
@@ -330,5 +330,14 @@ def getModuleFlag(cfg, enable_modules): AddCompileFlag("-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES"), ], ), +Parameter( arichardson wrote: Done now, tested both the default and the case where LIBCXX_EXECUTOR is set. Hope this works as expected for all CI configurations. https://github.com/llvm/llvm-project/pull/66545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libc++][lit] Allow overriding the executor for tests (PR #66545)
@@ -134,3 +134,8 @@ ABI Affecting Changes Build System Changes + +- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. If you are relying on this, the new replacement + is either passing ``-Dexecutor=...`` to `llvm-lit`` or to make it persistent in the generated configuration arichardson wrote: ```suggestion is either passing ``-Dexecutor=...`` to ``llvm-lit`` or to make it persistent in the generated configuration ``` https://github.com/llvm/llvm-project/pull/66545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libc++][lit] Allow overriding the executor for tests (PR #66545)
@@ -134,3 +134,8 @@ ABI Affecting Changes Build System Changes + +- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. If you are relying on this, the new replacement + is either passing ``-Dexecutor=...`` to `llvm-lit`` or to make it persistent in the generated configuration arichardson wrote: ```suggestion is either passing ``-Dexecutor=...`` to ``llvm-lit`` or to make it persistent in the generated configuration ``` https://github.com/llvm/llvm-project/pull/66545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libc++][lit] Allow overriding the executor for tests (PR #66545)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/66545 >From eb6f23cbc308bb30fd78094aba4259e3aae6657c Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 25 Sep 2023 08:22:27 -0700 Subject: [PATCH 1/2] [libunwind][libc++][libc++abi] Allow overriding the executor for tests This is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the --num-shards/--run-shard argument. In order to connect each shard to the right QEMU instances I need to customize the arguments passed to ssh.py (--extra-ssh-args and --extra-scp-args) but can't do this at configure time since the target port is only known when running the tests but not when calling CMake. This change allows me to pass `executor=ssh.py ` to lit once I know the right hostname/port for running the tests. This also deprecates the `LIB{CXX,CXXABI,UNWIND}_EXECUTOR` CMake variable as the same can be achieved by adding `executor=...` to the `LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS` variable. --- clang/cmake/caches/CrossWinToARMLinux.cmake | 6 +++--- libcxx/docs/ReleaseNotes/18.rst | 5 + libcxx/test/CMakeLists.txt | 8 +--- libcxx/test/configs/cmake-bridge.cfg.in | 1 - libcxx/utils/libcxx/test/params.py | 14 +- libcxxabi/test/CMakeLists.txt | 7 +-- libcxxabi/test/configs/cmake-bridge.cfg.in | 1 - libunwind/test/CMakeLists.txt | 7 +-- libunwind/test/configs/cmake-bridge.cfg.in | 1 - 9 files changed, 36 insertions(+), 14 deletions(-) diff --git a/clang/cmake/caches/CrossWinToARMLinux.cmake b/clang/cmake/caches/CrossWinToARMLinux.cmake index bbb4b9e71be2d3d..fd341b182fd6563 100644 --- a/clang/cmake/caches/CrossWinToARMLinux.cmake +++ b/clang/cmake/caches/CrossWinToARMLinux.cmake @@ -162,9 +162,9 @@ if(DEFINED REMOTE_TEST_HOST) "\\\"${Python3_EXECUTABLE}\\\" \\\"${LLVM_PROJECT_DIR}/llvm/utils/remote-exec.py\\\" --host=${REMOTE_TEST_USER}@${REMOTE_TEST_HOST}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") endif() set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 8869d0b07d39f74..f852e6ffc8b89fc 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -134,3 +134,8 @@ ABI Affecting Changes Build System Changes + +- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. If you are relying on this, the new replacement + is either passing ``-Dexecutor=...`` to `llvm-lit`` or to make it persistent in the generated configuration + file, ``-DLIBCXX_TEST_PARAMS=executor=...`` can be used. The same also applies to the ``LIBUWIND_EXECTOR`` + and ``LIBCXXABI_EXECUTOR`` CMake variables. LLVM 19 will completely remove support for these variables. diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index c7036b94dcc596e..fd194a36a28fc26 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -6,9 +6,6 @@ if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH) "The path to libc++abi library.") endif() -set(LIBCXX_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${CMAKE_CURRENT_LIST_DIR}/../utils/run.py" CACHE STRING -"Executor to use when running tests.") - set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") @@ -16,6 +13,11 @@ macro(serialize_lit_param param value) string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n") endmacro() +if (LIBCXX_EXECUTOR) + message(DEPRECATION "LIBCXX_EXECUTOR is deprecated, please add executor=... to LIBCXX_TEST_PARAMS") + serialize_lit_param(executor "\"${LIBCXX_EXECUTOR}\"") +endif() + if (NOT LIBCXX_ENABLE_EXCEPTIONS) serialize_lit_param(
[clang] [libc++][lit] Allow overriding the executor for tests (PR #66545)
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/66545 >From eb6f23cbc308bb30fd78094aba4259e3aae6657c Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 25 Sep 2023 08:22:27 -0700 Subject: [PATCH 1/2] [libunwind][libc++][libc++abi] Allow overriding the executor for tests This is useful when trying to run multiple tests with different arguments to the executor script. This is needed in my case since I do not know the correct ssh connection arguments when building libc++. The testing script I have spawns multiple QEMU instances that listen on a given port on localhost and runs lit with the --num-shards/--run-shard argument. In order to connect each shard to the right QEMU instances I need to customize the arguments passed to ssh.py (--extra-ssh-args and --extra-scp-args) but can't do this at configure time since the target port is only known when running the tests but not when calling CMake. This change allows me to pass `executor=ssh.py ` to lit once I know the right hostname/port for running the tests. This also deprecates the `LIB{CXX,CXXABI,UNWIND}_EXECUTOR` CMake variable as the same can be achieved by adding `executor=...` to the `LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS` variable. --- clang/cmake/caches/CrossWinToARMLinux.cmake | 6 +++--- libcxx/docs/ReleaseNotes/18.rst | 5 + libcxx/test/CMakeLists.txt | 8 +--- libcxx/test/configs/cmake-bridge.cfg.in | 1 - libcxx/utils/libcxx/test/params.py | 14 +- libcxxabi/test/CMakeLists.txt | 7 +-- libcxxabi/test/configs/cmake-bridge.cfg.in | 1 - libunwind/test/CMakeLists.txt | 7 +-- libunwind/test/configs/cmake-bridge.cfg.in | 1 - 9 files changed, 36 insertions(+), 14 deletions(-) diff --git a/clang/cmake/caches/CrossWinToARMLinux.cmake b/clang/cmake/caches/CrossWinToARMLinux.cmake index bbb4b9e71be2d3d..fd341b182fd6563 100644 --- a/clang/cmake/caches/CrossWinToARMLinux.cmake +++ b/clang/cmake/caches/CrossWinToARMLinux.cmake @@ -162,9 +162,9 @@ if(DEFINED REMOTE_TEST_HOST) "\\\"${Python3_EXECUTABLE}\\\" \\\"${LLVM_PROJECT_DIR}/llvm/utils/remote-exec.py\\\" --host=${REMOTE_TEST_USER}@${REMOTE_TEST_HOST}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") - set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_EXECUTOR "${DEFAULT_TEST_EXECUTOR}" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") + set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_TEST_PARAMS "${RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_TEST_PARAMS} 'executor=${DEFAULT_TEST_EXECUTOR}'" CACHE STRING "") endif() set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 8869d0b07d39f74..f852e6ffc8b89fc 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -134,3 +134,8 @@ ABI Affecting Changes Build System Changes + +- The ``LIBCXX_EXECUTOR`` CMake variable has been deprecated. If you are relying on this, the new replacement + is either passing ``-Dexecutor=...`` to `llvm-lit`` or to make it persistent in the generated configuration + file, ``-DLIBCXX_TEST_PARAMS=executor=...`` can be used. The same also applies to the ``LIBUWIND_EXECTOR`` + and ``LIBCXXABI_EXECUTOR`` CMake variables. LLVM 19 will completely remove support for these variables. diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index c7036b94dcc596e..fd194a36a28fc26 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -6,9 +6,6 @@ if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH) "The path to libc++abi library.") endif() -set(LIBCXX_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${CMAKE_CURRENT_LIST_DIR}/../utils/run.py" CACHE STRING -"Executor to use when running tests.") - set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") @@ -16,6 +13,11 @@ macro(serialize_lit_param param value) string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n") endmacro() +if (LIBCXX_EXECUTOR) + message(DEPRECATION "LIBCXX_EXECUTOR is deprecated, please add executor=... to LIBCXX_TEST_PARAMS") + serialize_lit_param(executor "\"${LIBCXX_EXECUTOR}\"") +endif() + if (NOT LIBCXX_ENABLE_EXCEPTIONS) serialize_lit_param(
[libunwind] [libunwind][libc++][libc++abi] Add cross-compilation flags to tests (PR #67201)
arichardson wrote: > > I think it would be good if all of them did it, the reason I didn't is that > > I limited it to the ones I can test locally. Seeing as there is probably CI > > coverage for all of the configs, should I try updating the remaining ones? > > Yes, I think it makes sense for all of them to use that variable. Can you > confirm that this is basically empty all the time except if you're using a > custom CMake toolchain file? Grepping through the CMake source shows that the variable could have an effect on the tests when targeting Android and Windows, but for other targets (Linux,macOS) it is a set to `" "`. I guess one option could be to guard it using `if "@CMAKE_CROSSCOMPILING@":`? ``` Modules/Compiler/ARMCC.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/ARMClang.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " -march=${CMAKE_SYSTEM_ARCH}") Modules/Compiler/ARMClang.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " -mcpu=${CMAKE_SYSTEM_PROCESSOR}") Modules/Compiler/Bruce-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -D__CLASSIC_C__") Modules/Compiler/Fujitsu.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/GHS-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " ") Modules/Compiler/GHS-CXX.cmake:string(APPEND CMAKE_CXX_FLAGS_INIT " ") Modules/Compiler/GNU.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/IAR.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/IAR.cmake: string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " --silent") Modules/Compiler/IAR.cmake: string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -S") Modules/Compiler/Intel-ISPC.cmake:string(APPEND CMAKE_ISPC_FLAGS_INIT " ") Modules/Compiler/Intel.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/IntelLLVM.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/LCC.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/NVIDIA-CUDA.cmake: string(APPEND CMAKE_CUDA_FLAGS_INIT " ") Modules/Compiler/OpenWatcom.cmake: string(APPEND CMAKE_${type}_LINKER_FLAGS_INIT " opt map") Modules/Compiler/OpenWatcom.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " -w3") Modules/Compiler/PGI.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/PGI.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " -Bdynamic") Modules/Compiler/PathScale.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/SunPro-ASM.cmake:string(APPEND CMAKE_ASM_FLAGS_INIT " ") Modules/Compiler/SunPro-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " ") Modules/Compiler/SunPro-CXX.cmake:string(APPEND CMAKE_CXX_FLAGS_INIT " ") Modules/Compiler/Tasking.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " ") Modules/Compiler/TinyCC-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " ") Modules/Compiler/XL-ASM.cmake:string(APPEND CMAKE_ASM_FLAGS_INIT " -qthreaded -qhalt=e -qsourcetype=assembler") Modules/Compiler/XL-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded") Modules/Compiler/XL-CXX.cmake:string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded") Modules/Platform/AIX-XL-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -qhalt=e") Modules/Platform/AIX-XL-CXX.cmake:string(APPEND CMAKE_CXX_FLAGS_INIT " -qhalt=s") Modules/Platform/ARTOS-GNU-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -DARTOS -Xp -+") Modules/Platform/Android-Common.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " -stdlib=libstdc++") Modules/Platform/Android-Common.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " -stdlib=libc++") Modules/Platform/Android-Common.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " -stdlib=libc++") Modules/Platform/Android-Common.cmake:string(APPEND CMAKE_${lang}_FLAGS_INIT " ${_ANDROID_ABI_INIT_CFLAGS}") Modules/Platform/Android-Common.cmake: string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_LDFLAGS}") Modules/Platform/Android-Common.cmake:string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_EXE_LDFLAGS}") Modules/Platform/Android-Common.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " -fexceptions") Modules/Platform/Android-Common.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " -fno-exceptions") Modules/Platform/Android-Common.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " -frtti") Modules/Platform/Android-Common.cmake: string(APPEND CMAKE_${lang}_FLAGS_INIT " -fno-rtti") Modules/Platform/Apple-XL-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -qhalt=e") Modules/Platform/Apple-XL-CXX.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -qhalt=e") Modules/Platform/BlueGeneP-dynamic-XL-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -qhalt=e") Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake:string(APPEND CMAKE_CXX_FLAGS_INIT " -qhalt=s") Modules/Platform/BlueGeneP-static-XL-C.cmake:string(APPEND CMAKE_C_FLAGS_INIT " -qhalt=e") Modules/Platform/BlueGeneP-static-XL-CXX.cmake:string(APPEND CMAKE_CXX_FLAGS_INIT " -qhalt=s") Modules/Platform/BlueGeneQ-dynamic-XL-C.cmake:string(APPEND CMAK
[libunwind] [libunwind] Pass -Wl,--export-dynamic on all supported platforms (PR #67205)
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/67205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Pass -Wl,--export-dynamic on all supported platforms (PR #67205)
arichardson wrote: > Is this really desirable? It can actually break applications as it changes > ELF semantics. I agree that it's not generally desirable, but this is only for the libunwind tests (which expect these semantics). https://github.com/llvm/llvm-project/pull/67205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Pass -Wl,--export-dynamic on all supported platforms (PR #67205)
arichardson wrote: > Can you as a small follow-up just update the comment to include that part? > E.g. > Will do. > ``` > # On ELF platforms, link tests with -Wl,--export-dynamic if supported by the > linker. > ``` > > Side note: the much older way for doing this is actually `-rdynamic`. It appears CMake actually still does this in one case: ``` Modules/Platform/Linux-TinyCC-C.cmake:set(CMAKE_EXE_EXPORTS_C_FLAG "-rdynamic ") ``` https://github.com/llvm/llvm-project/pull/67205 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][nfc] Avoid type warning of debug printf (PR #67390)
https://github.com/arichardson commented: Could also use %p instead of `0x% Pri*`and cast the `uintptr_t` to `void *`? That would avoid the need for the new macros. https://github.com/llvm/llvm-project/pull/67390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind][nfc] Avoid type warning of debug printf (PR #67390)
arichardson wrote: Or alternatively use PRIxPTR unconditionally, using PRIuPTR with 0x-prefixed outputs is super confusing https://github.com/llvm/llvm-project/pull/67390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libc++][lit] Allow overriding the executor for tests (PR #66545)
https://github.com/arichardson closed https://github.com/llvm/llvm-project/pull/66545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits