[libunwind] r315814 - libunwind: document tested FreeBSD configs and sort OS list
Author: emaste Date: Sat Oct 14 10:04:04 2017 New Revision: 315814 URL: http://llvm.org/viewvc/llvm-project?rev=315814&view=rev Log: libunwind: document tested FreeBSD configs and sort OS list libunwind is known to work on FreeBSD i386, amd64 (x86_64) and arm64. It is the unwinder provided by the base system on all of those architectures. While here sort the OS list. Differential Revision: https://reviews.llvm.org/D38900 Modified: libunwind/trunk/docs/index.rst Modified: libunwind/trunk/docs/index.rst URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/docs/index.rst?rev=315814&r1=315813&r2=315814&view=diff == --- libunwind/trunk/docs/index.rst (original) +++ libunwind/trunk/docs/index.rst Sat Oct 14 10:04:04 2017 @@ -44,13 +44,14 @@ libunwind is known to work on the follow OS Arch CompilersUnwind Info -Mac OS X i386, x86_64 Clang, GCC DWARF CFI +Any i386, x86_64, ARMClangSjLj +Bare Metal ARM Clang, GCC EHABI +FreeBSD i386, x86_64, ARM64 ClangDWARF CFI iOS ARM ClangSjLj -Linuxi386, x86_64, ARM64 Clang, GCC DWARF CFI LinuxARM Clang, GCC EHABI -Bare Metal ARM Clang, GCC EHABI +Linuxi386, x86_64, ARM64 Clang, GCC DWARF CFI +Mac OS X i386, x86_64 Clang, GCC DWARF CFI NetBSD x86_64 Clang, GCC DWARF CFI -Any i386, x86_64, ARMClangSjLj The following minimum compiler versions are strongly recommended. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r344100 - clang: Allow ifunc resolvers to accept arguments
Author: emaste Date: Tue Oct 9 17:34:17 2018 New Revision: 344100 URL: http://llvm.org/viewvc/llvm-project?rev=344100&view=rev Log: clang: Allow ifunc resolvers to accept arguments When ifunc support was added to Clang (r265917) it did not allow resolvers to take function arguments. This was based on GCC's documentation, which states resolvers return a pointer and take no arguments. However, GCC actually allows resolvers to take arguments, and glibc (on non-x86 platforms) and FreeBSD (on x86 and arm64) pass some CPU identification information as arguments to ifunc resolvers. I believe GCC's documentation is simply incorrect / out-of-date. FreeBSD already removed the prohibition in their in-tree Clang copy. Differential Revision: https://reviews.llvm.org/D52703 Modified: cfe/trunk/include/clang/Basic/AttrDocs.td cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/CodeGen/CodeGenModule.cpp cfe/trunk/test/Sema/attr-ifunc.c Modified: cfe/trunk/include/clang/Basic/AttrDocs.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=344100&r1=344099&r2=344100&view=diff == --- cfe/trunk/include/clang/Basic/AttrDocs.td (original) +++ cfe/trunk/include/clang/Basic/AttrDocs.td Tue Oct 9 17:34:17 2018 @@ -3428,7 +3428,7 @@ def IFuncDocs : Documentation { let Content = [{ ``__attribute__((ifunc("resolver")))`` is used to mark that the address of a declaration should be resolved at runtime by calling a resolver function. -The symbol name of the resolver function is given in quotes. A function with this name (after mangling) must be defined in the current translation unit; it may be ``static``. The resolver function should take no arguments and return a pointer. +The symbol name of the resolver function is given in quotes. A function with this name (after mangling) must be defined in the current translation unit; it may be ``static``. The resolver function should return a pointer. The ``ifunc`` attribute may only be used on a function declaration. A function declaration with an ``ifunc`` attribute is considered to be a definition of the declared entity. The entity must not have weak linkage; for example, in C++, it cannot be applied to a declaration if a definition at that location would be considered inline. Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=344100&r1=344099&r2=344100&view=diff == --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Oct 9 17:34:17 2018 @@ -2889,8 +2889,6 @@ def err_cyclic_alias : Error< "%select{alias|ifunc}0 definition is part of a cycle">; def err_ifunc_resolver_return : Error< "ifunc resolver function must return a pointer">; -def err_ifunc_resolver_params : Error< - "ifunc resolver function must have no parameters">; def warn_attribute_wrong_decl_type_str : Warning< "%0 attribute only applies to %1">, InGroup; def err_attribute_wrong_decl_type_str : Error< Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=344100&r1=344099&r2=344100&view=diff == --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original) +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Oct 9 17:34:17 2018 @@ -322,8 +322,6 @@ void CodeGenModule::checkAliases() { assert(FTy); if (!FTy->getReturnType()->isPointerTy()) Diags.Report(Location, diag::err_ifunc_resolver_return); - if (FTy->getNumParams()) -Diags.Report(Location, diag::err_ifunc_resolver_params); } llvm::Constant *Aliasee = Alias->getIndirectSymbol(); Modified: cfe/trunk/test/Sema/attr-ifunc.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-ifunc.c?rev=344100&r1=344099&r2=344100&view=diff == --- cfe/trunk/test/Sema/attr-ifunc.c (original) +++ cfe/trunk/test/Sema/attr-ifunc.c Tue Oct 9 17:34:17 2018 @@ -27,10 +27,6 @@ void f4_ifunc() {} void f4() __attribute__((ifunc("f4_ifunc"))); //expected-error@-1 {{ifunc resolver function must return a pointer}} -void* f5_ifunc(int i) { return 0; } -void f5() __attribute__((ifunc("f5_ifunc"))); -//expected-error@-1 {{ifunc resolver function must have no parameters}} - #else void f1a() __asm("f1"); void f1a() {} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r343408 - Update ifunc attribute support documentation
Author: emaste Date: Sun Sep 30 08:08:18 2018 New Revision: 343408 URL: http://llvm.org/viewvc/llvm-project?rev=343408&view=rev Log: Update ifunc attribute support documentation Previously we documented GNU binutils and glibc versions required for ifunc support, but our own lld linker and FreeBSD's rtld also support ifuncs. Differential Revision: https://reviews.llvm.org/D52696 Modified: cfe/trunk/include/clang/Basic/AttrDocs.td Modified: cfe/trunk/include/clang/Basic/AttrDocs.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=343408&r1=343407&r2=343408&view=diff == --- cfe/trunk/include/clang/Basic/AttrDocs.td (original) +++ cfe/trunk/include/clang/Basic/AttrDocs.td Sun Sep 30 08:08:18 2018 @@ -3370,7 +3370,7 @@ The symbol name of the resolver function The ``ifunc`` attribute may only be used on a function declaration. A function declaration with an ``ifunc`` attribute is considered to be a definition of the declared entity. The entity must not have weak linkage; for example, in C++, it cannot be applied to a declaration if a definition at that location would be considered inline. -Not all targets support this attribute. ELF targets support this attribute when using binutils v2.20.1 or higher and glibc v2.11.1 or higher. Non-ELF targets currently do not support this attribute. +Not all targets support this attribute. ELF target support depends on both the linker and runtime linker, and is available in at least lld 4.0 and later, binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later. Non-ELF targets currently do not support this attribute. }]; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D24867: Request init/fini array on FreeBSD 12 and later
emaste created this revision. emaste added reviewers: dim, brooks. emaste added a subscriber: cfe-commits. Herald added a subscriber: emaste. It seems a bad idea to change the default in the middle of a release branch due to possible changes in global ctor / dtor ordering between .ctors and .init_array. With FreeBSD 11.0's release imminent lets change the default now for FreeBSD 12 (the current development stream) and later. FreeBSD rtld has supported .init_array / .fini_array for many years. As of Jan 1 2017 all supported FreeBSD releases and branches will have support. https://reviews.llvm.org/D24867 Files: lib/Driver/ToolChains.cpp test/Driver/constructors.c Index: test/Driver/constructors.c === --- test/Driver/constructors.c +++ test/Driver/constructors.c @@ -74,3 +74,11 @@ // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ // RUN: -target arm64-none-none-eabi \ // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s + +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-freebsd11 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s + +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-freebsd12 \ +// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -2829,6 +2829,8 @@ bool UseInitArrayDefault = getTriple().getArch() == llvm::Triple::aarch64 || getTriple().getArch() == llvm::Triple::aarch64_be || + (getTriple().getOS() == llvm::Triple::FreeBSD && + getTriple().getOSMajorVersion() >= 12) || (getTriple().getOS() == llvm::Triple::Linux && (!V.isOlderThan(4, 7, 0) || getTriple().isAndroid())) || getTriple().getOS() == llvm::Triple::NaCl || Index: test/Driver/constructors.c === --- test/Driver/constructors.c +++ test/Driver/constructors.c @@ -74,3 +74,11 @@ // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ // RUN: -target arm64-none-none-eabi \ // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s + +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-freebsd11 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s + +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-freebsd12 \ +// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -2829,6 +2829,8 @@ bool UseInitArrayDefault = getTriple().getArch() == llvm::Triple::aarch64 || getTriple().getArch() == llvm::Triple::aarch64_be || + (getTriple().getOS() == llvm::Triple::FreeBSD && + getTriple().getOSMajorVersion() >= 12) || (getTriple().getOS() == llvm::Triple::Linux && (!V.isOlderThan(4, 7, 0) || getTriple().isAndroid())) || getTriple().getOS() == llvm::Triple::NaCl || ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r282599 - libunwind: Add OpenBSD case for _Unwind_Ptr typedef
Author: emaste Date: Wed Sep 28 10:37:21 2016 New Revision: 282599 URL: http://llvm.org/viewvc/llvm-project?rev=282599&view=rev Log: libunwind: Add OpenBSD case for _Unwind_Ptr typedef Patch by Mark Kettenis Modified: libunwind/trunk/src/AddressSpace.hpp Modified: libunwind/trunk/src/AddressSpace.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=282599&r1=282598&r2=282599&view=diff == --- libunwind/trunk/src/AddressSpace.hpp (original) +++ libunwind/trunk/src/AddressSpace.hpp Wed Sep 28 10:37:21 2016 @@ -35,7 +35,7 @@ namespace libunwind { #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) typedef void *_Unwind_Ptr; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25593: [libcxx] Build with -fvisibility-inlines-hidden -- Remove 20 inline definitions from the dylib
emaste added inline comments. Comment at: lib/abi/CHANGELOG.TXT:22 + Although this change removes symbols, it should still be non-ABI breaking + since all of the definitions removed are inline functions. + Should we also include in this comment the further justification from your Phabricator description above (about having own definitions)? https://reviews.llvm.org/D25593 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r284256 - Link static PIE programs against rcrt0.o on OpenBSD
Author: emaste Date: Fri Oct 14 12:59:53 2016 New Revision: 284256 URL: http://llvm.org/viewvc/llvm-project?rev=284256&view=rev Log: Link static PIE programs against rcrt0.o on OpenBSD Patch by Stefan Kempf. Differential Revision: https://reviews.llvm.org/D22130 Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/openbsd.c Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=284256&r1=284255&r2=284256&view=diff == --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Fri Oct 14 12:59:53 2016 @@ -8519,6 +8519,10 @@ void openbsd::Linker::ConstructJob(Compi if (Args.hasArg(options::OPT_pg)) CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o"))); + else if (Args.hasArg(options::OPT_static) && + !Args.hasArg(options::OPT_nopie)) +CmdArgs.push_back( +Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o"))); else CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("crt0.o"))); Modified: cfe/trunk/test/Driver/openbsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=284256&r1=284255&r2=284256&view=diff == --- cfe/trunk/test/Driver/openbsd.c (original) +++ cfe/trunk/test/Driver/openbsd.c Fri Oct 14 12:59:53 2016 @@ -67,3 +67,26 @@ // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC" // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL" // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC" + +// Check linking against correct startup code when (not) using PIE +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -static -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -static -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// CHECK-PIE: "/usr/lib/crt0.o" +// CHECK-PIE-NOT: "-nopie" +// CHECK-STATIC-PIE: "/usr/lib/rcrt0.o" +// CHECK-STATIC-PIE-NOT: "-nopie" +// CHECK-NOPIE: "-nopie" {{.*}}"/usr/lib/crt0.o" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D22130: Link static PIE programs against rcrt0.o on OpenBSD
This revision was automatically updated to reflect the committed changes. Closed by commit rL284256: Link static PIE programs against rcrt0.o on OpenBSD (authored by emaste). Changed prior to commit: https://reviews.llvm.org/D22130?vs=68046&id=74718#toc Repository: rL LLVM https://reviews.llvm.org/D22130 Files: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/openbsd.c Index: cfe/trunk/test/Driver/openbsd.c === --- cfe/trunk/test/Driver/openbsd.c +++ cfe/trunk/test/Driver/openbsd.c @@ -67,3 +67,26 @@ // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC" // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL" // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC" + +// Check linking against correct startup code when (not) using PIE +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -static -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -static -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// CHECK-PIE: "/usr/lib/crt0.o" +// CHECK-PIE-NOT: "-nopie" +// CHECK-STATIC-PIE: "/usr/lib/rcrt0.o" +// CHECK-STATIC-PIE-NOT: "-nopie" +// CHECK-NOPIE: "-nopie" {{.*}}"/usr/lib/crt0.o" Index: cfe/trunk/lib/Driver/Tools.cpp === --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -8519,6 +8519,10 @@ if (Args.hasArg(options::OPT_pg)) CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o"))); + else if (Args.hasArg(options::OPT_static) && + !Args.hasArg(options::OPT_nopie)) +CmdArgs.push_back( +Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o"))); else CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("crt0.o"))); Index: cfe/trunk/test/Driver/openbsd.c === --- cfe/trunk/test/Driver/openbsd.c +++ cfe/trunk/test/Driver/openbsd.c @@ -67,3 +67,26 @@ // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC" // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL" // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC" + +// Check linking against correct startup code when (not) using PIE +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s +// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -static -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -static -nopie %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s +// CHECK-PIE: "/usr/lib/crt0.o" +// CHECK-PIE-NOT: "-nopie" +// CHECK-STATIC-PIE: "/usr/lib/rcrt0.o" +// CHECK-STATIC-PIE-NOT: "-nopie" +// CHECK-NOPIE: "-nopie" {{.*}}"/usr/lib/crt0.o" Index: cfe/trunk/lib/Driver/Tools.cpp === --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -8519,6 +8519,10 @@ if (Args.hasArg(options::OPT_pg)) CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o"))); + else if (Args.hasArg(options::OPT_static) && + !Args.hasArg
r284259 - Revert r284256 due to test failure
Author: emaste Date: Fri Oct 14 13:20:12 2016 New Revision: 284259 URL: http://llvm.org/viewvc/llvm-project?rev=284259&view=rev Log: Revert r284256 due to test failure Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/openbsd.c Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=284259&r1=284258&r2=284259&view=diff == --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Fri Oct 14 13:20:12 2016 @@ -8519,10 +8519,6 @@ void openbsd::Linker::ConstructJob(Compi if (Args.hasArg(options::OPT_pg)) CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o"))); - else if (Args.hasArg(options::OPT_static) && - !Args.hasArg(options::OPT_nopie)) -CmdArgs.push_back( -Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o"))); else CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("crt0.o"))); Modified: cfe/trunk/test/Driver/openbsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=284259&r1=284258&r2=284259&view=diff == --- cfe/trunk/test/Driver/openbsd.c (original) +++ cfe/trunk/test/Driver/openbsd.c Fri Oct 14 13:20:12 2016 @@ -67,26 +67,3 @@ // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC" // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL" // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC" - -// Check linking against correct startup code when (not) using PIE -// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-PIE %s -// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-PIE %s -// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s -// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s -// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -nopie %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s -// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -nopie %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s -// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -static -nopie %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s -// RUN: %clang -no-canonical-prefix -target i868-pc-openbsd -fno-pie -static -nopie %s -### 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s -// CHECK-PIE: "/usr/lib/crt0.o" -// CHECK-PIE-NOT: "-nopie" -// CHECK-STATIC-PIE: "/usr/lib/rcrt0.o" -// CHECK-STATIC-PIE-NOT: "-nopie" -// CHECK-NOPIE: "-nopie" {{.*}}"/usr/lib/crt0.o" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Remove support for FreeBSD 11.x (PR #73392)
emaste wrote: I think this is OK; someone who really needs to target past-EOL FreeBSD with contemporary Clang could pass explicit flags to set the DWARF version etc. But let me ping @DimitryAndric for comment as well. https://github.com/llvm/llvm-project/pull/73392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Remove support for FreeBSD 11.x (PR #73392)
https://github.com/emaste approved this pull request. https://github.com/llvm/llvm-project/pull/73392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)
https://github.com/emaste created https://github.com/llvm/llvm-project/pull/86658 As discussed in #86320; opening this PR for CI. It looks like (prior to this change) there are no C++26 jobs right now. >From 6cf1345feee41ec3bad51ba853091e35723c85ab Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Thu, 12 Oct 2023 16:02:06 +0300 Subject: [PATCH 1/2] [libunwind] Unwind through aarch64/FreeBSD sigreturn frame Similar to D90898 (Linux Aarch64). Differential Revision: https://reviews.llvm.org/D155066 --- libunwind/include/__libunwind_config.h | 5 ++ libunwind/src/UnwindCursor.hpp | 85 -- 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/libunwind/include/__libunwind_config.h b/libunwind/include/__libunwind_config.h index 8db336b2d727ce..783a488d7de0fd 100644 --- a/libunwind/include/__libunwind_config.h +++ b/libunwind/include/__libunwind_config.h @@ -39,6 +39,9 @@ # if defined(__HAIKU__) # define _LIBUNWIND_TARGET_HAIKU 1 # endif +#if defined(__FreeBSD__) +#define _LIBUNWIND_TARGET_FREEBSD 1 +#endif # if defined(__i386__) # define _LIBUNWIND_TARGET_I386 # define _LIBUNWIND_CONTEXT_SIZE 8 @@ -73,6 +76,8 @@ # define _LIBUNWIND_CONTEXT_SIZE 66 # if defined(__SEH__) #define _LIBUNWIND_CURSOR_SIZE 164 +#elif defined(_LIBUNWIND_TARGET_FREEBSD) +#define _LIBUNWIND_CURSOR_SIZE 80 # else #define _LIBUNWIND_CURSOR_SIZE 78 # endif diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index 7753936a5894a3..96d82d6aac7c93 100644 --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -39,6 +39,17 @@ #include #include #define _LIBUNWIND_CHECK_LINUX_SIGRETURN 1 +#define _LIBUNWIND_CHECK_SIGRETURN 1 +#endif + +#if defined(_LIBUNWIND_TARGET_FREEBSD) && defined(_LIBUNWIND_TARGET_AARCH64) +#include +#include +#include +#include +#include +#define _LIBUNWIND_CHECK_FREEBSD_SIGRETURN 1 +#define _LIBUNWIND_CHECK_SIGRETURN 1 #endif #include "AddressSpace.hpp" @@ -983,7 +994,7 @@ class UnwindCursor : public AbstractUnwindCursor{ } #endif -#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +#if defined(_LIBUNWIND_CHECK_SIGRETURN) bool setInfoForSigReturn() { R dummy; return setInfoForSigReturn(dummy); @@ -1011,7 +1022,7 @@ class UnwindCursor : public AbstractUnwindCursor{ template int stepThroughSigReturn(Registers &) { return UNW_STEP_END; } -#endif +#endif // defined(_LIBUNWIND_CHECK_SIGRETURN) #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) bool getInfoFromFdeCie(const typename CFI_Parser::FDE_Info &fdeInfo, @@ -1314,9 +1325,14 @@ class UnwindCursor : public AbstractUnwindCursor{ unw_proc_info_t _info; bool _unwindInfoMissing; bool _isSignalFrame; -#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +#if defined(_LIBUNWIND_CHECK_SIGRETURN) bool _isSigReturn = false; +#if defined(_LIBUNWIND_CHECK_FREEBSD_SIGRETURN) + bool _isSigTrampDetermined = false; + pint_t _sigTrampStart; + pint_t _sigTrampEnd; #endif +#endif // defined(_LIBUNWIND_CHECK_SIGRETURN) }; @@ -2558,7 +2574,7 @@ int UnwindCursor::stepWithTBTable(pint_t pc, tbtable *TBTable, template void UnwindCursor::setInfoBasedOnIPRegister(bool isReturnAddress) { -#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +#if defined(_LIBUNWIND_CHECK_SIGRETURN) _isSigReturn = false; #endif @@ -2673,7 +2689,7 @@ void UnwindCursor::setInfoBasedOnIPRegister(bool isReturnAddress) { } #endif // #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) -#if defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) +#if defined(_LIBUNWIND_CHECK_SIGRETURN) if (setInfoForSigReturn()) return; #endif @@ -2909,6 +2925,63 @@ int UnwindCursor::stepThroughSigReturn(Registers_s390x &) { #endif // defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) && // defined(_LIBUNWIND_TARGET_S390X) +#if defined(_LIBUNWIND_CHECK_FREEBSD_SIGRETURN) && \ +defined(_LIBUNWIND_TARGET_AARCH64) +template +bool UnwindCursor::setInfoForSigReturn(Registers_arm64 &) { + // Look for the sigreturn trampoline. + // + // https://cgit.freebsd.org/src/tree/sys/arm64/arm64/sigtramp.S + const pint_t pc = static_cast(this->getReg(UNW_REG_IP)); + + if (_isSigTrampDetermined == false) { +struct kinfo_sigtramp kst = {0}; +size_t len = sizeof(kst); +int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_SIGTRAMP, getpid()}; +if (sysctl(mib, 4, &kst, &len, NULL, 0) == 0) { + _isSigTrampDetermined = true; + _sigTrampStart = reinterpret_cast(kst.ksigtramp_start); + _sigTrampEnd = reinterpret_cast(kst.ksigtramp_end); +} + } + + if (_isSigTrampDetermined == false || + (pc < _sigTrampStart || pc >= _sigTrampEnd)) +return false; + + _info = {}; + _info.start_ip = _sigTrampStart; + _info.end_ip = _sigTrampEnd; + _isSigReturn = true; + return true; +} + +template +int UnwindCursor::stepThroughSigReturn(Registers_arm64 &) { + // In the signal trampoline
[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)
@@ -39,6 +39,9 @@ # if defined(__HAIKU__) # define _LIBUNWIND_TARGET_HAIKU 1 # endif +#if defined(__FreeBSD__) emaste wrote: Yes, libunwind change was included by accident - I just let the CI jobs finish rather than restarting; I will update the pull req to fix. https://github.com/llvm/llvm-project/pull/86658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)
emaste wrote: > The C++26 job is part of the first jobs that get run' Oops, I did miss that. I think this would be the only buildkite job using `generic-cxx26` https://github.com/llvm/llvm-project/pull/86658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
@@ -247,12 +247,8 @@ std::unique_ptr AllocateTarget(const llvm::Triple &Triple, switch (os) { case llvm::Triple::Linux: return std::make_unique>(Triple, Opts); -case llvm::Triple::FreeBSD: emaste wrote: OK - there are no supported FreeBSD releases left that support armeb, and it was uncommon enough that I can't imagine anyone wants to use contemporary clang to target unsupported releases. https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
@@ -163,9 +163,9 @@ // CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp" // CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs" -// RUN: %clang --target=sparc-unknown-freebsd -### %s -fpic -no-integrated-as 2>&1 \ -// RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s -// CHECK-SPARC-PIE: as{{.*}}" "-KPIC +// RUN: %clang --target=sparc64-unknown-freebsd -### %s -fpic -no-integrated-as 2>&1 \ emaste wrote: fwiw sparc64 is still supported in FreeBSD 12.x, but that is EOL at the end of the year, so this could go before too long as well https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
@@ -191,11 +191,6 @@ // RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s // CHECK-MIPS64-CPU: "-target-cpu" "mips3" -// Check that the integrated assembler is enabled for SPARC64 emaste wrote: why is this part here (before sparc64 is removed from FreeBSD)? It is not covered by the commit message anyway, afaict https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
https://github.com/emaste commented: overall looks fine, no objection from FreeBSD. one open question. https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
https://github.com/emaste approved this pull request. https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
https://github.com/emaste edited https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Clean up unused architecture related bits for *BSD's (PR #69809)
@@ -191,11 +191,6 @@ // RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s // CHECK-MIPS64-CPU: "-target-cpu" "mips3" -// Check that the integrated assembler is enabled for SPARC64 emaste wrote: Maybe worth noting that in the commit message too but either way LGTM for FreeBSD https://github.com/llvm/llvm-project/pull/69809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r370779 - clang: default to DWARF 4 for FreeBSD 12.0 and later
Author: emaste Date: Tue Sep 3 09:30:21 2019 New Revision: 370779 URL: http://llvm.org/viewvc/llvm-project?rev=370779&view=rev Log: clang: default to DWARF 4 for FreeBSD 12.0 and later Older FreeBSD versions included GDB 6.1 and had other tools that were unable to handle debug information newer than DWARF 2. Those tools have since been updated. (An old version of GDB is still kept for kernel crash handling, but the kernel is compiled with an explicit -gdwarf2.) Reviewed by:dim Differential Revision: https://reviews.llvm.org/D66760 Modified: cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp cfe/trunk/lib/Driver/ToolChains/FreeBSD.h cfe/trunk/test/Driver/debug-options.c Modified: cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp?rev=370779&r1=370778&r2=370779&view=diff == --- cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/FreeBSD.cpp Tue Sep 3 09:30:21 2019 @@ -364,6 +364,12 @@ ToolChain::CXXStdlibType FreeBSD::GetDef return ToolChain::CST_Libstdcxx; } +unsigned FreeBSD::GetDefaultDwarfVersion() const { + if (getTriple().getOSMajorVersion() < 12) +return 2; + return 4; +} + void FreeBSD::addLibStdCxxIncludePaths( const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const { Modified: cfe/trunk/lib/Driver/ToolChains/FreeBSD.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/FreeBSD.h?rev=370779&r1=370778&r2=370779&view=diff == --- cfe/trunk/lib/Driver/ToolChains/FreeBSD.h (original) +++ cfe/trunk/lib/Driver/ToolChains/FreeBSD.h Tue Sep 3 09:30:21 2019 @@ -69,7 +69,7 @@ public: const llvm::opt::ArgList &Args) const override; bool isPIEDefault() const override; SanitizerMask getSupportedSanitizers() const override; - unsigned GetDefaultDwarfVersion() const override { return 2; } + unsigned GetDefaultDwarfVersion() const override; // Until dtrace (via CTF) and LLDB can deal with distributed debug info, // FreeBSD defaults to standalone/full debug info. bool GetDefaultStandaloneDebug() const override { return true; } Modified: cfe/trunk/test/Driver/debug-options.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=370779&r1=370778&r2=370779&view=diff == --- cfe/trunk/test/Driver/debug-options.c (original) +++ cfe/trunk/test/Driver/debug-options.c Tue Sep 3 09:30:21 2019 @@ -66,8 +66,12 @@ // RUN: -check-prefix=G_DWARF4 %s // FreeBSD. -// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd10.0 2>&1 \ -// RUN: | FileCheck -check-prefix=G_GDB %s +// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_GDB \ +// RUN: -check-prefix=G_DWARF2 %s +// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_GDB \ +// RUN: -check-prefix=G_DWARF4 %s // Windows. // RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 699d474 - [Driver] do not link _p libs for -pg on FreeBSD 14 and later
Author: Ed Maste Date: 2021-06-26T17:47:54-04:00 New Revision: 699d47472c3f7c5799fe75486689545179cfba03 URL: https://github.com/llvm/llvm-project/commit/699d47472c3f7c5799fe75486689545179cfba03 DIFF: https://github.com/llvm/llvm-project/commit/699d47472c3f7c5799fe75486689545179cfba03.diff LOG: [Driver] do not link _p libs for -pg on FreeBSD 14 and later In FreeBSD 14 the project will deprecate the _p special profiling libraries. Support for -pg (i.e., mcount) still exists but libraries compiled with -pg will not be built by default, so stop linking against them. Reviewed by:Dimitry Andric Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D104753 Added: Modified: clang/lib/Driver/ToolChains/FreeBSD.cpp clang/test/Driver/freebsd.cpp Removed: diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp index f8c6a81bf3bc0..5dcf74dabf4fc 100644 --- a/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -293,6 +293,8 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); + bool Profiling = Args.hasArg(options::OPT_pg) && + ToolChain.getTriple().getOSMajorVersion() < 14; if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { // Use the static OpenMP runtime with -static-openmp bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) && @@ -302,7 +304,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (D.CCCIsCXX()) { if (ToolChain.ShouldLinkCXXStdlib(Args)) ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs); - if (Args.hasArg(options::OPT_pg)) + if (Profiling) CmdArgs.push_back("-lm_p"); else CmdArgs.push_back("-lm"); @@ -313,13 +315,13 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, linkXRayRuntimeDeps(ToolChain, CmdArgs); // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding // the default system libraries. Just mimic this for now. -if (Args.hasArg(options::OPT_pg)) +if (Profiling) CmdArgs.push_back("-lgcc_p"); else CmdArgs.push_back("-lgcc"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-lgcc_eh"); -} else if (Args.hasArg(options::OPT_pg)) { +} else if (Profiling) { CmdArgs.push_back("-lgcc_eh_p"); } else { CmdArgs.push_back("--as-needed"); @@ -328,13 +330,13 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, } if (Args.hasArg(options::OPT_pthread)) { - if (Args.hasArg(options::OPT_pg)) + if (Profiling) CmdArgs.push_back("-lpthread_p"); else CmdArgs.push_back("-lpthread"); } -if (Args.hasArg(options::OPT_pg)) { +if (Profiling) { if (Args.hasArg(options::OPT_shared)) CmdArgs.push_back("-lc"); else @@ -347,7 +349,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-lgcc_eh"); -} else if (Args.hasArg(options::OPT_pg)) { +} else if (Profiling) { CmdArgs.push_back("-lgcc_eh_p"); } else { CmdArgs.push_back("--as-needed"); @@ -416,7 +418,8 @@ void FreeBSD::addLibStdCxxIncludePaths( void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args, ArgStringList &CmdArgs) const { CXXStdlibType Type = GetCXXStdlibType(Args); - bool Profiling = Args.hasArg(options::OPT_pg); + bool Profiling = + Args.hasArg(options::OPT_pg) && getTriple().getOSMajorVersion() < 14; switch (Type) { case ToolChain::CST_Libcxx: diff --git a/clang/test/Driver/freebsd.cpp b/clang/test/Driver/freebsd.cpp index baf52f77dd07f..fde888902e12c 100644 --- a/clang/test/Driver/freebsd.cpp +++ b/clang/test/Driver/freebsd.cpp @@ -5,9 +5,12 @@ // CHECK-TEN: "-lc++" "-lm" // CHECK-NINE: "-lstdc++" "-lm" +// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd40.0 -stdlib=platform 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PG-FOURTEEN %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s +// CHECK-PG-FOURTEEN: "-lc++" "-lm" // CHECK-PG-TEN: "-lc++_p" "-lm_p" // CHECK-PG-NINE: "-lstdc++_p" "-lm_p" ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 462cf39 - [Driver] Fix -gz=zlib options for linker also on FreeBSD
Author: Ed Maste Date: 2021-03-02T08:44:24-05:00 New Revision: 462cf39a5c180621b56f7602270ce33eb7b68d23 URL: https://github.com/llvm/llvm-project/commit/462cf39a5c180621b56f7602270ce33eb7b68d23 DIFF: https://github.com/llvm/llvm-project/commit/462cf39a5c180621b56f7602270ce33eb7b68d23.diff LOG: [Driver] Fix -gz=zlib options for linker also on FreeBSD ccb4124a4172 fixed translating -gz=zlib to --compress-debug-sections for linker invocation for several ToolChains, but omitted FreeBSD. Differential Revision: https://reviews.llvm.org/D97752 Added: Modified: clang/lib/Driver/ToolChains/FreeBSD.cpp clang/test/Driver/compress.c Removed: diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp index 4524d9b8a85c..d59bb6f8c3b0 100644 --- a/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -290,6 +290,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs); bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs); + addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { diff --git a/clang/test/Driver/compress.c b/clang/test/Driver/compress.c index 9e3bf81f73e6..e6eff3f54dab 100644 --- a/clang/test/Driver/compress.c +++ b/clang/test/Driver/compress.c @@ -25,6 +25,7 @@ // RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib -x assembler %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s // RUN: %clang -### -target x86_64-unknown-linux-gnu -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s +// RUN: %clang -### -target x86_64-unknown-freebsd -gz=zlib %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s // CHECK-OPT_GZ_EQ_ZLIB: {{.* "-cc1(as)?".* "--compress-debug-sections=zlib"}} // CHECK-OPT_GZ_EQ_ZLIB: "--compress-debug-sections=zlib" ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] a40dcd0 - [Driver] correct typo in FreeBSD 14 test
Author: Ed Maste Date: 2021-11-22T14:37:27-05:00 New Revision: a40dcd060e9d374d68df53b881d62e4de2bc310a URL: https://github.com/llvm/llvm-project/commit/a40dcd060e9d374d68df53b881d62e4de2bc310a DIFF: https://github.com/llvm/llvm-project/commit/a40dcd060e9d374d68df53b881d62e4de2bc310a.diff LOG: [Driver] correct typo in FreeBSD 14 test The test specified amd64-unknown-freebsd40.0 rather than 14.0. Since 40 is greater than 14 the test (for behaviour new in FreeBSD 14) worked despite the typo. Fixes: 699d47472c3f Reviewed by:dim (in D6) Added: Modified: clang/test/Driver/freebsd.cpp Removed: diff --git a/clang/test/Driver/freebsd.cpp b/clang/test/Driver/freebsd.cpp index fde888902e12c..d199f6e2367ab 100644 --- a/clang/test/Driver/freebsd.cpp +++ b/clang/test/Driver/freebsd.cpp @@ -5,7 +5,7 @@ // CHECK-TEN: "-lc++" "-lm" // CHECK-NINE: "-lstdc++" "-lm" -// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd40.0 -stdlib=platform 2>&1 \ +// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd14.0 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-FOURTEEN %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 2dec2aa - [Driver] Default to libc++ on FreeBSD
Author: Jan Beich Date: 2021-11-22T16:47:03-05:00 New Revision: 2dec2aa3ad083dbde838809f0e8c7ae31110e111 URL: https://github.com/llvm/llvm-project/commit/2dec2aa3ad083dbde838809f0e8c7ae31110e111 DIFF: https://github.com/llvm/llvm-project/commit/2dec2aa3ad083dbde838809f0e8c7ae31110e111.diff LOG: [Driver] Default to libc++ on FreeBSD All supported FreeBSD releases use libc++, so default to it if the target's major version is not specified. Reviewed by:dim, emaste Differential Revision: https://reviews.llvm.org/D6 Added: Modified: clang/lib/Driver/ToolChains/FreeBSD.cpp clang/test/Driver/freebsd.cpp Removed: diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp index dc05f9893465..d08ea282f6df 100644 --- a/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -391,7 +391,8 @@ FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &Triple, } ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibType() const { - if (getTriple().getOSMajorVersion() >= 10) + unsigned Major = getTriple().getOSMajorVersion(); + if (Major >= 10 || Major == 0) return ToolChain::CST_Libcxx; return ToolChain::CST_Libstdcxx; } diff --git a/clang/test/Driver/freebsd.cpp b/clang/test/Driver/freebsd.cpp index d199f6e2367a..512d29eeb64a 100644 --- a/clang/test/Driver/freebsd.cpp +++ b/clang/test/Driver/freebsd.cpp @@ -1,16 +1,22 @@ +// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd -stdlib=platform 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s // RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-TEN %s // RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd9.2 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NINE %s +// CHECK-DEFAULT: "-lc++" "-lm" // CHECK-TEN: "-lc++" "-lm" // CHECK-NINE: "-lstdc++" "-lm" +// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd -stdlib=platform 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PG-DEFAULT %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd14.0 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-FOURTEEN %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s +// CHECK-PG-DEFAULT: "-lc++_p" "-lm_p" // CHECK-PG-FOURTEEN: "-lc++" "-lm" // CHECK-PG-TEN: "-lc++_p" "-lm_p" // CHECK-PG-NINE: "-lstdc++_p" "-lm_p" ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Remove FreeBSD/riscv32 support (PR #67277)
https://github.com/emaste approved this pull request. Sure; we're generally moving away from supporting any 32-bit platforms so it is exceedingly unlikely that we would add riscv32 support. https://github.com/llvm/llvm-project/pull/67277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Silence stdlib warning when linking C on FreeBSD (PR #68011)
https://github.com/emaste approved this pull request. https://github.com/llvm/llvm-project/pull/68011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Silence stdlib warning when linking C on FreeBSD (PR #68011)
emaste wrote: Yeah, I don't see any reason there'd be a problem with this. It seems a bit silly for build systems to pass this in, but if they do there's no value in reporting it. https://github.com/llvm/llvm-project/pull/68011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Silence stdlib warning when linking C on FreeBSD (PR #68011)
emaste wrote: > It handles both cases. It simply claims all the -stdlib= arguments. If I understand correctly this means in effect `-stdlib=` becomes a don't-care when linking C, and anyhow it already had no effect. https://github.com/llvm/llvm-project/pull/68011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Driver] Silence stdlib warning when linking C on FreeBSD (PR #68011)
https://github.com/emaste closed https://github.com/llvm/llvm-project/pull/68011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] cb17614 - clang: enable unwind tables on FreeBSD !amd64
Author: Ed Maste Date: 2019-11-15T10:37:45-05:00 New Revision: cb1761465a0d4c904f4fca489afe97478382b553 URL: https://github.com/llvm/llvm-project/commit/cb1761465a0d4c904f4fca489afe97478382b553 DIFF: https://github.com/llvm/llvm-project/commit/cb1761465a0d4c904f4fca489afe97478382b553.diff LOG: clang: enable unwind tables on FreeBSD !amd64 There doesn't seem to be much sense in defaulting "on" unwind tables on amd64 and not on other arches. It causes surprising differences between platforms, such as the PR below[1]. Prior to this change, FreeBSD inherited the default implementation of the method from the Gnu.h Generic_Elf => Generic_GCC parent class, which returned true only for amd64 targets. Override that and opt on always, similar to, e.g., NetBSD's driver. [1] https://bugs.freebsd.org/241562 Patch by cem (Conrad Meyer). Reviewed By: dim Differential Revision: https://reviews.llvm.org/D70110 Added: Modified: clang/lib/Driver/ToolChains/FreeBSD.cpp clang/lib/Driver/ToolChains/FreeBSD.h clang/test/Driver/freebsd.c Removed: diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp index 7c891a24ba30..5e2c4883290f 100644 --- a/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -420,6 +420,8 @@ llvm::ExceptionHandling FreeBSD::GetExceptionModel(const ArgList &Args) const { bool FreeBSD::HasNativeLLVMSupport() const { return true; } +bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; } + bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); } SanitizerMask FreeBSD::getSupportedSanitizers() const { diff --git a/clang/lib/Driver/ToolChains/FreeBSD.h b/clang/lib/Driver/ToolChains/FreeBSD.h index d17b3808ffac..1d503a621d0e 100644 --- a/clang/lib/Driver/ToolChains/FreeBSD.h +++ b/clang/lib/Driver/ToolChains/FreeBSD.h @@ -67,6 +67,7 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF { llvm::ExceptionHandling GetExceptionModel( const llvm::opt::ArgList &Args) const override; + bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override; bool isPIEDefault() const override; SanitizerMask getSupportedSanitizers() const override; unsigned GetDefaultDwarfVersion() const override; diff --git a/clang/test/Driver/freebsd.c b/clang/test/Driver/freebsd.c index 4a0a6bf5f39c..dc209704d7ab 100644 --- a/clang/test/Driver/freebsd.c +++ b/clang/test/Driver/freebsd.c @@ -197,3 +197,7 @@ // RUN: %clang -target sparc64-unknown-freebsd -### -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-IAS %s // CHECK-IAS-NOT: "-no-integrated-as" + +// RUN: %clang -target ppc64-unknown-freebsd13.0 -### -S %s 2>&1 | \ +// RUN: FileCheck -check-prefix=PPC64-MUNWIND %s +// PPC64-MUNWIND: -munwind-table ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r280086 - libunwind: correct 'libuwind' typo
Author: emaste Date: Tue Aug 30 08:08:21 2016 New Revision: 280086 URL: http://llvm.org/viewvc/llvm-project?rev=280086&view=rev Log: libunwind: correct 'libuwind' typo There were several instances of libuwind (missing an "n"), dating to the initial import of libunwind. Modified: libunwind/trunk/include/libunwind.h libunwind/trunk/src/Unwind-EHABI.cpp libunwind/trunk/src/UnwindCursor.hpp libunwind/trunk/src/UnwindLevel1-gcc-ext.c libunwind/trunk/src/UnwindLevel1.c libunwind/trunk/src/config.h libunwind/trunk/src/libunwind.cpp Modified: libunwind/trunk/include/libunwind.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/libunwind.h?rev=280086&r1=280085&r2=280086&view=diff == --- libunwind/trunk/include/libunwind.h (original) +++ libunwind/trunk/include/libunwind.h Tue Aug 30 08:08:21 2016 @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// Compatible with libuwind API documented at: +// Compatible with libunwind API documented at: // http://www.nongnu.org/libunwind/man/libunwind(3).html // //===--===// @@ -120,7 +120,7 @@ extern int unw_init_remote_thread(unw_cu #endif /* UNW_REMOTE */ /* - * traditional libuwind "remote" API + * traditional libunwind "remote" API * NOT IMPLEMENTED on Mac OS X * * extern int unw_init_remote(unw_cursor_t*, unw_addr_space_t, Modified: libunwind/trunk/src/Unwind-EHABI.cpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-EHABI.cpp?rev=280086&r1=280085&r2=280086&view=diff == --- libunwind/trunk/src/Unwind-EHABI.cpp (original) +++ libunwind/trunk/src/Unwind-EHABI.cpp Tue Aug 30 08:08:21 2016 @@ -549,7 +549,7 @@ static _Unwind_Reason_Code unwind_phase2 // Walk each frame until we reach where search phase said to stop. while (true) { -// Ask libuwind to get next frame (skip over first which is +// Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException or _Unwind_Resume). // // Resume only ever makes sense for 1 frame. Modified: libunwind/trunk/src/UnwindCursor.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=280086&r1=280085&r2=280086&view=diff == --- libunwind/trunk/src/UnwindCursor.hpp (original) +++ libunwind/trunk/src/UnwindCursor.hpp Tue Aug 30 08:08:21 2016 @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// C++ interface to lower levels of libuwind +// C++ interface to lower levels of libunwind //===--===// #ifndef __UNWINDCURSOR_HPP__ Modified: libunwind/trunk/src/UnwindLevel1-gcc-ext.c URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindLevel1-gcc-ext.c?rev=280086&r1=280085&r2=280086&view=diff == --- libunwind/trunk/src/UnwindLevel1-gcc-ext.c (original) +++ libunwind/trunk/src/UnwindLevel1-gcc-ext.c Tue Aug 30 08:08:21 2016 @@ -123,7 +123,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb _Unwind_Reason_Code result; #if !_LIBUNWIND_ARM_EHABI -// ask libuwind to get next frame (skip over first frame which is +// ask libunwind to get next frame (skip over first frame which is // _Unwind_Backtrace()) if (unw_step(&cursor) <= 0) { _LIBUNWIND_TRACE_UNWINDING(" _backtrace: ended because cursor reached " Modified: libunwind/trunk/src/UnwindLevel1.c URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindLevel1.c?rev=280086&r1=280085&r2=280086&view=diff == --- libunwind/trunk/src/UnwindLevel1.c (original) +++ libunwind/trunk/src/UnwindLevel1.c Tue Aug 30 08:08:21 2016 @@ -39,7 +39,7 @@ unwind_phase1(unw_context_t *uc, unw_cur // Walk each frame looking for a place to stop. bool handlerNotFound = true; while (handlerNotFound) { -// Ask libuwind to get next frame (skip over first which is +// Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException). int stepResult = unw_step(cursor); if (stepResult == 0) { @@ -135,7 +135,7 @@ unwind_phase2(unw_context_t *uc, unw_cur // Walk each frame until we reach where search phase said to stop. while (true) { -// Ask libuwind to get next frame (skip over first which is +// Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException). int stepResult = unw_step(cursor); if (stepResult == 0) { Modified: libunwind/trunk/src/config.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/config.h?rev=280086&r1=2800
[libunwind] r280099 - libunwind: fix X86 register numbers for FreeBSD/i386
Author: emaste Date: Tue Aug 30 10:10:08 2016 New Revision: 280099 URL: http://llvm.org/viewvc/llvm-project?rev=280099&view=rev Log: libunwind: fix X86 register numbers for FreeBSD/i386 For historical reasons i386 has ebp and esp swapped in the eh_frame register numbering on at least Darwin. That is: Darwin FreeBSD Reg #eh_frameeh_frameDWARF == 4ebp espesp 5esp ebpebp Although the UNW_X86_* constants are not intended to be coupled with DWARF / eh_frame numbering they are currently conflated in libunwind. Differential Revision: https://reviews.llvm.org/D22508 Modified: libunwind/trunk/include/libunwind.h Modified: libunwind/trunk/include/libunwind.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/libunwind.h?rev=280099&r1=280098&r2=280099&view=diff == --- libunwind/trunk/include/libunwind.h (original) +++ libunwind/trunk/include/libunwind.h Tue Aug 30 10:10:08 2016 @@ -151,8 +151,13 @@ enum { UNW_X86_ECX = 1, UNW_X86_EDX = 2, UNW_X86_EBX = 3, +#ifdef __FreeBSD__ + UNW_X86_ESP = 4, + UNW_X86_EBP = 5, +#else UNW_X86_EBP = 4, UNW_X86_ESP = 5, +#endif UNW_X86_ESI = 6, UNW_X86_EDI = 7 }; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r280103 - consistently add \n to log and trace messages
Author: emaste Date: Tue Aug 30 10:38:10 2016 New Revision: 280103 URL: http://llvm.org/viewvc/llvm-project?rev=280103&view=rev Log: consistently add \n to log and trace messages Previously most messages included a newline in the string, but a few of them were missing. Fix these and simplify by just adding the newline in the _LIBUNWIND_LOG macro itself. Differential Revision: https://reviews.llvm.org/D24026 Modified: libunwind/trunk/src/AddressSpace.hpp libunwind/trunk/src/CompactUnwinder.hpp libunwind/trunk/src/EHHeaderParser.hpp libunwind/trunk/src/Unwind-EHABI.cpp libunwind/trunk/src/Unwind-sjlj.c libunwind/trunk/src/UnwindCursor.hpp libunwind/trunk/src/UnwindLevel1-gcc-ext.c libunwind/trunk/src/UnwindLevel1.c libunwind/trunk/src/config.h libunwind/trunk/src/libunwind.cpp Modified: libunwind/trunk/src/AddressSpace.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=280103&r1=280102&r2=280103&view=diff == --- libunwind/trunk/src/AddressSpace.hpp (original) +++ libunwind/trunk/src/AddressSpace.hpp Tue Aug 30 10:38:10 2016 @@ -373,7 +373,7 @@ inline bool LocalAddressSpace::findUnwin (_Unwind_Ptr) targetAddr, &length); info.arm_section_length = (uintptr_t)length; #endif - _LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x\n", + _LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x", info.arm_section, info.arm_section_length); if (info.arm_section && info.arm_section_length) return true; Modified: libunwind/trunk/src/CompactUnwinder.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CompactUnwinder.hpp?rev=280103&r1=280102&r2=280103&view=diff == --- libunwind/trunk/src/CompactUnwinder.hpp (original) +++ libunwind/trunk/src/CompactUnwinder.hpp Tue Aug 30 10:38:10 2016 @@ -105,7 +105,7 @@ int CompactUnwinder_x86::stepWithComp default: (void)functionStart; _LIBUNWIND_DEBUG_LOG("bad register for EBP frame, encoding=%08X for " - "function starting at 0x%X\n", + "function starting at 0x%X", compactEncoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -224,7 +224,7 @@ int CompactUnwinder_x86::stepWithComp break; default: _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " - "function starting at 0x%X\n", + "function starting at 0x%X", encoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -336,7 +336,7 @@ int CompactUnwinder_x86_64::stepWithC default: (void)functionStart; _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for " - "function starting at 0x%llX\n", + "function starting at 0x%llX", compactEncoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -455,7 +455,7 @@ int CompactUnwinder_x86_64::stepWithC break; default: _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " - "function starting at 0x%llX\n", + "function starting at 0x%llX", encoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } Modified: libunwind/trunk/src/EHHeaderParser.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/EHHeaderParser.hpp?rev=280103&r1=280102&r2=280103&view=diff == --- libunwind/trunk/src/EHHeaderParser.hpp (original) +++ libunwind/trunk/src/EHHeaderParser.hpp Tue Aug 30 10:38:10 2016 @@ -85,7 +85,7 @@ bool EHHeaderParser::decodeTableEntry const char *message = CFI_Parser::decodeFDE(addressSpace, fde, fdeInfo, cieInfo); if (message != NULL) { -_LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s\n", +_LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s", message); return false; } Modified: libunwind/trunk/src/Unwind-EHABI.cpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-EHABI.cpp?rev=280103&r1=280102&r2=280103&view=diff == --- libunwind/trunk/src/Unwind-EHABI.cpp (original) +++ libunwind/trunk/src/Unwind-EHABI.cpp Tue Aug 30 10:38:10 2016 @@ -456,7 +456,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_proc_info_t frameInfo; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING(
Re: [PATCH] D22130: Link static PIE programs against rcrt0.o on OpenBSD
emaste added a comment. Seems fine to me, but I'm not particularly knowledgeable about OpenBSD's toolchain. https://reviews.llvm.org/D22130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r244892 - Correct sense of unwind return address register range assertion
Author: emaste Date: Thu Aug 13 08:45:45 2015 New Revision: 244892 URL: http://llvm.org/viewvc/llvm-project?rev=244892&view=rev Log: Correct sense of unwind return address register range assertion I encountered this on FreeBSD/arm64, and then found the same issue was reported by Daniil Troshkov. Modified: libunwind/trunk/src/DwarfInstructions.hpp Modified: libunwind/trunk/src/DwarfInstructions.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/DwarfInstructions.hpp?rev=244892&r1=244891&r2=244892&view=diff == --- libunwind/trunk/src/DwarfInstructions.hpp (original) +++ libunwind/trunk/src/DwarfInstructions.hpp Thu Aug 13 08:45:45 2015 @@ -170,7 +170,7 @@ int DwarfInstructions::stepWithDwa const int lastReg = R::lastDwarfRegNum(); assert((int)CFI_Parser::kMaxRegisterNumber > lastReg && "register range too large"); - assert(lastReg <= (int)cieInfo.returnAddressRegister && + assert(lastReg >= (int)cieInfo.returnAddressRegister && "register range does not contain return address register"); for (int i = 0; i <= lastReg; ++i) { if (prolog.savedRegisters[i].location != ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r244893 - Enable zero-cost exceptions on non-Apple arm64 platforms
Author: emaste Date: Thu Aug 13 09:21:03 2015 New Revision: 244893 URL: http://llvm.org/viewvc/llvm-project?rev=244893&view=rev Log: Enable zero-cost exceptions on non-Apple arm64 platforms Use the canonical __aarch64__ predefined macro for 64-bit ARM. Apple- specific cases are left as __arm64__. Also add an #error for unsupported architectures to catch this sort of case in the future. Differential Revision: http://reviews.llvm.org/D12005 Modified: libunwind/trunk/src/config.h libunwind/trunk/src/libunwind.cpp Modified: libunwind/trunk/src/config.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/config.h?rev=244893&r1=244892&r2=244893&view=diff == --- libunwind/trunk/src/config.h (original) +++ libunwind/trunk/src/config.h Thu Aug 13 09:21:03 2015 @@ -72,7 +72,8 @@ #define _LIBUNWIND_BUILD_ZERO_COST_APIS (defined(__i386__) || \ defined(__x86_64__) || \ - defined(__arm__)) + defined(__arm__) || \ + defined(__aarch64__)) #define _LIBUNWIND_BUILD_SJLJ_APIS 0 #define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) || \ defined(__x86_64__)) Modified: libunwind/trunk/src/libunwind.cpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/libunwind.cpp?rev=244893&r1=244892&r2=244893&view=diff == --- libunwind/trunk/src/libunwind.cpp (original) +++ libunwind/trunk/src/libunwind.cpp Thu Aug 13 09:21:03 2015 @@ -58,12 +58,14 @@ _LIBUNWIND_EXPORT int unw_init_local(unw #elif defined(__ppc__) new ((void *)cursor) UnwindCursor( context, LocalAddressSpace::sThisAddressSpace); -#elif defined(__arm64__) +#elif defined(__arm64__) || defined(__aarch64__) new ((void *)cursor) UnwindCursor( context, LocalAddressSpace::sThisAddressSpace); #elif _LIBUNWIND_ARM_EHABI new ((void *)cursor) UnwindCursor( context, LocalAddressSpace::sThisAddressSpace); +#else +#error Architecture not supported #endif AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor; co->setInfoBasedOnIPRegister(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r250252 - This patch adds missing pieces to clang, including the PS4 toolchain
On 13 October 2015 at 23:40, Ekaterina Romanova via cfe-commits wrote: > Author: kromanova > Date: Tue Oct 13 18:40:02 2015 > New Revision: 250252 > > URL: http://llvm.org/viewvc/llvm-project?rev=250252&view=rev > Log: > This patch adds missing pieces to clang, including the PS4 toolchain > definition, added warnings, PS4 defaults, and Driver changes needed for > our compiler. This broke the build on FreeBSD: ../tools/clang/lib/Driver/ToolChains.cpp:4083:17: error: use of undeclared identifier 'EnvValue' PS4SDKDir = EnvValue; ^ ../tools/clang/lib/Driver/ToolChains.cpp:4084:5: error: expected unqualified-id } else { ^ ../tools/clang/lib/Driver/ToolChains.cpp:4094:3: error: expected unqualified-id if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) { ^ ../tools/clang/lib/Driver/ToolChains.cpp:4098:5: error: expected unqualified-id } else ^ ../tools/clang/lib/Driver/ToolChains.cpp:4102:20: error: C++ requires a type specifier for all declarations llvm::sys::path::append(PS4SDKIncludeDir, "target/include"); ^ ../tools/clang/lib/Driver/ToolChains.cpp:4103:3: error: expected unqualified-id if (!Args.hasArg(options::OPT_nostdinc) && ^ ../tools/clang/lib/Driver/ToolChains.cpp:4112:33: error: unknown type name 'PS4SDKDir' SmallString<512> PS4SDKLibDir(PS4SDKDir); ^ ../tools/clang/lib/Driver/ToolChains.cpp:4113:20: error: C++ requires a type specifier for all declarations llvm::sys::path::append(PS4SDKLibDir, "target/lib"); ^ ../tools/clang/lib/Driver/ToolChains.cpp:4114:3: error: expected unqualified-id if (!Args.hasArg(options::OPT_nostdlib) && ^ ../tools/clang/lib/Driver/ToolChains.cpp:4124:17: error: expected function body after function declarator getFilePaths().push_back(PS4SDKLibDir.str()); ^ ../tools/clang/lib/Driver/ToolChains.cpp:4125:1: error: extraneous closing brace ('}') } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D13482: Revised Initial patch for PS4 toolchain
emaste added a subscriber: emaste. Comment at: cfe/trunk/lib/Driver/ToolChains.cpp:4080 @@ +4079,3 @@ + SmallString<512> PS4SDKDir; + if (const char *EnvValue = getenv("SCE_PS4_SDK_DIR")) +if (!llvm::sys::fs::exists(EnvValue)) Looks like a missing { here Repository: rL LLVM http://reviews.llvm.org/D13482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D13482: Revised Initial patch for PS4 toolchain
emaste added a comment. > Can we get this fixed or reversed out? Thanks! It's already reverted. Repository: rL LLVM http://reviews.llvm.org/D13482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D13820: [libunwind] Add FreeBSD _Unwind_Ptr typedef
emaste created this revision. emaste added a subscriber: cfe-commits. http://reviews.llvm.org/D13820 Files: src/AddressSpace.hpp Index: src/AddressSpace.hpp === --- src/AddressSpace.hpp +++ src/AddressSpace.hpp @@ -35,7 +35,11 @@ #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); Index: src/AddressSpace.hpp === --- src/AddressSpace.hpp +++ src/AddressSpace.hpp @@ -35,7 +35,11 @@ #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D13820: [libunwind] Add FreeBSD _Unwind_Ptr typedef
This revision was automatically updated to reflect the committed changes. Closed by commit rL250541: Add FreeBSD _Unwind_Ptr typedef (authored by emaste). Changed prior to commit: http://reviews.llvm.org/D13820?vs=37615&id=37628#toc Repository: rL LLVM http://reviews.llvm.org/D13820 Files: libunwind/trunk/src/AddressSpace.hpp Index: libunwind/trunk/src/AddressSpace.hpp === --- libunwind/trunk/src/AddressSpace.hpp +++ libunwind/trunk/src/AddressSpace.hpp @@ -35,7 +35,11 @@ #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); Index: libunwind/trunk/src/AddressSpace.hpp === --- libunwind/trunk/src/AddressSpace.hpp +++ libunwind/trunk/src/AddressSpace.hpp @@ -35,7 +35,11 @@ #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r250541 - Add FreeBSD _Unwind_Ptr typedef
Author: emaste Date: Fri Oct 16 14:40:09 2015 New Revision: 250541 URL: http://llvm.org/viewvc/llvm-project?rev=250541&view=rev Log: Add FreeBSD _Unwind_Ptr typedef Differential Revision: http://reviews.llvm.org/D13820 Modified: libunwind/trunk/src/AddressSpace.hpp Modified: libunwind/trunk/src/AddressSpace.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=250541&r1=250540&r2=250541&view=diff == --- libunwind/trunk/src/AddressSpace.hpp (original) +++ libunwind/trunk/src/AddressSpace.hpp Fri Oct 16 14:40:09 2015 @@ -35,7 +35,11 @@ namespace libunwind { #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [Diffusion] rL248379: Refactor library decision for -fopenmp support from Darwin into a
emaste added a subscriber: emaste. Users: joerg (Author, Auditor) 3.7-release (Auditor) cfe-commits (Auditor) tstellarAMD (Auditor) http://reviews.llvm.org/rL248379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!
emaste added a subscriber: emaste. Comment at: docs/Proposals/GitHub.rst:8-9 @@ +7,4 @@ + +This is a proposal to move our current revision control system from Subversion +to GitHub. Below are the financial and technical arguments as to why we need +such a move and how will people (and validation infrastructure) continue to work It seems pedantic, but I think we should try hard to avoid conflating Git and GitHub. What about: "move our revision control system from //self-hosted// Subversion to Git hosted by GitHub." Comment at: docs/Proposals/GitHub.rst:93 @@ +92,3 @@ +Furthermore, GitHub has an *SVN view* (https://github.com/blog/626-announcing-svn-support) +where people stuck with SVN infrastructure and tooling can slowly migrate or +even stay working as if it was an SVN repository (including read-write access). Replace "stuck" with something neutral. "stuck" implies that everyone will want to move but some may not be able to for technical or other reasons, but some people actually prefer SVN. Comment at: docs/Proposals/GitHub.rst:180 @@ +179,3 @@ + +As soon as we decide to move, we'll have to set a date for the process to begin. + This presents it as if the decision is already made, which somewhat defeats the purpose of writing a proposal for the LLVM community to vote on. Maybe "If we decide to move"? https://reviews.llvm.org/D22463 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r275996 - libunwind: Use conventional DWARF capitalization in comments and errors
Author: emaste Date: Tue Jul 19 12:15:50 2016 New Revision: 275996 URL: http://llvm.org/viewvc/llvm-project?rev=275996&view=rev Log: libunwind: Use conventional DWARF capitalization in comments and errors Modified: libunwind/trunk/include/libunwind.h libunwind/trunk/include/mach-o/compact_unwind_encoding.h libunwind/trunk/include/unwind.h libunwind/trunk/src/AddressSpace.hpp libunwind/trunk/src/DwarfInstructions.hpp libunwind/trunk/src/DwarfParser.hpp libunwind/trunk/src/UnwindLevel1-gcc-ext.c libunwind/trunk/src/libunwind.cpp Modified: libunwind/trunk/include/libunwind.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/libunwind.h?rev=275996&r1=275995&r2=275996&view=diff == --- libunwind/trunk/include/libunwind.h (original) +++ libunwind/trunk/include/libunwind.h Tue Jul 19 12:15:50 2016 @@ -75,8 +75,8 @@ struct unw_proc_info_t { unw_word_t gp; /* not used */ unw_word_t flags;/* not used */ uint32_tformat; /* compact unwind encoding, or zero if none */ - uint32_tunwind_info_size; /* size of dwarf unwind info, or zero if none */ - unw_word_t unwind_info; /* address of dwarf unwind info, or zero */ + uint32_tunwind_info_size; /* size of DWARF unwind info, or zero if none */ + unw_word_t unwind_info; /* address of DWARF unwind info, or zero */ unw_word_t extra;/* mach_header of mach-o image containing func */ }; typedef struct unw_proc_info_t unw_proc_info_t; Modified: libunwind/trunk/include/mach-o/compact_unwind_encoding.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/mach-o/compact_unwind_encoding.h?rev=275996&r1=275995&r2=275996&view=diff == --- libunwind/trunk/include/mach-o/compact_unwind_encoding.h (original) +++ libunwind/trunk/include/mach-o/compact_unwind_encoding.h Tue Jul 19 12:15:50 2016 @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// Darwin's alternative to dwarf based unwind encodings. +// Darwin's alternative to DWARF based unwind encodings. // //===--===// @@ -17,7 +17,7 @@ #include // -// Compilers can emit standard Dwarf FDEs in the __TEXT,__eh_frame section +// Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section // of object files. Or compilers can emit compact unwind information in // the __LD,__compact_unwind section. // @@ -26,10 +26,10 @@ // runtime to access unwind info for any given function. If the compiler // emitted compact unwind info for the function, that compact unwind info will // be encoded in the __TEXT,__unwind_info section. If the compiler emitted -// dwarf unwind info, the __TEXT,__unwind_info section will contain the offset +// DWARF unwind info, the __TEXT,__unwind_info section will contain the offset // of the FDE in the __TEXT,__eh_frame section in the final linked image. // -// Note: Previously, the linker would transform some dwarf unwind infos into +// Note: Previously, the linker would transform some DWARF unwind infos into // compact unwind info. But that is fragile and no longer done. @@ -58,7 +58,7 @@ enum { // 1-bit: has lsda // 2-bit: personality index // -// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF // ebp based: //15-bits (5*3-bits per reg) register permutation //8-bits for stack offset @@ -128,9 +128,9 @@ enum { //UNWIND_X86_FRAMELESS_STACK_SIZE. // UNWIND_X86_MODE_DWARF: //No compact unwind encoding is available. Instead the low 24-bits of the -//compact encoding is the offset of the dwarf FDE in the __eh_frame section. +//compact encoding is the offset of the DWARF FDE in the __eh_frame section. //This mode is never used in object files. It is only generated by the -//linker in final linked images which have only dwarf unwind info for a +//linker in final linked images which have only DWARF unwind info for a //function. // // The permutation encoding is a Lehmer code sequence encoded into a @@ -193,7 +193,7 @@ enum { // 1-bit: has lsda // 2-bit: personality index // -// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=DWARF // rbp based: //15-bits (5*3-bits per reg) register permutation //8-bits for stack offset @@ -262,9 +262,9 @@ enum { //UNWIND_X86_64_FRAMELESS_STACK_SIZE. // UNWIND_X86_64_MODE_DWARF: //No compact unwind encoding is available. Instead the low 24-bits of the -//compact encoding is the offset of the dwarf FDE in the __eh_frame section. +//compact encoding is the offset of the DWARF FDE in the __eh_frame
[libunwind] r275997 - libunwind: sync some coments with NetBSD's version
Author: emaste Date: Tue Jul 19 12:28:38 2016 New Revision: 275997 URL: http://llvm.org/viewvc/llvm-project?rev=275997&view=rev Log: libunwind: sync some coments with NetBSD's version NetBSD's system unwinder is a modified version of LLVM's libunwind. Slightly reduce diffs by updating comments to match theirs where appropriate. Modified: libunwind/trunk/src/DwarfParser.hpp Modified: libunwind/trunk/src/DwarfParser.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/DwarfParser.hpp?rev=275997&r1=275996&r2=275997&view=diff == --- libunwind/trunk/src/DwarfParser.hpp (original) +++ libunwind/trunk/src/DwarfParser.hpp Tue Jul 19 12:28:38 2016 @@ -138,23 +138,23 @@ const char *CFI_Parser::decodeFDE(A & if (err != NULL) return err; p += 4; - // parse pc begin and range + // Parse pc begin and range. pint_t pcStart = addressSpace.getEncodedP(p, nextCFI, cieInfo->pointerEncoding); pint_t pcRange = addressSpace.getEncodedP(p, nextCFI, cieInfo->pointerEncoding & 0x0F); - // parse rest of info + // Parse rest of info. fdeInfo->lsda = 0; - // check for augmentation length + // Check for augmentation length. if (cieInfo->fdesHaveAugmentationData) { pint_t augLen = (pint_t)addressSpace.getULEB128(p, nextCFI); pint_t endOfAug = p + augLen; if (cieInfo->lsdaEncoding != DW_EH_PE_omit) { - // peek at value (without indirection). Zero means no lsda + // Peek at value (without indirection). Zero means no LSDA. pint_t lsdaStart = p; if (addressSpace.getEncodedP(p, nextCFI, cieInfo->lsdaEncoding & 0x0F) != 0) { -// reset pointer and re-parse lsda address +// Reset pointer and re-parse LSDA address. p = lsdaStart; fdeInfo->lsda = addressSpace.getEncodedP(p, nextCFI, cieInfo->lsdaEncoding); @@ -192,23 +192,23 @@ bool CFI_Parser::findFDE(A &addressSp return false; // end marker uint32_t id = addressSpace.get32(p); if (id == 0) { - // skip over CIEs + // Skip over CIEs. p += cfiLength; } else { - // process FDE to see if it covers pc + // Process FDE to see if it covers pc. pint_t nextCFI = p + cfiLength; uint32_t ciePointer = addressSpace.get32(p); pint_t cieStart = p - ciePointer; - // validate pointer to CIE is within section + // Validate pointer to CIE is within section. if ((ehSectionStart <= cieStart) && (cieStart < ehSectionEnd)) { if (parseCIE(addressSpace, cieStart, cieInfo) == NULL) { p += 4; - // parse pc begin and range + // Parse pc begin and range. pint_t pcStart = addressSpace.getEncodedP(p, nextCFI, cieInfo->pointerEncoding); pint_t pcRange = addressSpace.getEncodedP( p, nextCFI, cieInfo->pointerEncoding & 0x0F); - // test if pc is within the function this FDE covers + // Test if pc is within the function this FDE covers. if ((pcStart < pc) && (pc <= pcStart + pcRange)) { // parse rest of info fdeInfo->lsda = 0; @@ -217,11 +217,11 @@ bool CFI_Parser::findFDE(A &addressSp pint_t augLen = (pint_t)addressSpace.getULEB128(p, nextCFI); pint_t endOfAug = p + augLen; if (cieInfo->lsdaEncoding != DW_EH_PE_omit) { -// peek at value (without indirection). Zero means no lsda +// Peek at value (without indirection). Zero means no LSDA. pint_t lsdaStart = p; if (addressSpace.getEncodedP( p, nextCFI, cieInfo->lsdaEncoding & 0x0F) != 0) { - // reset pointer and re-parse lsda address + // Reset pointer and re-parse LSDA address. p = lsdaStart; fdeInfo->lsda = addressSpace .getEncodedP(p, nextCFI, cieInfo->lsdaEncoding); @@ -239,7 +239,7 @@ bool CFI_Parser::findFDE(A &addressSp // pc is not in begin/range, skip this FDE } } else { - // malformed CIE, now augmentation describing pc range encoding + // Malformed CIE, now augmentation describing pc range encoding. } } else { // malformed FDE. CIE is bad ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D22543: [libunwind] Properly align _Unwind_Exception.
emaste accepted this revision. emaste added a reviewer: emaste. emaste added a comment. This revision is now accepted and ready to land. I've committed the alignment change to the copy of llvm libunwind in the FreeBSD base system now. https://reviews.llvm.org/D22543 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r276128 - libunwind: limit stack usage in unwind cursor
Author: emaste Date: Wed Jul 20 10:19:09 2016 New Revision: 276128 URL: http://llvm.org/viewvc/llvm-project?rev=276128&view=rev Log: libunwind: limit stack usage in unwind cursor Obtained from FreeBSD SVN r302475 Differential Revision: https://reviews.llvm.org/D22570 Modified: libunwind/trunk/include/__libunwind_config.h libunwind/trunk/src/DwarfParser.hpp Modified: libunwind/trunk/include/__libunwind_config.h URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/__libunwind_config.h?rev=276128&r1=276127&r2=276128&view=diff == --- libunwind/trunk/include/__libunwind_config.h (original) +++ libunwind/trunk/include/__libunwind_config.h Wed Jul 20 10:19:09 2016 @@ -22,18 +22,22 @@ # define _LIBUNWIND_TARGET_I386 1 # define _LIBUNWIND_CONTEXT_SIZE 8 # define _LIBUNWIND_CURSOR_SIZE 19 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 9 # elif defined(__x86_64__) # define _LIBUNWIND_TARGET_X86_64 1 # define _LIBUNWIND_CONTEXT_SIZE 21 # define _LIBUNWIND_CURSOR_SIZE 33 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 17 # elif defined(__ppc__) # define _LIBUNWIND_TARGET_PPC 1 # define _LIBUNWIND_CONTEXT_SIZE 117 # define _LIBUNWIND_CURSOR_SIZE 128 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 113 # elif defined(__aarch64__) # define _LIBUNWIND_TARGET_AARCH64 1 # define _LIBUNWIND_CONTEXT_SIZE 66 # define _LIBUNWIND_CURSOR_SIZE 78 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96 # elif defined(__arm__) # define _LIBUNWIND_TARGET_ARM 1 # if defined(__ARM_WMMX) @@ -43,10 +47,12 @@ #define _LIBUNWIND_CONTEXT_SIZE 42 #define _LIBUNWIND_CURSOR_SIZE 49 # endif +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96 # elif defined(__or1k__) # define _LIBUNWIND_TARGET_OR1K 1 # define _LIBUNWIND_CONTEXT_SIZE 16 # define _LIBUNWIND_CURSOR_SIZE 28 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 32 # else # error "Unsupported architecture." # endif @@ -59,6 +65,7 @@ # define _LIBUNWIND_TARGET_OR1K 1 # define _LIBUNWIND_CONTEXT_SIZE 128 # define _LIBUNWIND_CURSOR_SIZE 140 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 120 #endif // _LIBUNWIND_IS_NATIVE_ONLY #endif // LIBUNWIND_CONFIG_H__ Modified: libunwind/trunk/src/DwarfParser.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/DwarfParser.hpp?rev=276128&r1=276127&r2=276128&view=diff == --- libunwind/trunk/src/DwarfParser.hpp (original) +++ libunwind/trunk/src/DwarfParser.hpp Wed Jul 20 10:19:09 2016 @@ -62,7 +62,7 @@ public: }; enum { -kMaxRegisterNumber = 120 +kMaxRegisterNumber = _LIBUNWIND_HIGHEST_DWARF_REGISTER }; enum RegisterSavedWhere { kRegisterUnused, ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
emaste added a comment. Is this going to be committed? Libunwind is about to grow the same alignment attribute (https://reviews.llvm.org/D22543) https://reviews.llvm.org/D12512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
emaste added a comment. As it happens on FreeBSD/i386 malloc returns a 16-byte-aligned pointer for allocations with size >= 16 so will not be affected by this issue. https://reviews.llvm.org/D12512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
emaste added inline comments. Comment at: test/test_cxa_allocate_exception.pass.cpp:34 @@ +33,3 @@ +const std::size_t required_alignment = alignof(__cxa_exception); +const bool requires_over_alignment = max_alignment < required_alignment; + `requires_over_alignment` not used? https://reviews.llvm.org/D12512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [libunwind] r276128 - libunwind: limit stack usage in unwind cursor
On 20 July 2016 at 15:19, Ed Maste via cfe-commits wrote: > Author: emaste > Date: Wed Jul 20 10:19:09 2016 > New Revision: 276128 > > URL: http://llvm.org/viewvc/llvm-project?rev=276128&view=rev > Log: > libunwind: limit stack usage in unwind cursor > > Obtained from FreeBSD SVN r302475 > > Differential Revision: https://reviews.llvm.org/D22570 Hans, OK to merge this to 3.9? ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12512: [libcxxabi] Manually align pointers in __cxa_allocate_exception - Fixes PR24604
emaste added a comment. Note that the addition of the referenceCount at the beginning of `__cxa_exception` for 64-bit builds causes the `_Unwind_Exception unwindHeader` to become misaligned. libstdc++ had this same issue (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38732, now fixed) and libcxxrt does as well (https://github.com/pathscale/libcxxrt/issues/38). https://reviews.llvm.org/D12512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r276424 - Merge r276128: libunwind: limit stack usage in unwind cursor
Author: emaste Date: Fri Jul 22 10:00:42 2016 New Revision: 276424 URL: http://llvm.org/viewvc/llvm-project?rev=276424&view=rev Log: Merge r276128: libunwind: limit stack usage in unwind cursor Modified: libunwind/branches/release_39/ (props changed) libunwind/branches/release_39/include/__libunwind_config.h libunwind/branches/release_39/src/DwarfParser.hpp Propchange: libunwind/branches/release_39/ -- svn:mergeinfo = /libunwind/trunk:276128 Modified: libunwind/branches/release_39/include/__libunwind_config.h URL: http://llvm.org/viewvc/llvm-project/libunwind/branches/release_39/include/__libunwind_config.h?rev=276424&r1=276423&r2=276424&view=diff == --- libunwind/branches/release_39/include/__libunwind_config.h (original) +++ libunwind/branches/release_39/include/__libunwind_config.h Fri Jul 22 10:00:42 2016 @@ -22,18 +22,22 @@ # define _LIBUNWIND_TARGET_I386 1 # define _LIBUNWIND_CONTEXT_SIZE 8 # define _LIBUNWIND_CURSOR_SIZE 19 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 9 # elif defined(__x86_64__) # define _LIBUNWIND_TARGET_X86_64 1 # define _LIBUNWIND_CONTEXT_SIZE 21 # define _LIBUNWIND_CURSOR_SIZE 33 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 17 # elif defined(__ppc__) # define _LIBUNWIND_TARGET_PPC 1 # define _LIBUNWIND_CONTEXT_SIZE 117 # define _LIBUNWIND_CURSOR_SIZE 128 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 113 # elif defined(__aarch64__) # define _LIBUNWIND_TARGET_AARCH64 1 # define _LIBUNWIND_CONTEXT_SIZE 66 # define _LIBUNWIND_CURSOR_SIZE 78 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96 # elif defined(__arm__) # define _LIBUNWIND_TARGET_ARM 1 # if defined(__ARM_WMMX) @@ -43,10 +47,12 @@ #define _LIBUNWIND_CONTEXT_SIZE 42 #define _LIBUNWIND_CURSOR_SIZE 49 # endif +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96 # elif defined(__or1k__) # define _LIBUNWIND_TARGET_OR1K 1 # define _LIBUNWIND_CONTEXT_SIZE 16 # define _LIBUNWIND_CURSOR_SIZE 28 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 32 # else # error "Unsupported architecture." # endif @@ -59,6 +65,7 @@ # define _LIBUNWIND_TARGET_OR1K 1 # define _LIBUNWIND_CONTEXT_SIZE 128 # define _LIBUNWIND_CURSOR_SIZE 140 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 120 #endif // _LIBUNWIND_IS_NATIVE_ONLY #endif // LIBUNWIND_CONFIG_H__ Modified: libunwind/branches/release_39/src/DwarfParser.hpp URL: http://llvm.org/viewvc/llvm-project/libunwind/branches/release_39/src/DwarfParser.hpp?rev=276424&r1=276423&r2=276424&view=diff == --- libunwind/branches/release_39/src/DwarfParser.hpp (original) +++ libunwind/branches/release_39/src/DwarfParser.hpp Fri Jul 22 10:00:42 2016 @@ -62,7 +62,7 @@ public: }; enum { -kMaxRegisterNumber = 120 +kMaxRegisterNumber = _LIBUNWIND_HIGHEST_DWARF_REGISTER }; enum RegisterSavedWhere { kRegisterUnused, ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r277215 - libunwind: correct return code in unwinding trace log message
Author: emaste Date: Fri Jul 29 16:24:19 2016 New Revision: 277215 URL: http://llvm.org/viewvc/llvm-project?rev=277215&view=rev Log: libunwind: correct return code in unwinding trace log message Modified: libunwind/trunk/src/Unwind-EHABI.cpp Modified: libunwind/trunk/src/Unwind-EHABI.cpp URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-EHABI.cpp?rev=277215&r1=277214&r2=277215&view=diff == --- libunwind/trunk/src/Unwind-EHABI.cpp (original) +++ libunwind/trunk/src/Unwind-EHABI.cpp Fri Jul 29 16:24:19 2016 @@ -574,7 +574,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE2_ERROR\n", static_cast(exception_object)); return _URC_FATAL_PHASE2_ERROR; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: Linux-abi group
On 8 February 2016 at 18:08, Joseph Myers wrote: > On Mon, 8 Feb 2016, H.J. Lu wrote: > >> >> I was referring to program properties: >> >> >> >> https://groups.google.com/forum/#!topic/generic-abi/fyIXttIsYc8 >> > >> > This looks more like an ELF topic to me, not really ABI. >> > >> > Please discuss this on a GNU project list because it affects the >> > entire GNU project. >> > >> >> gABI is ELF and affects all users, including GNU project, of gABI. >> Linux-abi discusses Linux-specific extensions to gABI. It is for tools >> like compilers, assembler, linker and run-time. It isn't appropriate >> for any GNU project list. But the examples presented so far (STT_GNU_IFUNC, PT_GNU_RELRO etc.) are relevant to GNU systems in general and are not Linux-specific. > I find it extremely unlikely that many well-thought-out extensions would > be appropriate for GNU systems using the Linux kernel but not for GNU > systems using Hurd or other kernels - the only such cases would be for > things very closely related to kernel functionality. There is a strong > presumption that toolchain configuration should apply to all GNU systems > rather than being specific to GNU/Linux without good reason. Agreed. As we've seen with the fallout from the abi_tag attribute we need better communication between groups in the free software tool chain world, not more fragmentation. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D19029: Always use --eh-frame-hdr on FreeBSD, even for -static
emaste created this revision. emaste added reviewers: dim, andrew, davide. emaste added a subscriber: cfe-commits. Herald added subscribers: emaste, aemerson. FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and we expect to use it more widely in the future) and it requires the EH frame segment in static binaries. This is the same as rL203742 for NetBSD. http://reviews.llvm.org/D19029 Files: lib/Driver/Tools.cpp Index: lib/Driver/Tools.cpp === --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -8197,12 +8197,12 @@ if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { Index: lib/Driver/Tools.cpp === --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -8197,12 +8197,12 @@ if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19029: Always use --eh-frame-hdr on FreeBSD, even for -static
emaste updated this revision to Diff 53452. emaste added a comment. Test --eh-frame-hdr addition http://reviews.llvm.org/D19029 Files: lib/Driver/Tools.cpp test/Driver/freebsd.c Index: test/Driver/freebsd.c === --- test/Driver/freebsd.c +++ test/Driver/freebsd.c @@ -82,6 +82,7 @@ // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \ // RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-STATIC %s +// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // CHECK-STATIC: crt1.o // CHECK-STATIC: crtbeginT.o Index: lib/Driver/Tools.cpp === --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -8197,12 +8197,12 @@ if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { Index: test/Driver/freebsd.c === --- test/Driver/freebsd.c +++ test/Driver/freebsd.c @@ -82,6 +82,7 @@ // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \ // RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-STATIC %s +// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // CHECK-STATIC: crt1.o // CHECK-STATIC: crtbeginT.o Index: lib/Driver/Tools.cpp === --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -8197,12 +8197,12 @@ if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19029: Always use --eh-frame-hdr on FreeBSD, even for -static
This revision was automatically updated to reflect the committed changes. Closed by commit rL266123: Always use --eh-frame-hdr on FreeBSD, even for -static (authored by emaste). Changed prior to commit: http://reviews.llvm.org/D19029?vs=53452&id=53460#toc Repository: rL LLVM http://reviews.llvm.org/D19029 Files: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/freebsd.c Index: cfe/trunk/test/Driver/freebsd.c === --- cfe/trunk/test/Driver/freebsd.c +++ cfe/trunk/test/Driver/freebsd.c @@ -82,6 +82,7 @@ // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \ // RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-STATIC %s +// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // CHECK-STATIC: crt1.o // CHECK-STATIC: crtbeginT.o Index: cfe/trunk/lib/Driver/Tools.cpp === --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -8197,12 +8197,12 @@ if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { Index: cfe/trunk/test/Driver/freebsd.c === --- cfe/trunk/test/Driver/freebsd.c +++ cfe/trunk/test/Driver/freebsd.c @@ -82,6 +82,7 @@ // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \ // RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-STATIC %s +// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // CHECK-STATIC: crt1.o // CHECK-STATIC: crtbeginT.o Index: cfe/trunk/lib/Driver/Tools.cpp === --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -8197,12 +8197,12 @@ if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r266123 - Always use --eh-frame-hdr on FreeBSD, even for -static
Author: emaste Date: Tue Apr 12 16:11:46 2016 New Revision: 266123 URL: http://llvm.org/viewvc/llvm-project?rev=266123&view=rev Log: Always use --eh-frame-hdr on FreeBSD, even for -static FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to use it more widely in the future), and it requires the EH frame segment in static binaries. This is the same as r203742 for NetBSD. Differential Revision: http://reviews.llvm.org/D19029 Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/freebsd.c Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=266123&r1=266122&r2=266123&view=diff == --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Tue Apr 12 16:11:46 2016 @@ -8197,12 +8197,12 @@ void freebsd::Linker::ConstructJob(Compi if (IsPIE) CmdArgs.push_back("-pie"); + CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-Bstatic"); } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); -CmdArgs.push_back("--eh-frame-hdr"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-Bshareable"); } else { Modified: cfe/trunk/test/Driver/freebsd.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd.c?rev=266123&r1=266122&r2=266123&view=diff == --- cfe/trunk/test/Driver/freebsd.c (original) +++ cfe/trunk/test/Driver/freebsd.c Tue Apr 12 16:11:46 2016 @@ -82,6 +82,7 @@ // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \ // RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-STATIC %s +// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic" // CHECK-STATIC: crt1.o // CHECK-STATIC: crtbeginT.o ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D20791: Support SOURCE_DATE_EPOCH environment variable
emaste created this revision. emaste added a subscriber: cfe-commits. `SOURCE_DATE_EPOCH` specifies a UNIX timestamp (number of seconds since 01 Jan 1970 00:00:00 UTC) to be used as the timestamp input for build processes e.g. `__DATE__` and `__TIME__` See https://reproducible-builds.org/specs/source-date-epoch/ for details, and GCC support at https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html. http://reviews.llvm.org/D20791 Files: lib/Lex/PPMacroExpansion.cpp Index: lib/Lex/PPMacroExpansion.cpp === --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1013,7 +1013,12 @@ /// the identifier tokens inserted. static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc, Preprocessor &PP) { - time_t TT = time(nullptr); + time_t TT; + const char *envValue = getenv("SOURCE_DATE_EPOCH"); + if (envValue != nullptr) +TT = strtol(envValue, nullptr, 10); + else +TT = time(nullptr); struct tm *TM = localtime(&TT); static const char * const Months[] = { Index: lib/Lex/PPMacroExpansion.cpp === --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1013,7 +1013,12 @@ /// the identifier tokens inserted. static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc, Preprocessor &PP) { - time_t TT = time(nullptr); + time_t TT; + const char *envValue = getenv("SOURCE_DATE_EPOCH"); + if (envValue != nullptr) +TT = strtol(envValue, nullptr, 10); + else +TT = time(nullptr); struct tm *TM = localtime(&TT); static const char * const Months[] = { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D20791: Support SOURCE_DATE_EPOCH environment variable
emaste updated this revision to Diff 58977. emaste added a comment. Use gmtime to report in UTC when `SOURCE_DATE_EPOCH` is set. This follows GCC and makes sense given the purpose of `SOURCE_DATE_EPOCH`. For reference here is discussion on the GCC list when this was introduced there: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html http://reviews.llvm.org/D20791 Files: lib/Lex/PPMacroExpansion.cpp Index: lib/Lex/PPMacroExpansion.cpp === --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1013,8 +1013,16 @@ /// the identifier tokens inserted. static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc, Preprocessor &PP) { - time_t TT = time(nullptr); - struct tm *TM = localtime(&TT); + time_t TT; + struct tm *TM; + const char *envValue = getenv("SOURCE_DATE_EPOCH"); + if (envValue != nullptr) { +TT = strtol(envValue, nullptr, 10); +TM = gmtime(&TT); + } else { +TT = time(nullptr); +TM = localtime(&TT); + } static const char * const Months[] = { "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" Index: lib/Lex/PPMacroExpansion.cpp === --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1013,8 +1013,16 @@ /// the identifier tokens inserted. static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc, Preprocessor &PP) { - time_t TT = time(nullptr); - struct tm *TM = localtime(&TT); + time_t TT; + struct tm *TM; + const char *envValue = getenv("SOURCE_DATE_EPOCH"); + if (envValue != nullptr) { +TT = strtol(envValue, nullptr, 10); +TM = gmtime(&TT); + } else { +TT = time(nullptr); +TM = localtime(&TT); + } static const char * const Months[] = { "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: Don't pass --build-id by default.
On 2 June 2016 at 21:19, Hal Finkel via cfe-commits wrote: > - Original Message - >> From: "Rafael EspĂndola" >> To: "Hal Finkel" >> Cc: "cfe-commits cfe" >> Sent: Thursday, June 2, 2016 7:06:26 PM >> Subject: Re: Don't pass --build-id by default. >> >> > This is going to break a lot of my local rpm packaging scripts, and >> > I suspect the same is true for others. This is not a huge deal, >> > but I wonder if we should emulate GCC is this regard and provide >> > some CMake option to keep the current behavior? >> >> Yes, a cmake option is probably best. >> >> What do you think of the attached patch (still building). > > Seems reasonable to me. This sounds like the right approach to me too. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r271692 - Don't pass --build-id to ld by default.
On 3 June 2016 at 15:53, Nico Weber via cfe-commits wrote: > Can you add this to the release notes? It'll for example break chromium's > crash server (we can fix this on our end by explicitly passing > -Wl,--build-id for release builds, but we only saw this commit fly by by > chance.) Good point. The Debian, SUSE, Redhat and Ubuntu package maintainers will also have to update their package build recipes and we want to make sure they don't miss the change. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D17286: Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB
emaste added a comment. Seems fine to me http://reviews.llvm.org/D17286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15899: Add -fno-movt frontend option, to disable movt/movw on ARM
emaste accepted this revision. emaste added a reviewer: emaste. emaste added a comment. This LGTM http://reviews.llvm.org/D15899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15899: Add -fno-movt frontend option, to disable movt/movw on ARM
>> Is there a precendent for the option name? It should be -m* and not -f*, >> since it is not target independent. > > Yes, agreed, thanks for the catch Joerg. Presumably -ffixed_r9 should become -mfixed_r9 as well? ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15967: Turn off lldb debug tuning by default for FreeBSD
emaste accepted this revision. emaste added a comment. This revision is now accepted and ready to land. I advocated for the lldb tuning by default on FreeBSD originally, but I didn't fully understand the implications. It turns out we're just not ready yet. So, LGTM. http://reviews.llvm.org/D15967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15967: Turn off lldb debug tuning by default for FreeBSD
emaste added a comment. > Sure, I was just making it the same as LLVM's default. Yeah, the defaults ought to be the same; it turns out this change was just premature. http://reviews.llvm.org/D15967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D15791: Disable generating movt on FreeBSD
emaste added a comment. > @davide, any idea whether lld will be able to handle movt correctly? If so, > we might want to make this dependent on -fuse-ld=bfd or -fuse-ld=lld ? I'm sure lld will handle everything we need eventually (if it does not already), but I'm not sure it's reasonable to have different behaviour based on `-fuse-ld` here anyhow -- ld.bfd may well be a recent one from ports. Repository: rL LLVM http://reviews.llvm.org/D15791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -Wunused -x c -verify %s emaste wrote: Git does not track file moves explicitly. You'll find that `git log --follow` will work equally well whether you use `git add` and `git rm` or `git mv`. It uses a heuristic to decide that when a file disappears and a similar file appears it was probably moved. https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)
emaste wrote: Giving this extra scrutiny is certainly warranted given the context, but #63957 is a legitimate bug. https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] b41bb6c - [Driver] Default to contemporary FreeBSD profiling behaviour
Author: Ed Maste Date: 2021-12-15T09:05:35-05:00 New Revision: b41bb6c1b715da77025962f736740c78128c78e1 URL: https://github.com/llvm/llvm-project/commit/b41bb6c1b715da77025962f736740c78128c78e1 DIFF: https://github.com/llvm/llvm-project/commit/b41bb6c1b715da77025962f736740c78128c78e1.diff LOG: [Driver] Default to contemporary FreeBSD profiling behaviour Prior to FreeBSD 14, FreeBSD provided special _p.a libraries for use with -pg. They are no longer used or provided. If the target does not specify a major version (e.g. amd64-unknown-freebsd, rather than amd64-unknown-freebsd12) default to the new behaviour. Differential Revision: https://reviews.llvm.org/D114396 Added: Modified: clang/lib/Driver/ToolChains/FreeBSD.cpp clang/test/Driver/freebsd.cpp Removed: diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp b/clang/lib/Driver/ToolChains/FreeBSD.cpp index d08ea282f6df..de635f5816cf 100644 --- a/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -293,8 +293,8 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); - bool Profiling = Args.hasArg(options::OPT_pg) && - ToolChain.getTriple().getOSMajorVersion() < 14; + unsigned Major = ToolChain.getTriple().getOSMajorVersion(); + bool Profiling = Args.hasArg(options::OPT_pg) && Major != 0 && Major < 14; if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { // Use the static OpenMP runtime with -static-openmp bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) && @@ -419,8 +419,8 @@ void FreeBSD::addLibStdCxxIncludePaths( void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args, ArgStringList &CmdArgs) const { CXXStdlibType Type = GetCXXStdlibType(Args); - bool Profiling = - Args.hasArg(options::OPT_pg) && getTriple().getOSMajorVersion() < 14; + unsigned Major = getTriple().getOSMajorVersion(); + bool Profiling = Args.hasArg(options::OPT_pg) && Major != 0 && Major < 14; switch (Type) { case ToolChain::CST_Libcxx: diff --git a/clang/test/Driver/freebsd.cpp b/clang/test/Driver/freebsd.cpp index 512d29eeb64a..2304a61fa9ea 100644 --- a/clang/test/Driver/freebsd.cpp +++ b/clang/test/Driver/freebsd.cpp @@ -16,7 +16,7 @@ // RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s // RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 -stdlib=platform 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s -// CHECK-PG-DEFAULT: "-lc++_p" "-lm_p" +// CHECK-PG-DEFAULT: "-lc++" "-lm" // CHECK-PG-FOURTEEN: "-lc++" "-lm" // CHECK-PG-TEN: "-lc++_p" "-lm_p" // CHECK-PG-NINE: "-lstdc++_p" "-lm_p" ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 6609892 - [clang] allow -fstack-clash-protection on FreeBSD
Author: Ed Maste Date: 2021-08-24T21:02:36-04:00 New Revision: 6609892a2dcdd1a4f6adefe191b55524861f020c URL: https://github.com/llvm/llvm-project/commit/6609892a2dcdd1a4f6adefe191b55524861f020c DIFF: https://github.com/llvm/llvm-project/commit/6609892a2dcdd1a4f6adefe191b55524861f020c.diff LOG: [clang] allow -fstack-clash-protection on FreeBSD -fstack-clash-protection was added in Clang commit e67cbac81211 but was enabled only on Linux. Allow it on FreeBSD as well, as it works fine. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D108571 Added: Modified: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/stack-clash-protection.c Removed: diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index e19e1222f702e..b973428549820 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -3198,7 +3198,7 @@ static void RenderSCPOptions(const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) { const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple(); - if (!EffectiveTriple.isOSLinux()) + if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux()) return; if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() && diff --git a/clang/test/Driver/stack-clash-protection.c b/clang/test/Driver/stack-clash-protection.c index 5217ed26a5b19..048668fc951e3 100644 --- a/clang/test/Driver/stack-clash-protection.c +++ b/clang/test/Driver/stack-clash-protection.c @@ -5,6 +5,7 @@ // SCP-i386-NO-NOT: "-fstack-clash-protection" // RUN: %clang -target x86_64-scei-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86 +// RUN: %clang -target x86_64-unknown-freebsd -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86 // SCP-x86: "-fstack-clash-protection" // RUN: %clang -target armv7k-apple-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-armv7 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits