This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Make sure _cmake_system_name has a default
ClosedPublic

Authored by daltenty on Sep 23 2020, 9:01 AM.

Details

Summary

We currently try to pick it up from the CMake arguments passed to llvm_ExternalProject_Add but
if there isn't an explicit option passed, we should reflect CMake's own default behaviour
of targeting the host, since we'll make decisions about what tools to use for the build based on
the setting. Otherwise, we'll get different behaviour between configuring an external project with
the default target and configuring with an explicit one targeting the same platform.

Diff Detail

Event Timeline

daltenty created this revision.Sep 23 2020, 9:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2020, 9:01 AM
daltenty requested review of this revision.Sep 23 2020, 9:01 AM
llvm/cmake/modules/LLVMExternalProjectUtils.cmake
55

Capitalize as a sentence. Also, is this a statement about the behaviour of CMake (and we're just reflecting that locally through _cmake_system_name) or a statement about what this code is causing CMake to do? Please reword to clarify.

I would also suggest some editing of the patch description.

daltenty updated this revision to Diff 293797.Sep 23 2020, 10:42 AM
  • Update comment
daltenty retitled this revision from [CMake] Make sure _cmake_system_name gets set to [CMake] Make sure _cmake_system_name has a default.Sep 23 2020, 10:47 AM
daltenty edited the summary of this revision. (Show Details)
daltenty marked an inline comment as done.
hubert.reinterpretcast edited the summary of this revision. (Show Details)

LGTM; thanks.

This revision is now accepted and ready to land.Sep 23 2020, 2:40 PM
stevewan accepted this revision.Sep 23 2020, 3:04 PM

This is consistent with the CMAKE default behaviour. LGTM. Let's see if other reviewers have further input about the updated comment.

This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.Sep 28 2020, 2:16 PM

This broke our macOS builders because now llvm-libtool-darwin tool is being used by default which leads to a build failure:

Merging archives: ['/b/s/w/ir/x/w/staging/llvm_build/lib/libc++abi.a', '/b/s/w/ir/x/w/staging/llvm_build/lib/libunwind.a']
Command: '/b/s/w/ir/x/w/staging/llvm_build/bin/llvm-libtool-darwin' '-static' '-o' '/b/s/w/ir/x/w/staging/llvm_build/lib/libc++abi.a' '-s' 'cxa_aux_runtime.cpp.o' 'cxa_default_handlers.cpp.o' 'cxa_demangle.cpp.o' 'cxa_exception_storage.cpp.o' 'cxa_guard.cpp.o' 'cxa_handlers.cpp.o' 'cxa_vector.cpp.o' 'cxa_virtual.cpp.o' 'stdlib_exception.cpp.o' 'stdlib_stdexcept.cpp.o' 'stdlib_typeinfo.cpp.o' 'abort_message.cpp.o' 'fallback_malloc.cpp.o' 'private_typeinfo.cpp.o' 'stdlib_new_delete.cpp.o' 'cxa_exception.cpp.o' 'cxa_personality.cpp.o' 'libunwind.cpp.o' 'Unwind-EHABI.cpp.o' 'Unwind-seh.cpp.o' 'Unwind_AppleExtras.cpp.o' 'UnwindLevel1.c.o' 'UnwindLevel1-gcc-ext.c.o' 'Unwind-sjlj.c.o' 'UnwindRegistersRestore.S.o' 'UnwindRegistersSave.S.o'
Exit Code: 1
Standard Error:
--
llvm-libtool-darwin: Unknown command line argument '-s'.  Try: '/b/s/w/ir/x/w/staging/llvm_build/bin/llvm-libtool-darwin --help'
llvm-libtool-darwin: Did you mean '-D'?
--

This broke our macOS builders because now llvm-libtool-darwin tool is being used by default which leads to a build failure:

Merging archives: ['/b/s/w/ir/x/w/staging/llvm_build/lib/libc++abi.a', '/b/s/w/ir/x/w/staging/llvm_build/lib/libunwind.a']
Command: '/b/s/w/ir/x/w/staging/llvm_build/bin/llvm-libtool-darwin' '-static' '-o' '/b/s/w/ir/x/w/staging/llvm_build/lib/libc++abi.a' '-s' 'cxa_aux_runtime.cpp.o' 'cxa_default_handlers.cpp.o' 'cxa_demangle.cpp.o' 'cxa_exception_storage.cpp.o' 'cxa_guard.cpp.o' 'cxa_handlers.cpp.o' 'cxa_vector.cpp.o' 'cxa_virtual.cpp.o' 'stdlib_exception.cpp.o' 'stdlib_stdexcept.cpp.o' 'stdlib_typeinfo.cpp.o' 'abort_message.cpp.o' 'fallback_malloc.cpp.o' 'private_typeinfo.cpp.o' 'stdlib_new_delete.cpp.o' 'cxa_exception.cpp.o' 'cxa_personality.cpp.o' 'libunwind.cpp.o' 'Unwind-EHABI.cpp.o' 'Unwind-seh.cpp.o' 'Unwind_AppleExtras.cpp.o' 'UnwindLevel1.c.o' 'UnwindLevel1-gcc-ext.c.o' 'Unwind-sjlj.c.o' 'UnwindRegistersRestore.S.o' 'UnwindRegistersSave.S.o'
Exit Code: 1
Standard Error:
--
llvm-libtool-darwin: Unknown command line argument '-s'.  Try: '/b/s/w/ir/x/w/staging/llvm_build/bin/llvm-libtool-darwin --help'
llvm-libtool-darwin: Did you mean '-D'?
--

D88449 should address this issue.

This broke our macOS builders because now llvm-libtool-darwin tool is being used by default which leads to a build failure:

D88449 should address this issue.

Sorry for the breakage.