Bug 1082717

Summary: Checking influence of “llvm-config” on building software with GCC
Product: [openSUSE] openSUSE Tumbleweed Reporter: Markus Elfring <Markus.Elfring>
Component: DevelopmentAssignee: Michal Srb <msrb>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Markus Elfring 2018-02-25 17:48:34 UTC
The following software packages are installed also on my system.
* GCC 7-2.9
* llvm5-devel 5.0.1-4.3


I have noticed the software situation that the command “llvm-config --cflags” can provide a compilation parameter which will trigger the message “cc: error: unrecognized command line option ‘-Wstring-conversion’; did you mean ‘-Wint-conversion’?”.

Example:
https://build.opensuse.org/package/show/openSUSE%3AFactory/smatch

If I try another software build try out by a command like “make CC=clang …”, it can succeed.


How should this configuration tool be improved?
Comment 1 Michal Srb 2018-03-20 09:36:58 UTC
It is true that the llvm-config --help shows:

  --cflags          C compiler flags for files that include LLVM headers.

I would interpret it as the minimum amount of flags needed to use the headers. I would not expect it to include clang specific warnings like the ‘-Wstring-conversion’. However I am afraid there is not much we can do about it on distribution level. Please report it to LLVM upstream.

As a workaround you can use clang, or filter llvm-config's output, or not use it at all. For example Mesa, one of the biggest users of LLVM in openSUSE, strips away many unwanted flags:
https://cgit.freedesktop.org/mesa/mesa/tree/configure.ac#n1059
Comment 2 Markus Elfring 2018-03-20 13:40:13 UTC
(In reply to Michal Srb from comment #1)

I am curious if the clarification will be continued for this software situation:
Checking provided compilation parameters
https://bugs.llvm.org/show_bug.cgi?id=36818