This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add *BSD support to Optimizer/CodeGen/Target.cpp
AbandonedPublic

Authored by brad on Sep 9 2022, 12:57 AM.

Details

Summary

Add OpenBSD, FreeBSD, NetBSD and DragonFly to the aarch64 / x86 and x86_64 targets as appropriate.

Fixes 53 tests.

Diff Detail

Event Timeline

brad created this revision.Sep 9 2022, 12:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 12:57 AM
brad requested review of this revision.Sep 9 2022, 12:57 AM
brad updated this revision to Diff 460629.Sep 15 2022, 9:44 PM
brad edited the summary of this revision. (Show Details)
brad retitled this revision from [flang] Add OpenBSD support to Optimizer/CodeGen/Target.cpp to [flang] Add *BSD support to Optimizer/CodeGen/Target.cpp.Sep 15 2022, 9:44 PM
rovka added a comment.Sep 16 2022, 1:26 AM

Hi, I have a couple of questions:

  • Are you actually testing on all these platforms? I don't think I've seen any BSD binaries for LLVM 15.
  • Do you plan to add any buildbots with flang on *BSD?
  • How different is the ABI from plain Linux? Will you need any changes in the handling of Complex / Character types (see the target-rewrite-* tests like this one) ?
brad added a subscriber: MaskRay.Sep 17 2022, 11:48 PM
brad added a comment.Oct 3 2022, 11:37 AM

Hi, I have a couple of questions:

  • Are you actually testing on all these platforms? I don't think I've seen any BSD binaries for LLVM 15.
  • Do you plan to add any buildbots with flang on *BSD?
  • How different is the ABI from plain Linux? Will you need any changes in the handling of Complex / Character types (see the target-rewrite-* tests like this one) ?
  • I am only testing on OpenBSD. I see there was a bootstrapping issue with 15 on FreeBSD due to an issue with libc++ and their libc++ ABI library.
  • I think there is work on going to create a CI bot for FreeBSD to build libc++ due to the bootstrapping issue. Maybe that CI bot could have a build as well.
brad updated this revision to Diff 464750.Oct 3 2022, 11:37 AM

This patch is fine but I do not know why there are these OS dispatches. If Linux is allowed, it seems to me that all ELF based OSes should be allowed as well.

Hi, I have a couple of questions:

  • Are you actually testing on all these platforms? I don't think I've seen any BSD binaries for LLVM 15.
  • Do you plan to add any buildbots with flang on *BSD?
  • How different is the ABI from plain Linux? Will you need any changes in the handling of Complex / Character types (see the target-rewrite-* tests like this one) ?

The ELF operating systems have identical codegen behaviors since they follow the same ABI documents: System V Application Binary Interface + Processor Supplementary ABIs.
If some compatibility check is needed, it should be among Mach-O/Windows/ELF. But I don't think such a restriction is useful in codegen. Such check should be moved to Driver.
Sent D135100

brad abandoned this revision.Oct 13 2022, 11:34 AM

Closing, superseded by D135100.