[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Newest Native Binutils release....
NB: I send this reply to the list because it can be interesting.
Keith Scroggins wrote:
This is the problem I had with Binutils (latest patch)
make[4]: Entering directory `/d/usr/local/src/binutils-2.18-build/ld'
/bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Werror -g -O2 -o ld-new ldgram.o ldlex.o
lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o
ldver.o ldmisc.o ldfile.o ldcref.o sha1.o em68kmint.o ../bfd/libbfd.la
../libiberty/libiberty.a
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-Werror -g
-O2 -o ld-new ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o
ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o sha1.o
em68kmint.o ../bfd/.libs/libbfd.a ../libiberty/libiberty.a
ldemul.o:/usr/local/src/binutils-2.18-build/ld/../../binutils-2.18/ld/ldemul.c:(.data+0x0):
undefined reference to `_ld_m68kmint_emulation'
collect2: ld returned 1 exit status
make[4]: *** [ld-new] Error 1
I'll see if I can dig up some time to look further into why that
happened. Since my Falcon is actively building, it is kind of slow at
the moment.
If it matters, my current config (which may still cause me problems)
Sparemint released GCC 2.95.3
Sparemint released MiNTLib (I'll rebuild immediately after GCC works or
fails with CVS + patches)
Your Binutils 2.18 from December
Now I have a working EasyMiNT configuration on ARAnyM. So I have made
some investigation. The problem looked strange, because I have
cross-compiled the native binutils without any problem.
And finally, the culprit is... bash !!
The problem is in ld/genscripts.sh.
That script is used to generate the file em68kmint.c and the linker
scripts. At the top, we can find the usual #!/bin/sh
At the bottom, it uses ${BASH_LINENO[0]}, but only if the shell is
actually bash.
There is a different behavior on the different bash versions when it is
invoked as sh. With a recent bash (like the one I use in Cygwin), that
BASH_LINENO works as expected. But with the old one provided with
EasyMiNT, BASH_LINENO fails, then the file em68kmint.c is generated but
empty. And of course, there is a link error.
I have attached a quick fix for that problem.
And after that... you have a native build of binutils 2.18 !
Some other advices:
1) The makeinfo package from Sparemint has to be installed in order to
make the build success
3) Before running make install, be sure to do:
stack /usr/bin/install -S 256K
I will include that additional patch in my next release.
By the way, the BASH_LINENO problem has already been here for binutils
2.18. I can't understand why you didn't have the problem with the
previous version of the patch...
Enjoy !
--
Vincent Rivière
diff -aurN binutils-2.18-mint-20080113/include/getopt.h binutils-2.18-mint-20080113.ok/include/getopt.h
--- binutils-2.18-mint-20080113/include/getopt.h 2005-05-10 12:21:08.000000000 +0200
+++ binutils-2.18-mint-20080113.ok/include/getopt.h 2008-01-15 21:41:03.968750000 +0100
@@ -105,6 +105,7 @@
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
+#define HAVE_DECL_GETOPT 1
#if !HAVE_DECL_GETOPT
#if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT)
/* Many other libraries have conflicting prototypes for getopt, with
diff -aurN binutils-2.18-mint-20080113/ld/genscripts.sh binutils-2.18-mint-20080113.ok/ld/genscripts.sh
--- binutils-2.18-mint-20080113/ld/genscripts.sh 2007-08-12 21:00:07.000000000 +0200
+++ binutils-2.18-mint-20080113.ok/ld/genscripts.sh 2008-01-15 23:45:36.843750000 +0100
@@ -390,7 +390,7 @@
*" ${EMULATION_NAME} "*) COMPILE_IN=true;;
esac
-if test -n "${BASH+set}"; then
+if [ "x${BASH##/*/}" = "xbash" ]; then
source_em()
{
local current_script="$em_script"
diff -aurN binutils-2.18-mint-20080113/libiberty/hex.c binutils-2.18-mint-20080113.ok/libiberty/hex.c
--- binutils-2.18-mint-20080113/libiberty/hex.c 2007-01-31 21:25:23.000000000 +0100
+++ binutils-2.18-mint-20080113.ok/libiberty/hex.c 2008-01-15 20:58:36.156250000 +0100
@@ -24,7 +24,7 @@
#include "libiberty.h"
#include "safe-ctype.h" /* for HOST_CHARSET_ASCII */
-#if EOF != -1
+#if !(EOF == -1) /* gcc 2.95.3 has bug in '!=' operator for negative constants */
#error "hex.c requires EOF == -1"
#endif
diff -aurN binutils-2.18-mint-20080113/libiberty/safe-ctype.c binutils-2.18-mint-20080113.ok/libiberty/safe-ctype.c
--- binutils-2.18-mint-20080113/libiberty/safe-ctype.c 2005-05-10 17:33:33.000000000 +0200
+++ binutils-2.18-mint-20080113.ok/libiberty/safe-ctype.c 2008-01-15 20:58:13.093750000 +0100
@@ -119,7 +119,7 @@
#include <safe-ctype.h>
#include <stdio.h> /* for EOF */
-#if EOF != -1
+#if !(EOF == -1) /* gcc 2.95.3 has bug in '!=' operator for negative constants */
#error "<safe-ctype.h> requires EOF == -1"
#endif