[OpenWrt-Devel] kirkwood gcc/binutils woe?

Harald Geyer harald at ccbib.org
Sun Dec 14 06:02:49 EST 2014


nwf writes:
> $ 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 )

Actually citing libgcc_s.so in full makes things a bit clearer:
$ cat libgcc_s.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library.  */
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?

Seems reasonable. Since gcc seems to work for Christian as is, this
might be architecture dependent. Christian, any insight on this?

As far as binutils is concerned the patch below seems to work as expected,
so I can now add my
Signed-off-by: Harald Geyer <harald at ccbib.org>

Felix, can you take this as is or should I resend the patch?

Thanks,
Harald

>> 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
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list