[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] patch to MiNTlib [was Re: Some comments on gcc 4.3.2]



On Sat, 2008-10-04 at 20:38 +0200, Miro Kropacek wrote:
> - for some strange reason I had to #define HAVE_GNU_LD to 0 in files
> gcc/gcc.c and gcc/collect2.c. When I compiled cross compiler, it was
> OK, it only appears when I compile native gcc using that cross
> compiler... When I used #ifdef HAVE_GNU_LD if it exists, it does!

This turns out to be a clash with MiNTlib.

Attached is a patch to mintlib to fix it.

Alan.
diff --git a/include/linker.h.in b/include/linker.h.in
index 75c3b68..33170e3 100644
--- a/include/linker.h.in
+++ b/include/linker.h.in
@@ -16,10 +16,10 @@
 #define __LINKER_TYPE __@LINKER_TYPE@
 
 #if __LINKER_TYPE == __GNU
-# define HAVE_GNU_LD
+# define __HAVE_GNU_LD
 #else 
 # if __LINKER_TYPE == __OLD_GNU
-#  define HAVE_OLDGNU_LD  /* Currently not used.  */
+#  define __HAVE_OLDGNU_LD  /* Currently not used.  */
 # else
 #   error Unknown linker.
 # endif
diff --git a/mintlib/libc-symbols.h b/mintlib/libc-symbols.h
index 609c594..5034117 100644
--- a/mintlib/libc-symbols.h
+++ b/mintlib/libc-symbols.h
@@ -23,7 +23,7 @@
    are recent versions of GNU ld and older versions of GNU ld only
    when compiled with gcc (so that we have at least strong aliases).  */
    
-#ifdef HAVE_GNU_LD
+#ifdef __HAVE_GNU_LD
 # define HAVE_WEAK_SYMBOLS
 #endif
 
@@ -48,11 +48,11 @@
 
 /* When a reference to SYMBOL is encountered, the linker will emit a
    warning message MSG.  */
-# ifdef HAVE_GNU_LD
+# ifdef __HAVE_GNU_LD
 #  define link_warning(symbol, msg)   \
   asm(".stabs \"" msg "\",30,0,0,0\n"  \
       ".stabs \"" "_" #symbol  "\",1,0,0,0\n");
-# endif  /* HAVE_GNU_LD */
+# endif  /* __HAVE_GNU_LD */
 
 # endif  /* !__GNUC__ */
 
diff --git a/stdio/psignal.c b/stdio/psignal.c
index ebf041c..6e26e2c 100644
--- a/stdio/psignal.c
+++ b/stdio/psignal.c
@@ -22,7 +22,7 @@
 #include <signal.h>
 
 
-#ifndef	HAVE_GNU_LD
+#ifndef	__HAVE_GNU_LD
 #define	_sys_siglist	sys_siglist
 #endif
 
diff --git a/string/strsignal.c b/string/strsignal.c
index f807311..73f4588 100644
--- a/string/strsignal.c
+++ b/string/strsignal.c
@@ -28,7 +28,7 @@
 # define _(String) (String)
 #endif
 
-#ifndef	HAVE_GNU_LD
+#ifndef	__HAVE_GNU_LD
 #define	_sys_siglist	sys_siglist
 #endif
 
diff --git a/string/test-common.c b/string/test-common.c
index d874fe3..5331a69 100644
--- a/string/test-common.c
+++ b/string/test-common.c
@@ -34,7 +34,7 @@
 #include <strings.h>
 #include <fcntl.h>
 
-#ifndef HAVE_GNU_LD
+#ifndef __HAVE_GNU_LD
 #define _sys_nerr	sys_nerr
 #define _sys_errlist	sys_errlist
 #endif