Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 204810
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Robin Johnson <robbat2@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Clemens Rabe <crabe@gmx.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
ccache-2.4-profile.patch Patch to prevent ccache from caching when -fprofile-* options are used. patch Clemens Rabe 2008-01-07 20:24 0000 1.04 KB Details | Diff
ccache-2.4-r7.ebuild Modified ebuild to apply the patch text/plain Clemens Rabe 2008-01-07 20:24 0000 2.47 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 204810 depends on: Show dependency tree
Bug 204810 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-01-07 20:22 0000
GCC support profile based optimization using the -fprofile-generate and
-fprofile-use options. The first instructs gcc to include hooks for the profile
data file generation, the latter uses them in the optimization step. The
profile data file is stored in the same directory as the source file, with the
suffix .gcda.
When using ccache, the input file names of gcc are replaced by temporary
(preprocessed) file names. As the file names differ between the first and the
second compilation step, gcc is unable to identify the profile data file and
can't use it.
The patch solves this problem by searching for the flags '-fprofile-generate',
'-fprofile-use' and '-fprofile-arcs'. If found, the caching is disabled and the
original gcc call (with the original input files) is performed.

Clemens

Reproducible: Always

Steps to Reproduce:
1. echo "int main(int a, char** b){}" > test.c
2. gcc -fprofile-generate -c test.c
3. gcc -fprofile-generate -o test test.o
4. ./test
5. gcc -fprofile-use -c test.c
6. gcc -o test test.o

Actual Results:  
With unpatched ccache:
5) Gives warning about $CCACHE_DIR/tmp.hash.*.gcda file not found, execution
counts assumed to be zero


Expected Results:  
With ccache:
2) Generated test.gcno in current directory
4) Generated test.gcda in current directory
5) No error.

------- Comment #1 From Clemens Rabe 2008-01-07 20:24:08 0000 -------
Created an attachment (id=140402) [details]
Patch to prevent ccache from caching when -fprofile-* options are used.

Patch used in attached ebuild to fix the bug.

------- Comment #2 From Clemens Rabe 2008-01-07 20:24:52 0000 -------
Created an attachment (id=140403) [details]
Modified ebuild to apply the patch

------- Comment #3 From Robin Johnson 2008-09-30 06:39:48 0000 -------
incvs.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug