Subject: Re: toolchain/34258 (Cross building NetBSD 3.x with GCC 4.x fails)
To: None <skrll@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: Matthias Scheler <tron@zhadum.org.uk>
List: netbsd-bugs
Date: 09/16/2006 09:05:03
The following reply was made to PR toolchain/34258; it has been noted by GNATS.
From: Matthias Scheler <tron@zhadum.org.uk>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: toolchain/34258 (Cross building NetBSD 3.x with GCC 4.x fails)
Date: Sat, 16 Sep 2006 11:31:23 +0100
On Sat, Sep 16, 2006 at 05:38:21AM +0000, Nick Hudson wrote:
> Synopsis: Cross building NetBSD 3.x with GCC 4.x fails
>
> Responsible-Changed-From-To: toolchain-manager->skrll
> Responsible-Changed-By: skrll@netbsd.org
> Responsible-Changed-When: Sat, 16 Sep 2006 05:38:20 +0000
> Responsible-Changed-Why:
> I'll work on this
The following patch fixes the build of the old "binutils" with GCC 4.x.:
Index: gnu/dist/binutils/gas/as.h
===================================================================
RCS file: /cvsroot/src/gnu/dist/binutils/gas/as.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 as.h
--- gnu/dist/binutils/gas/as.h 8 Dec 2004 09:17:16 -0000 1.1.1.2
+++ gnu/dist/binutils/gas/as.h 16 Sep 2006 10:29:39 -0000
@@ -394,6 +394,22 @@
widened for argument passing. */
typedef unsigned int relax_substateT;
+struct relax_type
+{
+ /* Forward reach. Signed number. > 0. */
+ long rlx_forward;
+ /* Backward reach. Signed number. < 0. */
+ long rlx_backward;
+
+ /* Bytes length of this address. */
+ unsigned char rlx_length;
+
+ /* Next longer relax-state. 0 means there is no 'next' relax-state. */
+ relax_substateT rlx_more;
+};
+
+typedef struct relax_type relax_typeS;
+
/* Enough bits for address, but still an integer type.
Could be a problem, cross-assembling for 64-bit machines. */
typedef addressT relax_addressT;
Index: gnu/dist/binutils/gas/tc.h
===================================================================
RCS file: /cvsroot/src/gnu/dist/binutils/gas/tc.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tc.h
--- gnu/dist/binutils/gas/tc.h 8 Dec 2004 09:19:24 -0000 1.1.1.2
+++ gnu/dist/binutils/gas/tc.h 16 Sep 2006 10:29:39 -0000
@@ -22,26 +22,9 @@
/* In theory (mine, at least!) the machine dependent part of the assembler
should only have to include one file. This one. -- JF */
-extern const pseudo_typeS md_pseudo_table[];
-
-/* JF moved this here from as.h under the theory that nobody except MACHINE.c
- and write.c care about it anyway. */
+#include "as.h"
-struct relax_type
-{
- /* Forward reach. Signed number. > 0. */
- long rlx_forward;
- /* Backward reach. Signed number. < 0. */
- long rlx_backward;
-
- /* Bytes length of this address. */
- unsigned char rlx_length;
-
- /* Next longer relax-state. 0 means there is no 'next' relax-state. */
- relax_substateT rlx_more;
-};
-
-typedef struct relax_type relax_typeS;
+extern const pseudo_typeS md_pseudo_table[];
extern const int md_reloc_size; /* Size of a relocation record */
Kind regards
--
Matthias Scheler http://zhadum.org.uk/