[Lldb-commits] [PATCH 3/4] cmake build: Fix building of HasAVX.s

Kuba Ober kuba at mareimbrium.org
Wed Mar 12 15:53:14 PDT 2014


Yes, it is, and if you look closely, you’ll find it elsewhere in LLVM sources IIRC.
Unfortunately, cmake’s assembly support is quite broken.

There are two workarounds here.

1. Providing COMPILE_FLAGS when .S would ordinarily suffice. That’s simply a missing
feature in cmake.

2. Overriding the LANGUAGE with C, instead of specifying ASM (instead of ASM-ATT)
to project() in tools/debugserver/CMakeLists.txt. It’s either a cmake bug or a
cmakelists bug in LLVM.


For a stand-alone testcase project, specifying ASM (as opposed to ASM-ATT)
language in the project() specification works - it will choose gcc or clang-based
assembler instead of as.

Alas, I couldn’t get this to work in llvm, the assembler detection is broken
by something in llvm and CMAKE_ASM_COMPILE_OBJECT is never set.

Cheers, Kuba Ober

On Mar 12, 2014, at 5:49 PM, Jevin Sweval <jevinsweval at gmail.com> wrote:

> On Wed, Mar 12, 2014 at 3:43 PM, Kuba Ober <kuba at mareimbrium.org> wrote:
>> ---
>> tools/debugserver/source/MacOSX/CMakeLists.txt | 6 ++++++
>> 1 file changed, 6 insertions(+)
>> 
>> diff --git a/tools/debugserver/source/MacOSX/CMakeLists.txt b/tools/debugserver/source/MacOSX/CMakeLists.txt
>> index b955917..8e2ec1c 100644
>> --- a/tools/debugserver/source/MacOSX/CMakeLists.txt
>> +++ b/tools/debugserver/source/MacOSX/CMakeLists.txt
>> @@ -40,6 +40,12 @@ add_lldb_executable(debugserver
>>   ${generated_mach_interfaces}
>>   )
>> 
>> +set_source_files_properties(
>> +  HasAVX.s
>> +  # Necessary since compilation will fail with stand-alone assembler
>> +  PROPERTIES LANGUAGE C COMPILE_FLAGS "-x assembler-with-cpp"
>> +  )
>> +
>> add_dependencies(debugserver generate_dnbconfig)
>> target_link_libraries(debugserver ${DEBUGSERVER_USED_LIBS})
>> 
> 
> I noticed this one too. I tried to fix it "cleanly" by renaming it to
> HasAVX.S (note the capital S) but CMake didn't get the hint that it
> was supposed to be passed through cpp. Is this the cleanest way of
> telling CMake what is going on?
> 
> Cheers,
> Jevin





More information about the lldb-commits mailing list