[PATCH] D8484: Allow -gsplit-dwarf for all ELF targets, not just Linux

2023-10-11 Thread Ed Maste via Phabricator via cfe-commits
emaste abandoned this revision.
emaste added a comment.
Herald added a project: All.

Allowed for all ELF OSes as of

  commit ee957e045f526ce45d24b0f081f277262c3da43d
  Author: Fangrui Song 
  Date:   Thu Mar 28 08:24:00 2019 +
  
  [Driver] Allow -gsplit-dwarf on ELF OSes other than Linux and Fuchsia
  
  In gcc, -gsplit-dwarf is handled in gcc/gcc.c as a spec
  (ASM_FINAL_SPEC): objcopy --extract-dwo + objcopy --strip-dwo. In
  gcc/opts.c, -gsplit_dwarf has the same semantic of a -g. Except for the
  availability of the external command 'objcopy', nothing precludes the
  feature working on other ELF OSes. llvm doesn't use objcopy, so it doesn't
  have to exclude other OSes.
  
  llvm-svn: 357150


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D8484/new/

https://reviews.llvm.org/D8484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158920: Delete CloudABI support

2023-09-06 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

In D158920#4620361 , @brad wrote:

> Looking for any feedback from the FreeBSD guys.

Sorry for no reply earlier, I was away for some of the summer and missed this 
originally. While CloudABI was a very interesting FreeBSD-related project it 
was removed from FreeBSD as you noted, and there's no reason to keep support in 
llvm

  commit cf0ee8738e31aa9e6fbf4dca4dac56d89226a71a
  Author: Konstantin Belousov 
  Date:   Mon Sep 13 01:50:39 2021 +0300
  
  Drop cloudabi
  
  According to https://github.com/NuxiNL/cloudlibc:
  CloudABI is no longer being maintained. It was an awesome experiment,
  but it never got enough traction to be sustainable.
  
  There is no reason to keep it in FreeBSD.
  
  Approved by:ed (private mail)
  Reviewed by:emaste
  Sponsored by:   The FreeBSD Foundation
  Differential revision:  https://reviews.freebsd.org/D31923


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158920/new/

https://reviews.llvm.org/D158920

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135171: FreeBSD: enable __float128 on x86 and powerpc64le

2023-09-05 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Looks like this still needs someone to push it -- @brooks if you rebase and 
send to GitHub I cna pick it up


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135171/new/

https://reviews.llvm.org/D135171

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D96007: [AArch64] Enable stack clash protection for AArch64 linux in clang

2023-02-21 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3090
 
   if (!EffectiveTriple.isOSLinux())
 return;

Why is this limited to `isOSLinux()` only?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96007/new/

https://reviews.llvm.org/D96007

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135045: [Frontend] Recognize environment variable SOURCE_DATE_EPOCH

2022-10-06 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> The time_t value may be negative

True, but we do not need to allow a negative `SOURCE_DATE_EPOCH` though. The 
spec implies that it must be nonnegative, although doesn't say so explicitly. 
https://reproducible-builds.org/specs/source-date-epoch/


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135045/new/

https://reviews.llvm.org/D135045

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135171: FreeBSD: enable __float128 on x86

2022-10-04 Thread Ed Maste via Phabricator via cfe-commits
emaste accepted this revision.
emaste added a comment.

OK. I think the switch will become unwieldy if additional arch-dependent things 
are added but could be dealt with then.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135171/new/

https://reviews.llvm.org/D135171

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D23934: Add a -ffixed-date-time= flag that sets the initial value of __DATE__, __TIME__, __TIMESTAMP__

2022-03-02 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.
Herald added a project: All.

The original author appears to have given up on it. Someone will need to rebase 
and work on pushing it forward


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D23934/new/

https://reviews.llvm.org/D23934

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114396: [Driver] Default to current FreeBSD profiling behaviour

2021-12-15 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb41bb6c1b715: [Driver] Default to contemporary FreeBSD 
profiling behaviour (authored by emaste).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114396/new/

https://reviews.llvm.org/D114396

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/freebsd.cpp


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,8 +293,8 @@
   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::AddCXXStdlibLibArgs(const ArgList ,
   ArgStringList ) 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:


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,8 +293,8 @@
   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::AddCXXStdlibLibArgs(const ArgList ,
   ArgStringList ) 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:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114396: [Driver] Default to current FreeBSD profiling behaviour

2021-11-22 Thread Ed Maste via Phabricator via cfe-commits
emaste added a subscriber: myfreeweb.
emaste added a comment.

Similar idea to D6  (libc++ default if 
major not specified)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114396/new/

https://reviews.llvm.org/D114396

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D114396: [Driver] Default to current FreeBSD profiling behaviour

2021-11-22 Thread Ed Maste via Phabricator via cfe-commits
emaste created this revision.
emaste added a reviewer: dim.
Herald added subscribers: krytarowski, arichardson.
emaste requested review of this revision.

FreeBSD provided special _p.a libraries for use with -pg prior to FreeBSD 14.  
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) use 
the new behaviour.


