[PATCH] PR 25611, PR 25614: GAS: Remove a double inclusion of "bignum.h"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] PR 25611, PR 25614: GAS: Remove a double inclusion of "bignum.h"

Maciej W. Rozycki
Correct an issue with commit 5496f3c635dc ("Add support for generating
DWARF-5 format directory and file name tables from the assembler.") and
remove a duplicate direct inclusion of "bignum.h" from dwarf2dbg.c that
causes a GAS compilation error:

In file included from .../gas/dwarf2dbg.c:33:
.../gas/bignum.h:42: error: redefinition of typedef 'LITTLENUM_TYPE'
.../gas/bignum.h:42: error: previous declaration of 'LITTLENUM_TYPE' was here
make[4]: *** [dwarf2dbg.o] Error 1

with some GCC versions, as this header has been already included via
"as.h" and then "flonum.h".

        gas/
        PR 25611
        PR 25614
        * dwarf2dbg.c: Do not include "bignum.h".
---
On Wed, 11 Mar 2020, Nick Clifton via Binutils wrote:

>   I am applying the attached patch to add support for DWARF-5
>   .debug_line sections.  DWARF v5 changes the format of the
>   section's header so that the layout of the directory table and the
>   file table are explicitly specified.  This allow for extra fields
>   and also the possibility of reducing the size of the tables by not
>   storing unneeded fields.

 This change broke GAS compilation across all targets in my configuration,
due to this error:

In file included from .../gas/dwarf2dbg.c:33:
.../gas/bignum.h:42: error: redefinition of typedef 'LITTLENUM_TYPE'
.../gas/bignum.h:42: error: previous declaration of 'LITTLENUM_TYPE' was here
make[4]: *** [dwarf2dbg.o] Error 1

This is due to a double inclusion of "bignum.h", which is not prepared for
such use, once via "as.h" and then "flonum.h", and again directly.

 OK to apply this hopefully obvious fix?

  Maciej
---
 gas/dwarf2dbg.c |    1 -
 1 file changed, 1 deletion(-)

binutils-gas-dwarf2dbg-bignum.diff
Index: binutils/gas/dwarf2dbg.c
===================================================================
--- binutils.orig/gas/dwarf2dbg.c
+++ binutils/gas/dwarf2dbg.c
@@ -30,7 +30,6 @@
 
 #include "as.h"
 #include "safe-ctype.h"
-#include "bignum.h"
 
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] PR 25611, PR 25614: GAS: Remove a double inclusion of "bignum.h"

Sourceware - binutils list mailing list
On Tue, Mar 31, 2020 at 04:17:37PM +0100, Maciej W. Rozycki wrote:
> This is due to a double inclusion of "bignum.h", which is not prepared for
> such use, once via "as.h" and then "flonum.h", and again directly.
>
>  OK to apply this hopefully obvious fix?

Yes, of course.

--
Alan Modra
Australia Development Lab, IBM
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] PR 25611, PR 25614: GAS: Remove a double inclusion of "bignum.h"

Maciej W. Rozycki
On Wed, 1 Apr 2020, Alan Modra wrote:

> > This is due to a double inclusion of "bignum.h", which is not prepared for
> > such use, once via "as.h" and then "flonum.h", and again directly.
> >
> >  OK to apply this hopefully obvious fix?
>
> Yes, of course.

 Committed then, thanks for your review.

  Maciej