Let cmake infer source file language by the file extension.

This applies default compiler flags to .S files, in particular removing
the "-pedantic" option, which is desirable because there is nothing to
reasonably warn about; and the only thing that gcc warns about is that
you allegedly can't correctly invoke GLUE2 in lib/builtins/assembly.h
on platforms for which USER_LABEL_PREFIX is the empty string.

In the gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33305 that
added the warning, a commenter notes that giving a macro of zero characters
to another macro is not precisely the same as failing to supply an argument,
and "there is a widespread belief in C++ community that such usage is valid".
Unfortunately the only way to silence the warning is to avoid -pedantic.

Differential Revision: http://reviews.llvm.org/D10713

llvm-svn: 243446
This commit is contained in:
Douglas Katzman 2015-07-28 16:52:42 +00:00
parent db07c40943
commit c4ffd48aba
2 changed files with 1 additions and 2 deletions

View File

@ -9,7 +9,7 @@
# Check if compiler-rt is built as a standalone project.
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(CompilerRT C CXX)
project(CompilerRT C CXX ASM)
set(COMPILER_RT_STANDALONE_BUILD TRUE)
else()
set(COMPILER_RT_STANDALONE_BUILD FALSE)

View File

@ -286,7 +286,6 @@ if (NOT WIN32 OR MINGW)
endif ()
endforeach ()
set_source_files_properties(${${arch}_SOURCES} PROPERTIES LANGUAGE C)
add_compiler_rt_runtime(clang_rt.builtins-${arch} ${arch} STATIC
SOURCES ${${arch}_SOURCES}
CFLAGS "-std=c99")