https://reviews.llvm.org/D114396

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/freebsd.cpp


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,8 +293,8 @@
   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::AddCXXStdlibLibArgs(const ArgList ,
   ArgStringList ) 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:


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,8 +293,8 @@
   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::AddCXXStdlibLibArgs(const ArgList ,
   ArgStringList ) 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:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77776: [Driver] Default to libc++ on FreeBSD

2021-11-22 Thread Ed Maste via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2dec2aa3ad08: [Driver] Default to libc++ on FreeBSD 
(authored by jbeich, committed by emaste).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D6/new/

https://reviews.llvm.org/D6

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/freebsd.cpp


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -391,7 +391,8 @@
 }
 
 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;
 }


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -391,7 +391,8 @@
 }
 
 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;
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77776: [Driver] Default to libc++ on FreeBSD

2021-11-22 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: clang/test/Driver/freebsd.cpp:13-14
+// 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 \

In main this is `amd64-unknown-freebsd14.0`, I have a fix for that staged 
before this diff

```
commit d99411fe6e0375041b80ba4f397a139218a3754d
Author: Ed Maste 
Date:   Mon Nov 22 11:26:55 2021 -0500

[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

diff --git a/clang/test/Driver/freebsd.cpp b/clang/test/Driver/freebsd.cpp
index fde888902e12..d199f6e2367a 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

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D6/new/

https://reviews.llvm.org/D6

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77776: [Driver] Default to libc++ on FreeBSD

2021-11-22 Thread Ed Maste via Phabricator via cfe-commits
emaste updated this revision to Diff 388931.
emaste added a comment.

rebase tests


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D6/new/

https://reviews.llvm.org/D6

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/freebsd.cpp


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -391,7 +391,8 @@
 }
 
 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;
 }


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -391,7 +391,8 @@
 }
 
 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;
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D111863: [libunwind] Add an interface for dynamic .eh_frame registration

2021-11-01 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

In D111863#3100654 , @lhames wrote:

> @joerg @dim @emaste Any further comments on this?

I have no objection.

2016 (when I patched FreeBSD's in-tree libunwind) is long enough ago that I 
don't recall any of the context but indeed it does not appear that this will 
cause any trouble on our next import.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111863/new/

https://reviews.llvm.org/D111863

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D108571: [clang] allow -fstack-clash-protection on FreeBSD

2021-08-24 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6609892a2dcd: [clang] allow -fstack-clash-protection on 
FreeBSD (authored by emaste).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108571/new/

https://reviews.llvm.org/D108571

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/stack-clash-protection.c


Index: clang/test/Driver/stack-clash-protection.c
===
--- clang/test/Driver/stack-clash-protection.c
+++ 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
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3198,7 +3198,7 @@
  ArgStringList ) {
   const llvm::Triple  = TC.getEffectiveTriple();
 
-  if (!EffectiveTriple.isOSLinux())
+  if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux())
 return;
 
   if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&


Index: clang/test/Driver/stack-clash-protection.c
===
--- clang/test/Driver/stack-clash-protection.c
+++ 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
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3198,7 +3198,7 @@
  ArgStringList ) {
   const llvm::Triple  = TC.getEffectiveTriple();
 
-  if (!EffectiveTriple.isOSLinux())
+  if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux())
 return;
 
   if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D54880: Ignore gcc's stack-clash-protection flag

2021-08-23 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Superseded by e67cbac81211d40332a79d98c9d5953624cc1202 
 (D68720 
)


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54880/new/

https://reviews.llvm.org/D54880

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D108571: [clang] allow -fstack-clash-protection on FreeBSD

2021-08-23 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

We make this change in FreeBSD's in-tree Clang about 9 months ago 
(https://reviews.freebsd.org/D27366)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108571/new/

https://reviews.llvm.org/D108571

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D108571: [clang] allow -fstack-clash-protection on FreeBSD

2021-08-23 Thread Ed Maste via Phabricator via cfe-commits
emaste created this revision.
emaste added reviewers: serge-sans-paille, craig.topper, dim.
Herald added subscribers: krytarowski, arichardson.
emaste requested review of this revision.

`-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.


https://reviews.llvm.org/D108571

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/stack-clash-protection.c


Index: clang/test/Driver/stack-clash-protection.c
===
--- clang/test/Driver/stack-clash-protection.c
+++ 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
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3198,7 +3198,7 @@
  ArgStringList ) {
   const llvm::Triple  = TC.getEffectiveTriple();
 
-  if (!EffectiveTriple.isOSLinux())
+  if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux())
 return;
 
   if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&


Index: clang/test/Driver/stack-clash-protection.c
===
--- clang/test/Driver/stack-clash-protection.c
+++ 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
Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -3198,7 +3198,7 @@
  ArgStringList ) {
   const llvm::Triple  = TC.getEffectiveTriple();
 
-  if (!EffectiveTriple.isOSLinux())
+  if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux())
 return;
 
   if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D104753: [Driver] Stop linking _p libs for -pg on FreeBSD 14

