This is an archive of the discontinued LLVM Phabricator instance.

LLVM_COMPILE_FLAGS also applies to C files
ClosedPublic

Authored by davezarzycki on Sep 4 2019, 7:16 AM.

Details

Summary

LLVM_COMPILE_FLAGS also applies to C files, otherwise tuning flags, etc won't be picked up.

Found via LLVM_COMPILE_FLAGS="-march=native" and objdump -d.

Diff Detail

Event Timeline

davezarzycki created this revision.Sep 4 2019, 7:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2019, 7:16 AM
Herald added a subscriber: mgorny. · View Herald Transcript

Hi,

When compiling with gcc, we get warnings with this commit:

[100/4153] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regfree.c.o
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
[101/4153] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regstrlcpy.c.o
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
[102/4153] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regerror.c.o
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
[107/4153] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regexec.c.o
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
[114/4153] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C

Hi @uabelho – Try r371521

Yep, that helps. Thanks!

davezarzycki accepted this revision.Sep 16 2019, 10:29 PM

r371173 and r371521

This revision is now accepted and ready to land.Sep 16 2019, 10:29 PM
davezarzycki closed this revision.Sep 16 2019, 10:29 PM