- User-defined CPPFLAGS and LDFLAGS is now respected in the Makefile.
- - Bail out on profiling flags --coverage, -fprofile-arcs and -ftest-coverage.
-
- Fixed NFS issues.
+ - Bail out on profiling flags --coverage, -fprofile-arcs and -ftest-coverage.
+
- -MD/-MMD flags without -MT/-MF are now handled correctly.
+ - Added support for -Wp,-MD and -Wp,-MMD flags.
+
- Corrected LRU cleanup handling of object files.
- utimes() is now used instead of utime() when available.
/* These options require special handling, because they
behave differently with gcc -E, when the output
file is not specified. */
- if (strcmp(argv[i], "-MD") == 0 || strcmp(argv[i], "-MMD") == 0) {
+ if (strcmp(argv[i], "-MD") == 0
+ || strcmp(argv[i], "-MMD") == 0) {
generating_dependencies = 1;
}
if (i < argc - 1) {
}
}
+ if (enable_direct && strncmp(argv[i], "-Wp,", 4) == 0) {
+ if (strncmp(argv[i], "-Wp,-MD,", 8) == 0) {
+ generating_dependencies = 1;
+ dependency_filename_specified = 1;
+ dependency_path = x_strdup(argv[i] + 8);
+ } else if (strncmp(argv[i], "-Wp,-MMD,", 9) == 0) {
+ generating_dependencies = 1;
+ dependency_filename_specified = 1;
+ dependency_path = x_strdup(argv[i] + 9);
+ } else if (enable_direct) {
+ cc_log("Unsupported compiler option for direct mode: %s\n",
+ argv[i]);
+ enable_direct = 0;
+ }
+ }
+
/* options that take an argument */
{
const char *opts[] = {"-I", "-include", "-imacros", "-iprefix",
mv test3.h.saved test3.h
sleep 1 # Sleep to make the include files trusted.
+ rm -f other.d
+
+ ##################################################################
+ # Check that -Wp,-MD,file.d works.
+ testname="-Wp,-MD"
+ $CCACHE -z >/dev/null
+ $CCACHE $COMPILER -c -Wp,-MD,other.d test.c
+ checkstat 'cache hit (direct)' 0
+ checkstat 'cache hit (preprocessed)' 0
+ checkstat 'cache miss' 1
+ checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+
+ rm -f other.d
+
+ $CCACHE $COMPILER -c -Wp,-MD,other.d test.c
+ checkstat 'cache hit (direct)' 1
+ checkstat 'cache hit (preprocessed)' 0
+ checkstat 'cache miss' 1
+ checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+
+ rm -f other.d
+
+ ##################################################################
+ # Check that -Wp,-MMD,file.d works.
+ testname="-Wp,-MMD"
+ $CCACHE -z >/dev/null
+ $CCACHE $COMPILER -c -Wp,-MMD,other.d test.c
+ checkstat 'cache hit (direct)' 0
+ checkstat 'cache hit (preprocessed)' 0
+ checkstat 'cache miss' 1
+ checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+
+ rm -f other.d
+
+ $CCACHE $COMPILER -c -Wp,-MMD,other.d test.c
+ checkstat 'cache hit (direct)' 1
+ checkstat 'cache hit (preprocessed)' 0
+ checkstat 'cache miss' 1
+ checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+
+ rm -f other.d
+
##################################################################
# Test some header modifications to get multiple objects in the manifest.
testname="several objects"