Bug 657857

Summary: ccache generates invalid error when compiling with specific options, makes Eclipse projects problematic
Product: [Fedora] Fedora Reporter: Hedayat Vatankhah <hedayatv>
Component: ccacheAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 14CC: joel, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ccache-3.1.3-1.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-30 22:46:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hedayat Vatankhah 2010-11-28 13:47:23 UTC
Description of problem:
If you create a simple C/C++ project in Eclipse with the default settings and try 
to build in Debug configuration, it'll fail with an error message like this:
cc1plus: error: to generate dependencies you must specify either -M or -MM

This is not an eclipse error, a sample command like this generates the same error:
g++ -g3 -c -MMD -MP -MF"MyFile.d" -MT"MyFile.d" -o"MyFile.o" "../MyFile.cpp"

Apparently, this is a ccache bug, if you export CCACHE_DISABLE=1 or run g++ directly:
/usr/bin/g++ -g3 -c -MMD -MP -MF"MyFile.d" -MT"MyFile.d" -o"MyFile.o" "../MyFile.cpp"

You won't see the error message. (The error will vanish if you add an space after MT and MF options too).

Anyway, this bug brings a considerable inconvenience when using Eclipse since there is no way to add spaces after MF and MT there. The only solution is to add some flags or disable CCACHE completely.

Version-Release number of selected component (if applicable):
ccache-3.1-1.fc14.x86_64

How reproducible:
100%

Steps to Reproduce:
1. install ccache
2. run the sample command given above for a sample source code
  
Actual results:
fails with the given error

Expected results:
should compile successfully (if the source code is OK!)

Additional info:
affects a lot of users

Comment 1 Ville Skyttä 2010-11-28 15:20:33 UTC
ccache 3.1.2 is currently in updates-testing; it probably won't help with this issue but it wouldn't hurt to try:

https://admin.fedoraproject.org/updates/ccache-3.1.2-1.fc14

Cc'd and copied upstream.

Comment 2 Joel Rosdahl 2010-11-28 15:42:25 UTC
Yes, the problem is that GCC accepts -MFarg and MTarg (and -MQarg) without spaces (which is undocumented) but ccache doesn't.

Comment 3 Fedora Update System 2010-11-28 20:03:44 UTC
ccache-3.1.3-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/ccache-3.1.3-1.fc14

Comment 4 Hedayat Vatankhah 2010-11-28 21:02:24 UTC
Works fine. Thank you for your fast support :)

Comment 5 Fedora Update System 2010-11-29 21:33:55 UTC
ccache-3.1.3-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ccache'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/ccache-3.1.3-1.fc14

Comment 6 Fedora Update System 2010-11-30 22:45:40 UTC
ccache-3.1.3-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.