From patchwork Sat Dec 13 21:28:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: nwf <8S9K8UGO5JGPI3U067229BBACKMQIGVH@cmx.ietfng.org> X-Patchwork-Id: 420800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5EF5F1400EA for ; Sun, 14 Dec 2014 08:28:41 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 484B52890B1; Sat, 13 Dec 2014 22:26:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9C05E2805DB for ; Sat, 13 Dec 2014 22:26:33 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7.6 Received: from mail.oc.ietfng.org (a.rr.ietfng.org [67.62.51.95]) by arrakis.dune.hu (Postfix) with ESMTP for ; Sat, 13 Dec 2014 22:26:33 +0100 (CET) Received: from nwf.oc.ietfng.org (nwf.oc.ietfng.org [172.29.0.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.oc.ietfng.org (Postfix) with ESMTPS id 3A2485A1FB; Sat, 13 Dec 2014 21:28:18 +0000 (UTC) Received: (from nwf@localhost) by nwf.oc.ietfng.org (8.14.9/8.14.5/Submit) id sBDLSFkm080971; Sat, 13 Dec 2014 21:28:15 GMT (envelope-from 8S9K8UGO5JGPI3U067229BBACKMQIGVH@cmx.ietfng.org) X-Authentication-Warning: nwf.oc.ietfng.org: nwf set sender to 8S9K8UGO5JGPI3U067229BBACKMQIGVH@cmx.ietfng.org using -f Date: Sat, 13 Dec 2014 21:28:14 +0000 From: nwf <8S9K8UGO5JGPI3U067229BBACKMQIGVH@cmx.ietfng.org> To: Harald Geyer Message-ID: <20141213212814.GC43547@nwf.oc.ietfng.org> References: <20141206233353.GI34369@nwf.oc.ietfng.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: openwrt-devel@lists.openwrt.org, cb@shoutrlabs.com Subject: Re: [OpenWrt-Devel] kirkwood gcc/binutils woe? X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" On Wed, Dec 10, 2014 at 10:12:53PM +0100, Harald Geyer wrote: > Hi! > > I ran into the same issue just a few days ago on mxs. Probably most, > if not all arm targets are affected. Applying your patch does, indeed, get me a little closer to a working compiler. However, when I run $ gcc -v -o hello hello.c [...] /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/collect2 --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi -o hello /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crt1.o /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crti.o /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crtbegin.o -L/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3 -L/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/../../.. /tmp/ccjOqw9X.o -lgcc_s -lc -lgcc_s /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crtend.o /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crtn.o /usr/bin/ld: cannot find -lgcc collect2: error: ld returned 1 exit status Well, yes, that's true... $ find / -name \*libgcc\* /lib/libgcc_s.so.1 /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc_s.so.1 /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc_s.so /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc.map /usr/lib/opkg/info/libgcc.list /usr/lib/opkg/info/libgcc.control Grepping about at random I find that /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc_s.so contains the directive > GROUP ( libgcc_s.so.1 -lgcc ) So I think the desire to save space expressed in feeds/packages/devel/gcc/README is well-intentioned but possibly stale, so maybe the following, too? Maybe we should be removing libgcc_pic.a but not libgcc.a? Thanks for your help so far! --nwf; > nwf writes: > > > root@OpenWrt:/tmp# gcc -o hello hello.c > > > /usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi > > > Supported emulations: armelf_linux armelf armelfb armelfb_linux > > > collect2: error: ld returned 1 exit status > > > > And I'm really not sure what that means or what to do about it. > > Looks like binutils is built for OABI while gcc is built for EABI. > Since at least mxs is actually using EABI I think gcc is right and > binutils is wrong. > > Try if the following patch solves the problem. (Don't have my test > board around right now.) > > diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile > index ff968b9..4aefeca 100644 > --- a/package/devel/binutils/Makefile > +++ b/package/devel/binutils/Makefile > @@ -48,6 +48,8 @@ endef > TARGET_CFLAGS += $(FPIC) -Wno-unused-value > > CONFIGURE_ARGS += \ > + --host=$(REAL_GNU_TARGET_NAME) \ > + --target=$(REAL_GNU_TARGET_NAME) \ > --enable-shared \ > --enable-install-libiberty \ > --enable-install-libbfd > > HTH, > Harald Signed-off-by: Harald Geyer diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index c8d8733..8966955 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -106,7 +106,6 @@ define Package/gcc/install ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION) cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib - $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) diff --git a/devel/gcc/README b/devel/gcc/README index 6cbc80d..828bd28 100644 --- a/devel/gcc/README +++ b/devel/gcc/README @@ -1,8 +1,5 @@ Native GCC that runs on target. -To save disk space, this GCC only supports dynamic linking on the target box, -there are no static libraries shipped. - For now, this was only tested on a mips target. Others to be done... - Christian Beier \ No newline at end of file + Christian Beier