Bug 7752 - ccache does not support '--sysroot' for CCACHE_BASEDIR
Summary: ccache does not support '--sysroot' for CCACHE_BASEDIR
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.1
Hardware: x86 Linux
: P3 normal
Target Milestone: 3.2
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-26 01:24 UTC by Bo
Modified: 2011-08-21 14:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bo 2010-10-26 01:24:57 UTC
In my project, option '--sysroot' is widely used.  When I specified CCACHE_BASEDIR variable, I found ccache does not substitute this path to a relative path.  I made the following patch and it seems work well.

Index: /home/yeb/test/ccache-3.1/ccache.c
===================================================================
--- /home/yeb/test/ccache-3.1/ccache.c
+++ /home/yeb/test/ccache-3.1/ccache.c  2010-09-17 01:01:09.000000000 +0800
@@ -1365,15 +1365,6 @@ cc_process_args(struct args *orig_args,
                                continue;
                        }
                }
-               if (str_startswith(argv[i], "--sysroot=")) {
-                       free(output_dep);
-                       char *relpath = make_relative_path(x_strdup(argv[i] + 10));
-                       char *option = format("--sysroot=%s", relpath);
-                       args_add(stripped_args, option);
-                       free(relpath);
-                       free(option);
-                       continue;
-               }
                if (str_startswith(argv[i], "-Wp,")) {
                        if (str_startswith(argv[i], "-Wp,-MD,") && !strchr(argv[i] + 8, ',')) {
                                generating_dependencies = true;
Comment 1 Joel Rosdahl 2010-10-27 14:30:24 UTC
Thanks! Committed in 1c70e25cb57eb813707cec996ef557e80203de1a with a bug fix and a test case.
Comment 2 Joel Rosdahl 2011-08-21 14:43:46 UTC
Included in v3.1.6.