2021-06-26 Thread Ed Maste via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG699d47472c3f: [Driver] do not link _p libs for -pg on 
FreeBSD 14 and later (authored by emaste).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104753/new/

https://reviews.llvm.org/D104753

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/freebsd.cpp


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,6 +293,8 @@
   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 @@
 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 @@
   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 @@
 }
 
 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 @@
 
 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::AddCXXStdlibLibArgs(const ArgList ,
   ArgStringList ) 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:


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,6 +293,8 @@
   

[PATCH] D104753: [Driver] Stop linking _p libs for -pg on FreeBSD 14

2021-06-22 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

`-pg` is still supported (see the `OPT_pg` at line 253), gprof just won't be 
able to "see into" libc, libm, etc.

For example a trivial test case calling snprintf and strcmp in a loop, on 
FreeBSD 11 with _p libs:

%   cumulative   self  self total   
   time   seconds   secondscalls  ms/call  ms/call  name
   57.5   0.11 0.110  100.00%   _mcount [1]
   14.2   0.14 0.03  100 0.00 0.00  __vfprintf [5]
9.3   0.15 0.020  100.00%   .mcount (43)
7.2   0.17 0.01  104 0.00 0.00  memset [6]
4.0   0.18 0.01  100 0.00 0.00  __sfvwrite [7]
2.6   0.18 0.01  100 0.00 0.00  snprintf [4]
2.5   0.19 0.00  201 0.00 0.00  memcpy [8]
1.4   0.19 0.00  100 0.00 0.00  localeconv_l [9]
0.8   0.19 0.001 1.6063.36  main [2]
  ...

Same case linking against non-_p libs:

%   cumulative   self  self total   
   time   seconds   secondscalls  ms/call  ms/call  name
  100.0   0.00 0.001 2.58 2.58  main [1]
0.0   0.00 0.0000.00%   _start [2]


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104753/new/

https://reviews.llvm.org/D104753

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D104753: [Driver] Stop linking _p libs for -pg on FreeBSD 14

2021-06-22 Thread Ed Maste via Phabricator via cfe-commits
emaste created this revision.
emaste added a reviewer: dim.
Herald added subscribers: krytarowski, arichardson.
emaste requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In FreeBSD 14 we plan to deprecate the _p.a special profiling libraries - see 
FreeBSD review https://reviews.freebsd.org/D30833 for details.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104753

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/freebsd.cpp


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,6 +293,8 @@
   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 @@
 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 @@
   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 @@
 }
 
 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 @@
 
 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::AddCXXStdlibLibArgs(const ArgList ,
   ArgStringList ) 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:


Index: clang/test/Driver/freebsd.cpp
===
--- clang/test/Driver/freebsd.cpp
+++ 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"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ 

[PATCH] D97752: Fix -gz=zlib options for linker for FreeBSD too

2021-03-02 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG462cf39a5c18: [Driver] Fix -gz=zlib options for linker also 
on FreeBSD (authored by emaste).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97752/new/

https://reviews.llvm.org/D97752

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/test/Driver/compress.c


Index: clang/test/Driver/compress.c
===
--- clang/test/Driver/compress.c
+++ 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"
 
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -290,6 +290,7 @@
 
   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)) {


Index: clang/test/Driver/compress.c
===
--- clang/test/Driver/compress.c
+++ 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"
 
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -290,6 +290,7 @@
 
   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)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87321: Fix -gz=zlib options for linker

2021-03-01 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

I just ran into this issue on FreeBSD, bug report in 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253942

clang/lib/Driver/ToolChains/FreeBSD.cpp needs updating for this change also


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87321/new/

https://reviews.llvm.org/D87321

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D89490: Introduce __attribute__((darwin_abi))

2021-01-04 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> For now, only Linux/ARM64 is supported/tested.

