[patch] gcc/config/h8300/lib1funcs.asm

Kazu Hirata kazu@hxi.com
Fri Jun 9 09:35:00 GMT 2000


Hi,

Attached is a patch for gcc/config/h8300/lib1funcs.asm.

/* h8300-hms-gcc -mh -o h8bug.out h8bug.c */
int
main ()
{
  return 0;
}

If you try to compile the above file with the current gcc snapshot
from CVS, you get the following error.

/usr/local/lib/gcc-lib/h8300-hms/2.96/../../../../h8300-hms/bin/ld: skipping incompatible /usr/local/lib/gcc-lib/h8300-hms/2.96/h8300h/libgcc.a when searching for -lgcc
/usr/local/lib/gcc-lib/h8300-hms/2.96/../../../../h8300-hms/bin/ld: skipping incompatible /usr/local/lib/gcc-lib/h8300-hms/2.96/libgcc.a when searching for -lgcc
/usr/local/lib/gcc-lib/h8300-hms/2.96/../../../../h8300-hms/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status

The problem comes from the fact that _cmpsi2.o, which is the first
entry of h8300h/libgcc.a, has an architecture of h8300, not
h8300h. Thus, bfd thinks that h8300h/libgcc.a is for h8300, not
h8300h.

The patch tries to output an architecture directive (.h8300h or
.h8300s) no matter which function lib1funcs.asm gets compiled
for. This ensures that there is one and only one architecture within
one libgcc.a.

You should see the same problem with -ms in place of -mh.

Thanks,

Kazu Hirata

===File ~/h8300-hms/gcc/ChangeLog-h8-libgcc=================
2000-06-09  Kazu Hirata  <kazu@hxi.com>

	* config/h8300/lib1funcs.asm: Declare the machine architecture at
	the beginning of the file.

============================================================

===File ~/h8300-hms/gcc/h8-libgcc.patch=====================
Index: lib1funcs.asm
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/h8300/lib1funcs.asm,v
retrieving revision 1.3
diff -u -r1.3 lib1funcs.asm
--- lib1funcs.asm	2000/05/15 23:14:16	1.3
+++ lib1funcs.asm	2000/06/09 16:06:58
@@ -95,6 +95,14 @@
 #define A3E	e3
 #endif
 
+#ifdef __H8300H__
+	.h8300h
+#endif
+
+#ifdef __H8300S__
+	.h8300s
+#endif
+
 #ifdef L_cmpsi2
 #ifdef __H8300__
 	.section .text
@@ -304,14 +312,6 @@
 ;; We bunch all of this into one object file since there are several
 ;; "supporting routines".
 
-#ifdef __H8300H__
-	.h8300h
-#endif
-
-#ifdef __H8300S__
-	.h8300s
-#endif
-
 	.section .text
 	.align 2
 
@@ -735,14 +735,6 @@
 	rts
 
 #else /* __H8300H__ */
-
-#ifdef __H8300H__
-	.h8300h
-#endif
-
-#ifdef __H8300S__
-	.h8300s
-#endif
 
 	.global	___mulsi3
 ___mulsi3:
============================================================



More information about the Gcc-patches mailing list