Bug 488863 - commandline macros (-D) have non-zero lineno
commandline macros (-D) have non-zero lineno
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: ccache (Show other bugs)
rawhide
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-05 19:22 EST by Jan Kratochvil
Modified: 2010-03-01 18:23 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-01 17:56:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2009-03-05 19:22:57 EST
Description of problem:
http://dwarf.freestandards.org/Dwarf3.pdf section 6.3.3 says the command-line macros should have line number of their definition zero.
This is true for /usr/bin/gcc but in some cases `cache gcc' sets them non-zero.

Version-Release number of selected component (if applicable):
ccache-2.4-13.fc9.x86_64
gcc-4.3.2-7.x86_64

How reproducible:
Always.

CORRECT:
$ : >empty.c; ccache gcc -c -o empty.o empty.c -g3; readelf -wm empty.o \
  | grep __GNUC__
 DW_MACINFO_define - lineno : 3 macro : __GNUC__ 4

INCORRECT:
$ : >empty.c; /usr/bin/gcc -c -o empty.o empty.c -g3; readelf -wm empty.o \
  | grep __GNUC__
 DW_MACINFO_define - lineno : 0 macro : __GNUC__ 4

$ cat somefile.c
int
main (void)
{
  return 0;
}

CORRECT:
$ /usr/bin/gcc -c -o somefile.o somefile.c -Wall -g3;
$ /usr/bin/gcc -o somefile somefile.o -Wall
$ ~jkratoch/redhat/gdb-cvs-clean/gdb/gdb -q ./somefile
(gdb) start
Temporary breakpoint 1 at 0x400480: file somefile.c, line 4.
Starting program: /tmp/somefile 

Temporary breakpoint 1, main () at somefile.c:4
4         return 0;
(gdb) info macro __GNUC__
Defined at /tmp/somefile.c:0
#define __GNUC__ 4

INCORRECT:
$ ccache gcc -c -o somefile.o somefile.c -Wall -g3
$ gcc -o somefile somefile.o -Wall
$ ~jkratoch/redhat/gdb-cvs-clean/gdb/gdb -q ./somefile
(gdb) start
Temporary breakpoint 1 at 0x400480: file somefile.c, line 4.
Starting program: /tmp/somefile 

Temporary breakpoint 1, main () at somefile.c:4
4         return 0;
(gdb) info macro __GNUC__
Defined at /tmp/somefile.c:3
#define __GNUC__ 4
(gdb) l
1       int
2       main (void)
3       {
4         return 0;
5       }

Single-step compilation (without the `somefile.o' intermediate) does not reproduce the problem.
Comment 1 Bug Zapper 2009-11-18 07:47:19 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 2 Ville Skyttä 2010-03-01 17:56:49 EST
ccache has a new active upstream, bug report forwarded, so closing as UPSTREAM here: https://bugzilla.samba.org/show_bug.cgi?id=7190

Do I read correctly that in your first (empty.c) example the CORRECT and INCORRECT are swapped, i.e. the first one is actually incorrect, and the latter correct?
Comment 3 Jan Kratochvil 2010-03-01 18:23:03 EST
(In reply to comment #2)
> Do I read correctly that in your first (empty.c) example the CORRECT and
> INCORRECT are swapped, i.e. the first one is actually incorrect, and the latter
> correct?    

you are right, it is swapped, sorry.

Note You need to log in before you can comment on or make changes to this bug.