This is an archive of the discontinued LLVM Phabricator instance.

Add option LLVM_NM to allow specifying the location of the llvm-nm tool.
ClosedPublic

Authored by arlosi on Jul 1 2020, 9:12 PM.

Details

Summary

The new option works like the existing LLVM_TABLEGEN, and LLVM_CONFIG_PATH options.
Instead of building llvm-nm, the build uses the executable defined by LLVM_NM.

This is useful for cross-compilation scenarios where the host cannot run the cross-compiled
tool, and recursing into another cmake build is not an option (due to required DEFINE's, for example).

Diff Detail

Event Timeline

arlosi created this revision.Jul 1 2020, 9:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2020, 9:12 PM
Herald added a subscriber: mgorny. · View Herald Transcript
smeenai accepted this revision.Jul 2 2020, 6:35 PM

LGTM

llvm/tools/llvm-shlib/CMakeLists.txt
167

I guess this works and is a no-op, but setting this variable to empty (or not setting it at all) should also work, I believe, and perhaps expresses the intent clearer (that there's no target for llvm-nm and you're just supplying a prebuilt one).

This revision is now accepted and ready to land.Jul 2 2020, 6:35 PM
arlosi updated this revision to Diff 275754.Jul 6 2020, 10:04 AM

Set llvm_nm_target to empty string as requested by smeenai.

arlosi marked an inline comment as done.Jul 6 2020, 10:05 AM

I do not have commit access. Could someone land this for me?

Sure, I'll land it for you.

This revision was automatically updated to reflect the committed changes.