Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2014 07:07:31 -0400
From:      George Mitchell <george+freebsd@m5p.com>
To:        freebsd-arm@freebsd.org
Subject:   Re: binutils on arm
Message-ID:  <53BFC573.9030606@m5p.com>
In-Reply-To: <201407110915.s6B9FQnW088625@mech-cluster241.men.bris.ac.uk>
References:  <201407110915.s6B9FQnW088625@mech-cluster241.men.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050905030606090909080408
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 07/11/14 05:15, Anton Shterenlikht wrote:
> binutils is clearly a show stopper on arm.
> Is anybody working on it?
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175605
> hasn't been touched for 5 months.
> Anybody knows if it builds on linux/armv6?
> Worth asking for help in https://sourceware.org/bugzilla/?
>
> Anton
> [...]

I followed up on a hint in this email from the ports mailing list from
the 12th of May:


 > Geoff Speicher geoff at sea-incorporated.com
 > Mon May 12 00:04:46 UTC 2014
 > Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
 > On Sun, May 11, 2014 at 5:41 PM, Geoff Speicher
 > <geoff at sea-incorporated.com>wrote:
 >
 > > Actually, I have a question about ports/184327. This bug report asserts
 > > that ansidecl.h is an internal file necessary only to build the GNU
 > > toolchain and should not be installed by devel/binutils. However, 
binutils
 > > also installs bfd.h which happens to include ansidecl.h (at least, 
it does
 > > in v2.24). Therefore, the installed bfd.h is broken. This fact either
 > > contradicts the original assertion that ansidecl.h should not be 
installed,
 > > or else it implies that bfd.h should not be installed either.
 > >
 >
 > There was a third possibility that I had overlooked, and appears to be a
 > decent compromise: bfd.h doesn't actually need to directly include
 > ansidecl.h for anything that I can see, so if we patch the port to remove
 > the include directive then bfd.h is no longer broken and ports/184327 is
 > also satisfied. Any objections to this?

and came up with the attached patches.  I can compile and use binutils
on the arm with these patches, although it is claimed that they result
in a non-functioning "ld".  I don't know.                    -- George

--------------050905030606090909080408
Content-Type: text/x-patch;
 name="binutils.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="binutils.patch"

Index: Makefile
===================================================================
--- Makefile	(revision 357979)
+++ Makefile	(working copy)
@@ -3,6 +3,7 @@
 
 PORTNAME=	binutils
 PORTVERSION=	2.24
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_SOURCEWARE}
 MASTER_SITE_SUBDIR=	binutils/releases
@@ -75,5 +76,6 @@
 	@${FIND} -ds ${STAGEDIR}${PREFIX}/${CONFIGURE_TARGET} -type d | \
 		${SED} -e 's,^${STAGEDIR}${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
 	${RM} ${STAGEDIR}${PREFIX}/include/ansidecl.h
+	${REINPLACE_CMD} '/#include "ansidecl.h"/d' ${STAGEDIR}${PREFIX}/include/bfd.h
 
 .include <bsd.port.mk>

--------------050905030606090909080408
Content-Type: text/x-patch;
 name="gnulibiberty.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="gnulibiberty.patch"

Index: Makefile
===================================================================
--- Makefile	(revision 357979)
+++ Makefile	(working copy)
@@ -2,8 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	gnulibiberty
-PORTVERSION=	2.19.1
-PORTREVISION=	2
+PORTVERSION=	2.24
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_SOURCEWARE}
 MASTER_SITE_SUBDIR=	binutils/releases
@@ -17,7 +16,7 @@
 USES=		gmake
 
 USE_BZIP2=	yes
-CONFIGURE_ARGS=	--enable-install-libiberty
+CONFIGURE_ARGS=	--enable-install-libiberty=${PREFIX}/include
 GNU_CONFIGURE=	yes
 
 CONFLICTS=	freelibiberty-[0-9]*
Index: distinfo
===================================================================
--- distinfo	(revision 357979)
+++ distinfo	(working copy)
@@ -1,2 +1,2 @@
-SHA256 (binutils-2.19.1.tar.bz2) = 3e8225b4d7ace0a2039de752e11fd6922d3b89a7259a292c347391c4788739f6
-SIZE (binutils-2.19.1.tar.bz2) = 16245771
+SHA256 (binutils-2.24.tar.bz2) = e5e8c5be9664e7f7f96e0d09919110ab5ad597794f5b1809871177a0f0f14137
+SIZE (binutils-2.24.tar.bz2) = 22716802
Index: files/patch-Makefile.in
===================================================================
--- files/patch-Makefile.in	(revision 357979)
+++ files/patch-Makefile.in	(working copy)
@@ -1,19 +1,28 @@
---- Makefile.in.orig	Thu Jul 24 15:51:49 2008
-+++ Makefile.in	Mon Apr  6 09:05:19 2009
-@@ -348,11 +348,15 @@
- INSTALL_DEST = @INSTALL_DEST@
- install: install_to_$(INSTALL_DEST) install-subdir
+--- Makefile.in.orig	2013-11-04 10:33:40.000000000 -0500
++++ Makefile.in	2014-06-24 10:22:37.000000000 -0400
+@@ -349,11 +349,15 @@
  
+ .PHONY: install install-strip
+ 
 +## FreeBSD port removed this: otherwise, FreeBSD 6.x would end up installing
 +## in ${prefix}/lib/elf rather than ${prefix}/lib
 +##
  # This is tricky.  Even though CC in the Makefile contains
  # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
- # default multilib, so we have to take LIBCFLAGS into account as well,
+ # default multilib, so we have to take CFLAGS into account as well,
  # since it will be passed the multilib flags.
--MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory`
-+##MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory`
+-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++##MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
 +MULTIOSDIR = .
  install_to_libdir: all
- 	${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
- 	$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
+ 	if test -n "${target_header_dir}"; then \
+ 		${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+@@ -361,7 +365,7 @@
+ 		( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \
+ 		mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \
+ 		case "${target_header_dir}" in \
+-		  /*)    thd=${target_header_dir};; \
++		  /*)    thd=${target_header_dir}/libiberty;; \
+ 		  *)     thd=${includedir}/${target_header_dir};; \
+ 		esac; \
+ 		${mkinstalldirs} $(DESTDIR)$${thd}; \
Index: files/patch-configure
===================================================================
--- files/patch-configure	(revision 357979)
+++ files/patch-configure	(working copy)
@@ -1,31 +1,11 @@
---- configure.orig	Fri Apr  7 02:01:25 2006
-+++ configure	Tue Oct 10 13:00:57 2006
-@@ -5679,6 +5679,14 @@
+--- configure.orig	2013-11-08 05:13:49.000000000 -0500
++++ configure	2014-06-24 10:08:53.000000000 -0400
+@@ -5507,7 +5507,7 @@
  
-   fi
+ setobjs=
+ CHECK=
+-target_header_dir=
++# target_header_dir=
+ if test -n "${with_target_subdir}"; then
  
-+
-+else
-+
-+   # Not a target library, so we set things up to run the test suite.
-+   CHECK=really-check
-+
-+fi
-+
-   # We may wish to install the target headers somewhere.
-   # Check whether --enable-install-libiberty or --disable-install-libiberty was given.
- if test "${enable_install_libiberty+set}" = set; then
-@@ -5701,13 +5709,6 @@
-       ;;
-   esac
- 
--
--else
--
--   # Not a target library, so we set things up to run the test suite.
--   CHECK=really-check
--
--fi
- 
- 
- 
+   # We are being configured as a target library.  AC_REPLACE_FUNCS

--------------050905030606090909080408--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53BFC573.9030606>