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

            Bug ID: 86606
           Summary: Concurrent source files do not work with --save-temps
                    option
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: amker at gcc dot gnu.org
  Target Milestone: ---

Following causes troubles with --save-temps:

$ cat a.c
int foo();

int main()
{
  return foo();
}

$ cat x/a.c
int foo()
{
  return 0;
}

$ gcc a.c x/a.c
(works fine)

but:

$ gcc a.c x/a.c --save-temps
a.o: In function `foo':
a.c:(.text+0x0): multiple definition of `foo'
a.o:a.c:(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../lib64/crt1.o: In function
`_start':
/home/abuild/rpmbuild/BUILD/glibc-2.27/csu/../sysdeps/x86_64/start.S:104:
undefined reference to `main'
collect2: error: ld returned 1 exit status

Reply via email to