Is there any reason this is Linux-specific (as far as support; I understand if 
it's not easy for you to test on non-Linux arm64).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89490/new/

https://reviews.llvm.org/D89490

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D92245: -fstack-clash-protection: Return an actual error when used on unsupported OS

2020-12-16 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> I think it's ok to only warn on Windows.

IMO that's sensible


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92245/new/

https://reviews.llvm.org/D92245

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D92245: -fstack-clash-protection: Return an actual error when used on unsupported OS

2020-12-01 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> How do things go wrong on Darwin? I was under the impression that this was 
> implemented in LLVM as strictly inline code, no runtime support required.

That is my impression as well (although it seems that an earlier version might 
have emitted calls to a stack probe routine?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92245/new/

https://reviews.llvm.org/D92245

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D92245: -fstack-clash-protection: Return an actual error when used on unsupported OS

2020-11-30 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Can we add a test that the feature can be enabled on an OS other than Linux / 
Windows / Darwin?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92245/new/

https://reviews.llvm.org/D92245

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D68720: Support -fstack-clash-protection for x86

2020-11-24 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.
Herald added subscribers: dexonsmith, pengfei.



Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3009-3010
+
+  if (!EffectiveTriple.isOSLinux())
+return;
+

Is there anything OS-dependent here?

I plan to add `EffectiveTriple.isOSFreeBSD()` to FreeBSD-s in-tree Clang
https://reviews.freebsd.org/D27366
and intend to upstream the change (with a test), but should we just remove the 
OS test completely?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68720/new/

https://reviews.llvm.org/D68720

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46791: Make -gsplit-dwarf generally available

2020-10-30 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.
Herald added a subscriber: arichardson.

running `clang -target x86_64-unknown-freebsd13.0 -split-dwarf foo.c` indeed 
produces a foo.dwo and foo.o w/o invoking objcopy


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46791/new/

https://reviews.llvm.org/D46791

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D89859: Remove .svn from exclude list as we moved to git

2020-10-21 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89859/new/

https://reviews.llvm.org/D89859

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73425: [PPC] Fix platform definitions when compiling FreeBSD powerpc64 as LE

2020-08-28 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: clang/lib/Basic/Targets.cpp:361-362
   return new LinuxTargetInfo(Triple, Opts);
+case llvm::Triple::FreeBSD:
+  return new FreeBSDTargetInfo(Triple, Opts);
 case llvm::Triple::NetBSD:

Bdragon28 wrote:
> Bdragon28 wrote:
> > emaste wrote:
> > > List was previously in alpha order
> > Yes. However, I am following the ordering of the ppc64 and powerpc triples.
> that is, the ordering is "Linux, the BSDs, Embedded targets, Commercial 
> targets" for ppc*.
Ok, as long as it's consistent I'm happy with it


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73425/new/

https://reviews.llvm.org/D73425

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D69925: remove redundant LLVM version from version string when setting CLANG_VENDOR

2020-08-26 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

It looks like this conflicts with OpenSSL's compiler version check

- https://svnweb.freebsd.org/changeset/base/364822
- https://lists.freebsd.org/pipermail/svn-src-all/2020-August/201804.html

We've fixed it in FreeBSD and the change "should" happen upstream, but 
something to watch out for with other software.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69925/new/

https://reviews.llvm.org/D69925

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73425: [PPC] Fix platform definitions when compiling FreeBSD powerpc64 as LE

2020-08-25 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: clang/lib/Basic/Targets.cpp:361-362
   return new LinuxTargetInfo(Triple, Opts);
+case llvm::Triple::FreeBSD:
+  return new FreeBSDTargetInfo(Triple, Opts);
 case llvm::Triple::NetBSD:

List was previously in alpha order


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73425/new/

https://reviews.llvm.org/D73425

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83645: Bump the default target CPU for i386-freebsd to i686

2020-07-12 Thread Ed Maste via Phabricator via cfe-commits
emaste accepted this revision.
emaste added a comment.
This revision is now accepted and ready to land.

Fine with me


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83645/new/

https://reviews.llvm.org/D83645



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77776: [Driver] Default to libc++ on FreeBSD

2020-04-20 Thread Ed Maste via Phabricator via cfe-commits
emaste accepted this revision.
emaste added a comment.
This revision is now accepted and ready to land.

Looks ok to me


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D6/new/

https://reviews.llvm.org/D6



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D77776: [Driver] Default to libc++ on FreeBSD

2020-04-20 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

In D6#1981271 , @jbeich wrote:

> - Limit the scope to `-stdlib`
>
> In D6#1972543 , @dim wrote:
>
> > the lowest supported version, which is currently 10
>
>
> Where is this defined? Does someone build LLVM master on FreeBSD < 11.3?


Not certain, but there are a number of FreeBSD consumers still shipping 
products based on FreeBSD 10 who might be trying to use newer toolchains. I 
don't think we need to be too concerned about those cases but if it's trivial 
to avoid breaking them we might as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D6/new/

https://reviews.llvm.org/D6



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D23934: Add a -ffixed-date-time= flag that sets the initial value of __DATE__, __TIME__, __TIMESTAMP__

2020-03-21 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Ping.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D23934/new/

https://reviews.llvm.org/D23934



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D71554: [llvm-ranlib] Handle -D and -U command line flag

2019-12-16 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: llvm/tools/llvm-ar/llvm-ar.cpp:69
+  --version - Display the version of this program
+  -D- Use zero for timestamps and uids/gids (default)
+  -U- Use actual timestamps and uids/gids

file mode made reproducible too?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71554/new/

https://reviews.llvm.org/D71554



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D69990: Populate CUDA flags on FreeBSD too, as many other toolchains do.

2019-11-17 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Should have a test added


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69990/new/

https://reviews.llvm.org/D69990



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70157: Align branches within 32-Byte boundary

2019-11-16 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> I think the default policy discussion might be better had on llvm-dev than a 
> Phab review.

Ok, I agree with that, and also think it's useful to get this patch committed 
independent of a change to the defaults, which can be handled in a subsequent 
review.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70157/new/

https://reviews.llvm.org/D70157



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70110: [Driver][FreeBSD] Enable unwind tables on !amd64

2019-11-16 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcb1761465a0d: clang: enable unwind tables on FreeBSD !amd64 
(authored by emaste).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70110/new/

https://reviews.llvm.org/D70110

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/lib/Driver/ToolChains/FreeBSD.h
  clang/test/Driver/freebsd.c


Index: clang/test/Driver/freebsd.c
===
--- clang/test/Driver/freebsd.c
+++ 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
Index: clang/lib/Driver/ToolChains/FreeBSD.h
===
--- clang/lib/Driver/ToolChains/FreeBSD.h
+++ clang/lib/Driver/ToolChains/FreeBSD.h
@@ -67,6 +67,7 @@
 
   llvm::ExceptionHandling GetExceptionModel(
   const llvm::opt::ArgList ) const override;
+  bool IsUnwindTablesDefault(const llvm::opt::ArgList ) const override;
   bool isPIEDefault() const override;
   SanitizerMask getSupportedSanitizers() const override;
   unsigned GetDefaultDwarfVersion() const override;
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -420,6 +420,8 @@
 
 bool FreeBSD::HasNativeLLVMSupport() const { return true; }
 
+bool FreeBSD::IsUnwindTablesDefault(const ArgList ) const { return true; }
+
 bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
 
 SanitizerMask FreeBSD::getSupportedSanitizers() const {


Index: clang/test/Driver/freebsd.c
===
--- clang/test/Driver/freebsd.c
+++ 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
Index: clang/lib/Driver/ToolChains/FreeBSD.h
===
--- clang/lib/Driver/ToolChains/FreeBSD.h
+++ clang/lib/Driver/ToolChains/FreeBSD.h
@@ -67,6 +67,7 @@
 
   llvm::ExceptionHandling GetExceptionModel(
   const llvm::opt::ArgList ) const override;
+  bool IsUnwindTablesDefault(const llvm::opt::ArgList ) const override;
   bool isPIEDefault() const override;
   SanitizerMask getSupportedSanitizers() const override;
   unsigned GetDefaultDwarfVersion() const override;
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -420,6 +420,8 @@
 
 bool FreeBSD::HasNativeLLVMSupport() const { return true; }
 
+bool FreeBSD::IsUnwindTablesDefault(const ArgList ) const { return true; }
+
 bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
 
 SanitizerMask FreeBSD::getSupportedSanitizers() const {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D70157: Align branches within 32-Byte boundary

2019-11-16 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> Shall we default to -mbranches-within-32B-boundaries if the specified -march= 
> or -mtune= may be affected by the erratum?

I think we should enable it based on `-mtune` specifying an affected CPU (and 
implicitly based on `-march` if `-mtune` is not specified).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70157/new/

https://reviews.llvm.org/D70157



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60748: Fix i386 struct and union parameter alignment

2019-09-24 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

In D60748#1499756 , @dim wrote:

> Please also exclude FreeBSD from these changes, since we care a lot about 
> backwards compatibility, and specifically about alignment requirements.  (We 
> have run into many issues in our ports collection where upstream assumes 
> everything is 16-byte aligned on i386, which is *NOT* ABI compliant.)


@dim that said I think we'd expect to be able to mix gcc- and clang-built 
objects, and it seems this is addressing somewhat of a corner case?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60748/new/

https://reviews.llvm.org/D60748



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46791: Make -gsplit-dwarf generally available

2019-09-03 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Ping


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46791/new/

https://reviews.llvm.org/D46791



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D57795: [RISCV] Add FreeBSD targets

2019-05-27 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: lib/Basic/Targets.cpp:379
   return new LinuxTargetInfo(Triple, Opts);
-return new RISCV32TargetInfo(Triple, Opts);
+case llvm::Triple::FreeBSD:
+  return new FreeBSDTargetInfo(Triple, Opts);

My usual pedantic point: let's start these off in alpha order for consistency 
when additional cases are added


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57795/new/

https://reviews.llvm.org/D57795



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D50294: [Driver] Use -gdwarf-3 by default for FreeBSD

2019-04-24 Thread Ed Maste via Phabricator via cfe-commits
emaste added a subscriber: arichardson.
emaste added a comment.
Herald added a project: clang.

In D50294#1246980 , @MaskRay wrote:

> In D50294#1245454 , @emaste wrote:
>
> > I'm using this change: 
> > https://github.com/emaste/freebsd/commit/1c3deab6d518feb1a7e88de5b342a139e4022a21
> >
> > In FreeBSD 12 and later we use Clang, lld, and ELF Tool Chain. (We still 
> > have gas and objdump from the outdated binutils 2.17.50.)
>
>
> Will you upstream this commit (I can abandon this one)? I created this 
> revision because I was learning clangDriver... I had a vague and probably 
> incorrect impression that some folks said kgdb or dtrace or whatever might 
> not support DWARF 3 or 4.


Hmm, somehow I forgot about this until being reminded by @arichardson just now. 
I will upstream it.

The primary motivation for staying with DWARF2 was indeed kgdb, based on gdb 
6.1.1, and dtrace (specifically dtrace's build tool ctfconvert) also did not 
support DWARF >2. However, these issues have all been addressed:

1. We're deprecating gdb 6.1.1-based kgdb, using a contemporary gdb port.
2. In any case the kernel is still building with explicit -gdwarf2 today so it 
doesn't matter anyhow, there's no need for the toolchain default to be set 
based on the kernel's needs.
3. DTrace tooling limitations arose as a side effect of our (well, ELF Tool 
Chain's) libdwarf but it has been updated to handle DWARF4 some time ago.

Perhaps I should just upload a new diff to this review?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D50294/new/

https://reviews.llvm.org/D50294



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-07 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> There is a list of 140-150 unsafe (LLD_UNSAFE) packages with LLD.

Some of these are tagged with a PR or comment explaining why they are 
LLD_UNSAFE, but we haven't done it consistently. Some of these 140-150 were 
probably added in the early days of bringing lld into FreeBSD, and added 
without much thought - some could be as easy as differences in -ztext/-znotext 
default.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56215/new/

https://reviews.llvm.org/D56215



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D55878: [Driver] Use --hash-style=gnu instead of both on FreeBSD

2018-12-21 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

I think the arch-change (switching from a whitelist to a MIPS blacklist) is 
reasonable. What is the motivation for dropping `DT_HASH`, just binary size 
reduction?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55878/new/

https://reviews.llvm.org/D55878



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D52703: Allow ifunc resolvers to accept arguments

2018-10-09 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC344100: clang: Allow ifunc resolvers to accept arguments 
(authored by emaste, committed by ).

Repository:
  rC Clang

https://reviews.llvm.org/D52703

Files:
  include/clang/Basic/AttrDocs.td
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/CodeGen/CodeGenModule.cpp
  test/Sema/attr-ifunc.c


Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2889,8 +2889,6 @@
   "%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<
Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -3428,7 +3428,7 @@
   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.
 
Index: test/Sema/attr-ifunc.c
===
--- test/Sema/attr-ifunc.c
+++ test/Sema/attr-ifunc.c
@@ -27,10 +27,6 @@
 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() {}
Index: lib/CodeGen/CodeGenModule.cpp
===
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -322,8 +322,6 @@
   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();


Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2889,8 +2889,6 @@
   "%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<
Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -3428,7 +3428,7 @@
   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 

[PATCH] D52696: Update ifunc attribute support documentation

2018-09-30 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Maybe "available for some architectures in at least..."? Or maybe we shouldn't 
bother trying to list versions, and mention it is dependent on CPU arch, 
linker, and rtld?


Repository:
  rL LLVM

https://reviews.llvm.org/D52696



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D52703: Allow ifunc resolvers to accept arguments

2018-09-30 Thread Ed Maste via Phabricator via cfe-commits
emaste created this revision.
emaste added a reviewer: DmitryPolukhin.
Herald added a reviewer: javed.absar.
Herald added subscribers: kristof.beyls, krytarowski.

When ifunc support was added to Clang (in https://reviews.llvm.org/rC265917) 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 it, and glibc (on non-x86 platforms) and FreeBSD 
(on x86 and arm64) pass CPU identification information as arguments to ifunc 
resolvers. I believe GCC's documentation is simply incorrect / out-of-date.

We've removed the prohibition in FreeBSD's in-tree Clang: 
https://svnweb.freebsd.org/changeset/base/339019.


https://reviews.llvm.org/D52703

Files:
  include/clang/Basic/AttrDocs.td
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/CodeGen/CodeGenModule.cpp
  test/Sema/attr-ifunc.c


Index: test/Sema/attr-ifunc.c
===
--- test/Sema/attr-ifunc.c
+++ test/Sema/attr-ifunc.c
@@ -27,10 +27,6 @@
 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() {}
Index: lib/CodeGen/CodeGenModule.cpp
===
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -322,8 +322,6 @@
   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();
Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2887,8 +2887,6 @@
   "%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<
Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -3366,7 +3366,7 @@
   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.
 


Index: test/Sema/attr-ifunc.c
===
--- test/Sema/attr-ifunc.c
+++ test/Sema/attr-ifunc.c
@@ -27,10 +27,6 @@
 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() {}
Index: lib/CodeGen/CodeGenModule.cpp
===
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -322,8 +322,6 @@
   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();
Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2887,8 +2887,6 @@
   "%select{alias|ifunc}0 

[PATCH] D52696: Update ifunc attribute support documentation

2018-09-30 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL343408: Update ifunc attribute support documentation 
(authored by emaste, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D52696?vs=167626=167645#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52696

Files:
  cfe/trunk/include/clang/Basic/AttrDocs.td


Index: cfe/trunk/include/clang/Basic/AttrDocs.td
===
--- cfe/trunk/include/clang/Basic/AttrDocs.td
+++ cfe/trunk/include/clang/Basic/AttrDocs.td
@@ -3370,7 +3370,7 @@
 
 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.
   }];
 }
 


Index: cfe/trunk/include/clang/Basic/AttrDocs.td
===
--- cfe/trunk/include/clang/Basic/AttrDocs.td
+++ cfe/trunk/include/clang/Basic/AttrDocs.td
@@ -3370,7 +3370,7 @@
 
 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] D52696: Update ifunc attribute support documentation

2018-09-29 Thread Ed Maste via Phabricator via cfe-commits
emaste created this revision.
emaste added a reviewer: DmitryPolukhin.
Herald added a subscriber: krytarowski.

We documented GNU binutils and glibc versions required for ifunc support, but 
our own lld linker and FreeBSD's rtld also support ifuncs.


https://reviews.llvm.org/D52696

Files:
  include/clang/Basic/AttrDocs.td


Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -3370,7 +3370,7 @@
 
 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.
   }];
 }
 


Index: include/clang/Basic/AttrDocs.td
===
--- include/clang/Basic/AttrDocs.td
+++ include/clang/Basic/AttrDocs.td
@@ -3370,7 +3370,7 @@
 
 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] D50294: [Driver] Use -gdwarf-3 by default for FreeBSD

