https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77985

            Bug ID: 77985
           Summary: DW_AT_comp_dir is omitted when filename is absolute
                    and the file does not contain a specific typedef
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: infinity0 at pwned dot gg
  Target Milestone: ---

Hi, GCC 7.0.0 (latest snapshot) and GCC 6.1.1 both exhibit the following
behaviour:

+ gcc-build/destdir/usr/local/bin/gcc --version
gcc (GCC) 7.0.0 20161009 (experimental)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ cat test0.c
typedef __builtin_va_list __gnuc_va_list;
void func (void) {}
+ cat test1.c
void func (void) {}
+ gcc-build/destdir/usr/local/bin/gcc test0.c -g -dA -S -o- | grep comp_dir
        .long   .LASF4  # DW_AT_comp_dir:
"/home/infinity0/var/lib/reproducible"
        .uleb128 0x1b   # (DW_AT_comp_dir)
+ gcc-build/destdir/usr/local/bin/gcc test1.c -g -dA -S -o- | grep comp_dir
        .long   .LASF2  # DW_AT_comp_dir:
"/home/infinity0/var/lib/reproducible"
        .uleb128 0x1b   # (DW_AT_comp_dir)
+ gcc-build/destdir/usr/local/bin/gcc
/home/infinity0/var/lib/reproducible/test0.c -g -dA -S -o- | grep comp_dir
        .long   .LASF4  # DW_AT_comp_dir:
"/home/infinity0/var/lib/reproducible"
        .uleb128 0x1b   # (DW_AT_comp_dir)
+ gcc-build/destdir/usr/local/bin/gcc
/home/infinity0/var/lib/reproducible/test1.c -g -dA -S -o- | grep comp_dir
# exit code 1

See the attached file for a shell script where you can reproduce this yourself.

Reply via email to