Bug 1672012

Summary: clang $(llvm-config --cflags) doesn't work
Product: [Fedora] Fedora Reporter: Emilio Cobos Álvarez (:emilio) <emilio>
Component: clangAssignee: Tom Stellard <tstellar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: airlied, davejohansen, sbergman, sguelton, siddharth.kde, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-18 02:04:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Emilio Cobos Álvarez (:emilio) 2019-02-03 05:11:00 UTC
Description of problem:

The following command doesn't succeed on rawhide:

$ echo "int main() {}" | clang $(llvm-config --cflags) -x c -

It fails with:

clang-7: error: unknown argument: '-fstack-clash-protection'

I assume this is because llvm has been compiled with gcc, and using gcc instead of clang works. But it's a bit surprising being forced to compile clang plugins with gcc.

Version-Release number of selected component (if applicable): clang version 7.0.1 (Fedora 7.0.1-2.fc30)


How reproducible: Always


Steps to Reproduce:
1. See above.

Actual results: Fails as described above.

Expected results: Succeeds, and generates an executable that does nothing.

Comment 1 serge_sans_paille 2019-02-03 09:19:05 UTC
> I assume this is because llvm has been compiled with gcc, and using gcc instead of clang works.

Exactly. @tstellar, maybe clang should just issue a warning for this specific flag, instead of throwing an error?

Comment 2 Tom Stellard 2019-02-04 17:15:51 UTC
This has been fixed upstream in LLVM by https://reviews.llvm.org/rL349068.

Comment 3 serge_sans_paille 2019-02-04 17:25:39 UTC
Great. Should we backport it to llvm-7 then?

Comment 4 Tom Stellard 2019-02-04 17:28:09 UTC
Yes, let's backport it.

Comment 5 Tom Stellard 2019-02-09 04:09:19 UTC
I'll take this one.

Comment 6 Tom Stellard 2019-02-12 20:30:43 UTC
Submitted PR: https://src.fedoraproject.org/rpms/llvm/pull-request/9

Comment 7 Fedora Update System 2019-02-15 17:04:12 UTC
llvm-7.0.1-3.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-b2152f77e0

Comment 8 Fedora Update System 2019-02-16 03:05:17 UTC
llvm-7.0.1-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-b2152f77e0

Comment 9 Fedora Update System 2019-02-18 02:04:12 UTC
llvm-7.0.1-3.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.