2018-09-25 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

I'm using this change: 
https://github.com/emaste/freebsd/commit/1c3deab6d518feb1a7e88de5b342a139e4022a21

In FreeBSD 12 and later we use Clang, lld, and ELF Tool Chain. (We still have 
gas and objdump from the outdated binutils 2.17.50.)


Repository:
  rC Clang

https://reviews.llvm.org/D50294



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D42645: New simple Checker for mmap calls

2018-02-21 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:417-419
+// Operating systems specific PROT_READ/PROT_WRITE values is not implemented,
+// thus ought to be overriden with the proper analyser-config variables
+// remain in alpha until the state changes

devnexen wrote:
> emaste wrote:
> > I'm a bit confused by this comment; this checker works as-is for most 
> > common operating system cases, correct?
> Most of them yes, at least Muslc linux most of glibc I tested too. Not to 
> mention *BSD ... But might be safer to put it as alpha for a start.
OK - to me it implies that the checker only works (anywhere) if the user 
provides the flag values. Maybe something like "the defaults are correct for 
several common operating systems, but may need to be overridden "



Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:64
+  if (!BT)
+BT.reset(new BugType(this, "W^X check fails, Write Exec prot flags 
set", "Security"));
+

devnexen wrote:
> emaste wrote:
> > `Write & Exec` (or `Write and Exec`) perhaps (assuming it doesn't become 
> > over-long then)?
> I kept short intentionally indeed we can always change but the user in order 
> to use it needs to enable it willingly so I assumed the user might know 
> enough about the topic in question.
Understood. To me it just read as "Write Exec" as one entity.


https://reviews.llvm.org/D42645



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D43378: FreeBSD driver / Xray flags moving pthread to compile flags.

2018-02-21 Thread Ed Maste via Phabricator via cfe-commits
emaste accepted this revision.
emaste added a comment.

In https://reviews.llvm.org/D43378#1010574, @devnexen wrote:

> As I see only x86_64 arch implements everything (e.g. custom event), making 
> things easier maybe. arm family might be enabled, power pc might need to 
> rewrite as x86_64 arch some linux-ism ... might be doable in a timely manner 
> I'd say (to take with a grain of salt though).


Ok, thanks. I am most interested in adding at least 64- and 32-bit Arm 
initially.


https://reviews.llvm.org/D43378



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D42645: New simple Checker for mmap calls

2018-02-21 Thread Ed Maste via Phabricator via cfe-commits
emaste added inline comments.



Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:417-419
+// Operating systems specific PROT_READ/PROT_WRITE values is not implemented,
+// thus ought to be overriden with the proper analyser-config variables
+// remain in alpha until the state changes

I'm a bit confused by this comment; this checker works as-is for most common 
operating system cases, correct?



Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:64
+  if (!BT)
+BT.reset(new BugType(this, "W^X check fails, Write Exec prot flags 
set", "Security"));
+

`Write & Exec` (or `Write and Exec`) perhaps (assuming it doesn't become 
over-long then)?


https://reviews.llvm.org/D42645



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D43378: FreeBSD driver / Xray flags moving pthread to compile flags.

2018-02-16 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

LGTM with one small note.

What will it take for us to enable this on the rest of the platforms 
Clang/FreeBSD supports?




Comment at: test/Driver/XRay/lit.local.cfg:7-8
 supported_targets = [
 'x86_64', 'x86_64h', 'arm', 'aarch64', 'arm64', 'powerpc64le', 'mips',
-'mipsel', 'mips64', 'mips64el'
+'mipsel', 'mips64', 'mips64el', 'amd64'
 ]

Minor quibble, probably worth grouping `amd64` with `x86_64`, as `aarch64` and 
`arm64` are.


https://reviews.llvm.org/D43378



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D43378: FreeBSD driver / Xray flags moving pthread to compile flags.

2018-02-16 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Please upload reviews with context (e.g. `git diff -U9`, `git show 
-U9`, or `svn diff -x -U99`).
See https://llvm.org/docs/Phabricator.html for more info.




Comment at: lib/Driver/XRayArgs.cpp:60
   D.Diag(diag::err_drv_clang_unsupported)
   << (std::string(XRayInstrumentOption) + " on non-Linux target OS");
 XRayInstrument = true;

krytarowski wrote:
> Please make this message generic - replace `non-Linux` target with a better 
> wording.
Maybe just `on target OS` or `on specified target OS`?


https://reviews.llvm.org/D43378



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D41930: [Fuchsia] Use llvm-objcopy as objcopy on Linux

2018-01-10 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

The title is more correctly "non-Apple hosts"? I.e., building on FreeBSD will 
also use llvm-objcopy.


Repository:
  rC Clang

https://reviews.llvm.org/D41930



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D23934: Add a -ffixed-date-time= flag that sets the initial value of __DATE__, __TIME__, __TIMESTAMP__

2017-12-20 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Ping?


https://reviews.llvm.org/D23934



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D38900: libunwind: document tested FreeBSD configs and sort OS list

2017-10-14 Thread Ed Maste via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL315814: libunwind: document tested FreeBSD configs and sort 
OS list (authored by emaste).

Changed prior to commit:
  https://reviews.llvm.org/D38900?vs=118958=119031#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38900

Files:
  libunwind/trunk/docs/index.rst


Index: libunwind/trunk/docs/index.rst
===
--- libunwind/trunk/docs/index.rst
+++ libunwind/trunk/docs/index.rst
@@ -44,13 +44,14 @@
    
 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.


Index: libunwind/trunk/docs/index.rst
===
--- libunwind/trunk/docs/index.rst
+++ libunwind/trunk/docs/index.rst
@@ -44,13 +44,14 @@
    
 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


[PATCH] D38900: libunwind: document tested FreeBSD configs and sort OS list

2017-10-13 Thread Ed Maste via Phabricator via cfe-commits
emaste added a subscriber: bsdjhb.
emaste added a comment.

In https://reviews.llvm.org/D38900#897304, @krytarowski wrote:

> @joerg might have insight on ppc, sparc64, arm on NetBSD.


And @bsdjhb for other architectures on FreeBSD.

But I wanted to at least list x86_64 and ARM64 for FreeBSD, where we now have 
LLVM's libunwind in the base system enabled for those architectures.


https://reviews.llvm.org/D38900



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D38900: libunwind: document tested FreeBSD configs and sort OS list

2017-10-13 Thread Ed Maste via Phabricator via cfe-commits
emaste created this revision.
Herald added subscribers: kristof.beyls, krytarowski, aemerson.

libunwind is known to work on FreeBSD/amd64 and FreeBSD/arm64, and is the 
default unwinder on both of those architectures.

While here sort the OS list.


https://reviews.llvm.org/D38900

Files:
  docs/index.rst


Index: docs/index.rst
===
--- docs/index.rst
+++ docs/index.rst
@@ -44,13 +44,14 @@
    
 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  x86_64, ARM64ClangDWARF 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.


Index: docs/index.rst
===
--- docs/index.rst
+++ docs/index.rst
@@ -44,13 +44,14 @@
    
 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  x86_64, ARM64ClangDWARF 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


[PATCH] D29032: [mips] Define macros related to -mabicalls in the preprocessor

2017-01-26 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

> My concern is that the stock gcc distributions for FreeBSD, NetBSD from your 
> sources doesn't define __mips_abicalls,

I think we should consider that a bug in GCC that we'll rectify. If 
`__mips_abicalls` is used in Linux GCC then we can expect 3rd party sources to 
check it, and we can migrate the in-tree (base system) uses to follow suit 
(even if we're stuck with the toolchain defining both indefinitely).


https://reviews.llvm.org/D29032



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D29032: [mips] Define macros related to -mabicalls in the preprocessor

2017-01-24 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

In https://reviews.llvm.org/D29032#654854, @emaste wrote:

> As mentioned in https://reviews.llvm.org/D29032


Err, that should be https://reviews.llvm.org/D29024


https://reviews.llvm.org/D29032



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D29032: [mips] Define macros related to -mabicalls in the preprocessor

2017-01-24 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

As mentioned in https://reviews.llvm.org/D29032 I agree with @joerg - 
`__mips_abicalls` should always be defined if this is what GCC does.


https://reviews.llvm.org/D29032



___
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

2017-01-03 Thread Ed Maste via Phabricator via cfe-commits
emaste abandoned this revision.
emaste added a comment.

Abandon in favour of https://reviews.llvm.org/D23934


https://reviews.llvm.org/D20791



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D23934: Add a -ffixed-date-time= flag that sets the initial value of __DATE__, __TIME__, __TIMESTAMP__

2016-12-29 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment.

Please also accept `SOURCE_DATE_EPOCH` set in the environment -- see 
https://reproducible-builds.org/specs/source-date-epoch/

Also although I'm generally leery of options auto-detecting the argument 
format, I think we should be able to pass an epoch timestamp to 
-ffixed-date-time.


https://reviews.llvm.org/D23934



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits