This is an archive of the discontinued LLVM Phabricator instance.

[PPC] Fix platform definitions when compiling FreeBSD powerpc64 as LE
ClosedPublic

Authored by Bdragon28 on Jan 25 2020, 10:39 PM.

Details

Summary

As a prerequisite to doing experimental buids of pieces of FreeBSD PowerPC64 as little-endian, allow actually targeting it.

This is needed so basic platform definitions are pulled in. Without it, the compiler will only run freestanding.

Diff Detail

Event Timeline

Bdragon28 created this revision.Jan 25 2020, 10:39 PM

At a minimum, test/Driver/freebsd.c and test/Preprocessor/init-ppc64.c should be updated for powerpcle-unknown-freebsd tests.

Bdragon28 updated this revision to Diff 287795.Aug 25 2020, 4:29 PM
Bdragon28 added reviewers: MaskRay, dim.

Add some tests for the new target.

MaskRay added inline comments.Aug 25 2020, 5:12 PM
clang/test/Driver/freebsd.c
32

Drop // on otherwise empty lines.

clang/test/Driver/ppc-abi.c
24

One freebsd13 should be sufficient?

Every RUN line makes the testsuite a bit slower.

Bdragon28 added inline comments.Aug 25 2020, 5:24 PM
clang/test/Driver/freebsd.c
32

Filewide? I was attempting to follow the style of the surrounding code.

clang/test/Driver/ppc-abi.c
24

Fine with that, will change. Was just matching what ELFv2-BE does.

Bdragon28 updated this revision to Diff 287811.Aug 25 2020, 5:46 PM

Use correct target for FreeBSD driver test.

Address review comments.

Bdragon28 marked 2 inline comments as done.Aug 25 2020, 5:47 PM
MaskRay accepted this revision.Aug 25 2020, 5:53 PM

Thanks!

This revision is now accepted and ready to land.Aug 25 2020, 5:53 PM
emaste added inline comments.Aug 25 2020, 6:12 PM
clang/lib/Basic/Targets.cpp
361–362

List was previously in alpha order

Bdragon28 added inline comments.Aug 26 2020, 1:45 PM
clang/lib/Basic/Targets.cpp
361–362

Yes. However, I am following the ordering of the ppc64 and powerpc triples.

Bdragon28 added inline comments.Aug 26 2020, 1:49 PM
clang/lib/Basic/Targets.cpp
361–362

that is, the ordering is "Linux, the BSDs, Embedded targets, Commercial targets" for ppc*.

emaste added inline comments.Aug 28 2020, 11:55 AM
clang/lib/Basic/Targets.cpp
361–362

Ok, as long as it's consistent I'm happy with it

Bdragon28 marked 2 inline comments as done.Aug 28 2020, 2:09 PM

Any chance of a backport to 11?

MaskRay added a subscriber: hans.Sep 10 2020, 1:08 PM

Any chance of a backport to 11?

CC the release manager @hans

Perhaps there is still time http://lists.llvm.org/pipermail/llvm-dev/2020-September/144961.html

dim added a comment.Sep 10 2020, 1:11 PM

Any chance of a backport to 11?

I submitted https://bugs.llvm.org/show_bug.cgi?id=47485 for this.

hans added a comment.Sep 11 2020, 2:10 AM

This is new functionality, so I don't think we should merge it so late in the release process.

That's fair. Will just use a patch on the FreeBSD side and revisit after 11.0.0 is released. Thanks.