adalava marked an inline comment as done.
adalava added a comment.

In D61950#1504169 <https://reviews.llvm.org/D61950#1504169>, @MaskRay wrote:

> Will FreeBSD 13 or future releases support ELFv1? If not, it may be cleaner 
> to not invent `-elfv2` `-elfv1` triples, but rather dispatch on the major 
> version, e.g. `powerpc64-unknown-freebsd13.0` could mean ELFv2.


Invent  `-elfv2` `-elfv1` and make it used by default is not the goal here but 
add ABI target triple support. Discussions at #llvm 
<https://reviews.llvm.org/tag/llvm/> IRC channel shown that provide ABI in 
target triple is more acceptable than using `-mabi=elfv2`, so this patch is for 
when you want and ABI other than default (that was based on <arch>, <os> or 
<os_version>)

For FreeBSD, in the future default ABI will be decided based on OS version on 
triple  `powerpc64-unknown-freebsd<os_version>`. However, there's currently no 
agreement on what will be that <os_version>. As 13.0 is currently ELFv1, so 
LLVM couldn't assume 13.0 is ELFv2 at this moment.

So, during the transition period, developers could use TARGET_ABI variable to 
build the FreeBSD PPC64 ELFv2 version. As example,  building FreeBSD with `make 
TARGET=powerpc TARGET_ARCH=powerpc64 TARGET_ABI=elfv2`, where it's expected to 
form a target triple like `powerpc64-unknown-freebsd13.0-elfv2`, based on 
"<arch><sub>-<vendor>-<sys>-<abi>" definition. That is passed right away to 
clang.

If it's not possible, we would have to patch FreeBSD makefiles to not use 
TARGET_ABI variable value when TARGET_ARCH is powerpc64, and append -mabi=elfv2 
instead. This sounds feasible, however clang running on final ELFv2 userland 
won't know it's on ELFv2 and users will need to specify `-mabi=elfv2` and 
CFLAGS/CXXFLAGS to compile applications. This is unfeasible, specially for 
FreeBSD ports, as many packages didn't handle these variables correctly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61950



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

Reply via email to