You are not logged in.
RE my discussion with anatolik here
from gcc-arm-none-eabi (4.8_2014_q3_update-2)
$ stat usr/arm-none-eabi/lib/armv6-m/libc_s.a
File: ‘usr/arm-none-eabi/lib/armv6-m/libc_s.a’
Size: 778620 Blocks: 1528 IO Block: 4096 regular file
...
$ stat usr/arm-none-eabi/lib/armv6-m/libc.a
File: ‘usr/arm-none-eabi/lib/armv6-m/libc.a’
Size: 928780 Blocks: 1816 IO Block: 4096 regular file
...
from arm-none-eabi-gcc in [community-testing] (4.9.2-1)
$ stat /usr/arm-none-eabi/lib/armv6-m/libc_nano.a
File: ‘/usr/arm-none-eabi/lib/armv6-m/libc_nano.a’
Size: 4351570 Blocks: 8504 IO Block: 4096 regular file
...
$ stat /usr/arm-none-eabi/lib/armv6-m/libc.a
File: ‘/usr/arm-none-eabi/lib/armv6-m/libc.a’
Size: 4615784 Blocks: 9016 IO Block: 4096 regular file
...
Offline
@anatolik
I suspect maybe different compiler flags, I see you have
export CFLAGS_FOR_TARGET='-g -O2 -ffunction-sections -fdata-sections'
I suspect -Os may be better.
Offline
ARM binaries contain debug symbols. After stripping them the files become significantly smaller:
arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $LIBRARY
929916 Nov 5 14:41 libc.a
920810 Nov 5 14:42 libc_nano.a
Still larger than binaries from ARM. Will try to recompile package with Os.
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
extract from their newlib{,-nano} build which I suspect you looked at
echo Task [III-2] /$HOST_NATIVE/newlib/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
saveenvvar CFLAGS_FOR_TARGET '-g -O2 -ffunction-sections -fdata-sections'
rm -rf $BUILDDIR_NATIVE/newlib && mkdir -p $BUILDDIR_NATIVE/newlib
pushd $BUILDDIR_NATIVE/newlib
$SRCDIR/$NEWLIB/configure \
$NEWLIB_CONFIG_OPTS \
--target=$TARGET \
--prefix=$INSTALLDIR_NATIVE \
--infodir=$INSTALLDIR_NATIVE_DOC/info \
--mandir=$INSTALLDIR_NATIVE_DOC/man \
--htmldir=$INSTALLDIR_NATIVE_DOC/html \
--pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
--enable-newlib-io-long-long \
--enable-newlib-register-fini \
--disable-newlib-supplied-syscalls \
--disable-nls
make -j$JOBS
make install
if [ "x$skip_manual" != "xyes" ]; then
make pdf
mkdir -p $INSTALLDIR_NATIVE_DOC/pdf
cp $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libc/libc.pdf $INSTALLDIR_NATIVE_DOC/pdf/libc.pdf
cp $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libm/libm.pdf $INSTALLDIR_NATIVE_DOC/pdf/libm.pdf
make html
mkdir -p $INSTALLDIR_NATIVE_DOC/html
copy_dir $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libc/libc.html $INSTALLDIR_NATIVE_DOC/html/libc
copy_dir $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libm/libm.html $INSTALLDIR_NATIVE_DOC/html/libm
fi
popd
restoreenv
echo Task [III-3] /$HOST_NATIVE/newlib-nano/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
saveenvvar CFLAGS_FOR_TARGET '-g -Os -ffunction-sections -fdata-sections'
rm -rf $BUILDDIR_NATIVE/newlib-nano && mkdir -p $BUILDDIR_NATIVE/newlib-nano
pushd $BUILDDIR_NATIVE/newlib-nano
$SRCDIR/$NEWLIB_NANO/configure \
$NEWLIB_CONFIG_OPTS \
--target=$TARGET \
--prefix=$BUILDDIR_NATIVE/target-libs \
--disable-newlib-supplied-syscalls \
--enable-newlib-reent-small \
--disable-newlib-fvwrite-in-streamio \
--disable-newlib-fseek-optimization \
--disable-newlib-wide-orient \
--enable-newlib-nano-malloc \
--disable-newlib-unbuf-stream-opt \
--enable-lite-exit \
--enable-newlib-global-atexit \
--disable-nls
make -j$JOBS
make install
but you may have missed it is -O2 for newlib and -Os for newlib-nano
Last edited by parchedas (2014-11-06 00:15:14)
Offline
I just pushed new versions of newlib and gcc compiled with more aggressive options to [community-testing] repo. I also stripped the binaries and now their size is much smaller. Give it a try please.
Last edited by anatolik (2014-11-06 06:01:56)
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
I get this now
LD [fw|cc ] build/fw_coptercontrol/fw_coptercontrol.elf
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: skipping incompatible /usr/lib/gcc/arm-none-eabi/4.9.2/armv7-m/libgcc.a when searching for -lgcc
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: skipping incompatible /usr/lib/gcc/arm-none-eabi/4.9.2/libgcc.a when searching for -lgcc
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: cannot find -lgcc
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: skipping incompatible /usr/lib/gcc/arm-none-eabi/4.9.2/armv7-m/libgcc.a when searching for -lgcc
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: skipping incompatible /usr/lib/gcc/arm-none-eabi/4.9.2/libgcc.a when searching for -lgcc
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
/home/james/builds/openpilot-git/OpenPilot/make/common-defs.mk:224: recipe for target '/home/james/builds/openpilot-git/OpenPilot/build/fw_coptercontrol/fw_coptercontrol.elf' failed
make[1]: *** [/home/james/builds/openpilot-git/OpenPilot/build/fw_coptercontrol/fw_coptercontrol.elf] Error 1
Makefile:408: recipe for target 'fw_coptercontrol_opfw' failed
make: *** [fw_coptercontrol_opfw] Error 2
Offline
Thanks for testing it. I think this library was incorrectly stripped. Could you please try this package http://pkgbuild.com/~anatolik/arm-embedded/ ? (And do not forget to check the package signature when you install it).
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
That seems to have done the trick, thanks.
Last edited by parchedas (2014-11-06 20:34:06)
Offline
What is the firmware size difference between Arch and ARM versions of toolchain? Just curious.
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
elfs at most 1% bigger with Arch, bins exactly the same for most of them.
Offline
I just pushed this version to [community-testing]. I am going to release it to stable in a few days if there will be no problems.
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline