Add rules to build LLVM IR binaries and libraries.
ClosedPublic

Authored by jonathan on Oct 31 2016, 1:42 AM.

Details

Summary

This commmit allows us to run make libfoo.ll or make libfoo.bc
(vs libfoo.so) to get the IR version of a library or make foo.full.ll,
etc., to get the IR version of a binary.

As part of this work, we add an LLVM_LINK variable to sys.mk that can
can be specified/overridden using an external toolchain.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jonathan retitled this revision from to Add rules to build LLVM IR binaries and libraries..Oct 31 2016, 1:42 AM
jonathan updated this object.
jonathan edited the test plan for this revision. (Show Details)
jonathan added reviewers: bdrewery, brooks, emaste, rwatson.

Conceptually good.

On pedantic personal preference note, it seems redundant to refer to the change as a commit in the log rather than just saying what is happening and why.

share/mk/bsd.lib.mk
211 ↗(On Diff #21815)

bsd.lib.mk seems to be missing CLEANFILES additions.

share/mk/bsd.prog.mk
157 ↗(On Diff #21815)

The PROX_CXX vs !PROG_CXX cases don't appear to be different. Am I missing something?

191 ↗(On Diff #21815)

There seems to be some preexisting whitespace difference after the += there (unless phab is making things up as it sometimes does) which might be made consistent with other nearby lines while you're here.

bdrewery accepted this revision.Oct 31 2016, 9:53 PM

Besides brooks' findings, it seems ok.

This revision is now accepted and ready to land.Oct 31 2016, 9:53 PM
jonathan updated this revision to Diff 21859.Nov 1 2016, 12:27 AM
jonathan marked 3 inline comments as done.
  • Add {BC,LL}OBJS to bsd.lib.mk's CLEANFILES.
  • Remove redundant C++/non-C++ logic.
  • Improve whitespace consistency.
This revision now requires review to proceed.Nov 1 2016, 12:27 AM

Thanks for the comments: I think I've managed to address them.

share/mk/bsd.lib.mk
211 ↗(On Diff #21815)

Right you are...

share/mk/bsd.prog.mk
157 ↗(On Diff #21815)

Ah, no, you aren't missing anything: this distinction matters in another version of the patch that handles linking to ELF binaries (where we need to know if we include libc++ or not), but not in this patch. In fact, the other patch can probably be simplified too now that this is going in first...

191 ↗(On Diff #21815)

Can do.

brooks accepted this revision.Nov 1 2016, 5:21 PM

Looks good to me

This revision is now accepted and ready to land.Nov 1 2016, 5:21 PM
This revision was automatically updated to reflect the committed changes.