From: "Guillaume Fournier" <gfournier@brioconcept.com>
To: <meta-freescale@yoctoproject.org>
Subject: Re: Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board
Date: Thu, 6 Nov 2014 12:31:35 -0500 [thread overview]
Message-ID: <007801cff9e7$83fa3c10$8beeb430$@brioconcept.com> (raw)
I was able to get the board to boot this morning.
The problem had to do with this error message I got when building u-boot
with my Yocto generated toolchain:
"arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc"
To solve this problem, I initially went looking on the web and found this:
https://lists.yoctoproject.org/pipermail/yocto/2013-October/016385.html
Basically u-boot top level Makefile contains:
PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc
The above call gets resolved to "-L ." Doing ${CC} -print-libgcc-file-name
shows the proper value. The reason for this is that U-Boot does not pickup
$CC from our environment (which is including the --sysroot option). Without
this option -print-libgcc-file-name resolve to a simple file name without a
path. And thus dirname resolve it further to "." So the fix suggested was
to do: make LDFLAGS="" CC="$CC" This passes the ${CC} environment variable
to the Makefile which in turns resolve the PLATFORM_LIBGCC correctly.
However, this had other implications. One of them changed -mfloat-abi=soft
to hard and, I believe, rendered the binary/imx file unusable on the target
(it might however be for another reason that it was not booting... keep on
reading).
A better solution is to add the following line in the
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi script:
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
This KCFLAGS gets appended to the CFLAGS in the top level Makefile of
u-boot. PLATFORM_LIBGCC now returns a valid lgcc path and no other flags
are modified (-mfloat-abi remains soft).
So, here is a build command before any modifications:
arm-poky-linux-gnueabi-gcc -Wp,-MD,fs/fat/.fat.o.d -nostdinc -isystem
/media/sdb/gfournier/axiondev/toolchain/sysroots/x86_64-pokysdk-linux/usr/bi
n/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux
-gnueabi/4.9.1/include -Iinclude
-I/media/sdb/gfournier/axiondev/u-boot-fslc/arch/arm/include -include
/media/sdb/gfournier/axiondev/u-boot-fslc/include/linux/kconfig.h
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SYS_TEXT_BASE=0x17800000 -Wall
-Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os
-fno-stack-protector -g -fstack-usage -Wno-format-nonliteral
-Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux
-mword-relocations -march=armv7-a -mno-unaligned-access -ffunction-sections
-fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(fat)"
-D"KBUILD_MODNAME=KBUILD_STR(fat)" -c -o fs/fat/fat.o fs/fat/fat.c
The previous build without any modifications was not finding lgcc (it's
missing the --sysroot argument).
Here is a build command after the KCFLAGS modification in
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi. Not the added
--sysroot:
arm-poky-linux-gnueabi-gcc -Wp,-MD,net/.arp.o.d -nostdinc -isystem
/media/sdb/gfournier/axiondev/toolchain/sysroots/x86_64-pokysdk-linux/usr/bi
n/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux
-gnueabi/4.9.1/include -Iinclude
-I/media/sdb/gfournier/axiondev/u-boot-fslc/arch/arm/include -include
/media/sdb/gfournier/axiondev/u-boot-fslc/include/linux/kconfig.h
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SYS_TEXT_BASE=0x17800000 -Wall
-Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os
-fno-stack-protector -g -fstack-usage -Wno-format-nonliteral
-Werror=date-time
--sysroot=/media/sdb/gfournier/axiondev/toolchain/sysroots/cortexa9hf-vfp-ne
on-poky-linux-gnueabi -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux
-mword-relocations -march=armv7-a -mno-unaligned-access -ffunction-sections
-fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(arp)"
-D"KBUILD_MODNAME=KBUILD_STR(arp)" -c -o net/arp.o net/arp.c
The previous build with the KCFLAGS modification is performing as expected
and binary is usable and boots fine.
Here is a build command when calling make LDFLAGS="" CC="$CC" without the
KCFLAGS modification:
arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork
-mfloat-abi=hard -mfpu=neon -mtune=cortex-a9
--sysroot=/media/sdb/gfournier/axiondev/toolchain/sysroots/cortexa9hf-vfp-ne
on-poky-linux-gnueabi -Wp,-MD,net/.bootp.o.d -nostdinc -isystem
/media/sdb/gfournier/axiondev/toolchain/sysroots/x86_64-pokysdk-linux/usr/bi
n/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux
-gnueabi/4.9.1/include -Iinclude
-I/media/sdb/gfournier/axiondev/u-boot-fslc/arch/arm/include -include
/media/sdb/gfournier/axiondev/u-boot-fslc/include/linux/kconfig.h
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SYS_TEXT_BASE=0x17800000 -Wall
-Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os
-fno-stack-protector -g -fstack-usage -Wno-format-nonliteral
-Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux
-mword-relocations -march=armv7-a -mno-unaligned-access -ffunction-sections
-fdata-sections -fno-common -ffixed-r9 -pipe -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(bootp)" -D"KBUILD_MODNAME=KBUILD_STR(bootp)"
-c -o net/bootp.o net/bootp.c
Note the huge difference in the build line (and hard vs soft).
The previous build with the make LDFLAGS="" CC="$CC" command line was
creating an unusable binary although it did compile fine.
Long story short, to solve my problem:
Add the following line in the
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi script:
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
May I suggest future releases include this modification in the script ?
Thanks guys for all the support!
Guillaume Fournier, eng.
Hardware Designer
Brioconcept Consulting Inc.
next reply other threads:[~2014-11-06 17:31 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 17:31 Guillaume Fournier [this message]
2014-11-06 17:47 ` Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board Otavio Salvador
2014-11-06 17:53 ` Gary Thomas
2014-11-06 17:56 ` Otavio Salvador
-- strict thread matches above, loose matches on Subject: below --
2014-11-05 20:43 Guillaume Fournier
2014-11-05 21:04 ` Otavio Salvador
2014-11-05 21:50 ` Guillaume Fournier
2014-11-04 22:44 Guillaume Fournier
2014-11-05 0:03 ` Fabio Estevam
2014-11-05 14:38 ` Guillaume Fournier
2014-11-05 14:52 ` Wally Yeh
2014-11-05 15:24 ` Guillaume Fournier
2014-11-05 14:56 ` Daiane Angolini
2014-11-05 15:37 ` Guillaume Fournier
2014-11-05 15:45 ` Otavio Salvador
2014-11-05 16:05 ` Guillaume Fournier
2014-11-05 15:42 ` Otavio Salvador
2014-11-05 15:50 ` Guillaume Fournier
2014-11-05 15:54 ` Otavio Salvador
2014-11-05 15:59 ` Wally Yeh
2014-11-05 16:15 ` Guillaume Fournier
2014-11-05 16:21 ` Gary Thomas
2014-11-05 16:40 ` Otavio Salvador
2014-11-05 16:41 ` Guillaume Fournier
2014-11-05 0:23 ` Eric Bénard
2014-11-05 14:51 ` Guillaume Fournier
2014-11-05 17:25 ` Eric Bénard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='007801cff9e7$83fa3c10$8beeb430$@brioconcept.com' \
--to=gfournier@brioconcept.com \
--cc=meta-freescale@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.