]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Handle -g0 properly (#371)
authorPavol Sakac <26042917+pavsa@users.noreply.github.com>
Tue, 2 Apr 2019 18:57:38 +0000 (20:57 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 2 Apr 2019 18:57:38 +0000 (20:57 +0200)
src/ccache.c
test/suites/depend.bash

index 6bb63a013361bbe10636133bf67ddac6460c0394..d49fe86a0c7a7b432f4b011e3ea6a831a1f90b72 100644 (file)
@@ -2635,6 +2635,11 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
 
                // Debugging is handled specially, so that we know if we can strip line
                // number info.
+               if (str_eq(argv[i], "-g0")) {
+                   generating_debuginfo = false;
+                   continue;
+               }
+
                if (str_startswith(argv[i], "-g")) {
                        generating_debuginfo = true;
                        args_add(stripped_args, argv[i]);
index 3d2f2adc1ce41b83988a063f8a041311eae875b9..00a2b693cf41fd51ab6cd7d110e8bd824a2335c5 100644 (file)
@@ -78,7 +78,7 @@ EOF
     backdate "$BASEDIR3/header.h" "$BASEDIR3/test.c"
     backdate "$BASEDIR4/header.h" "$BASEDIR4/test.c" "$BASEDIR4/header2.h"
 
-    DEPFLAGS="-MD -MF test.d"
+    DEPFLAGS="-g1 -g0 -MD -MF test.d"
 }
 
 generate_reference_compiler_output() {