From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 7871BE0084F; Thu, 6 Nov 2014 09:31:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's * domain * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from ecbiz156.inmotionhosting.com (ecbiz156.inmotionhosting.com [23.235.201.8]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 154A1E0084A for ; Thu, 6 Nov 2014 09:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=brioconcept.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=fvMT4C2wiZQ0cZnQIirtCPx/8DuwxPYZBMoL8dwujs8=; b=X4Vs8G+ANuvZsezWao80pEAmdxYFss3+nc2O6kKoeMn03v7lqDYYVcynJ9u7Qwa/kasYHKvDH/OavhmFO9fFV2Ik4fl0UVR9CvopfYJ2lG2KZMywn5wdy3PbeDbdaxKWxRI+M5HTl26W9RQ0Vb3NN9pYaKfTZlZm6okJHF3PBUM=; Received: from modemcable124.64-80-70.mc.videotron.ca ([70.80.64.124]:51137 helo=BRIOGFOURNIER) by ecbiz156.inmotionhosting.com with esmtpsa (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XmQuC-0008zw-Ch for meta-freescale@yoctoproject.org; Thu, 06 Nov 2014 12:31:39 -0500 From: "Guillaume Fournier" To: Date: Thu, 6 Nov 2014 12:31:35 -0500 Message-ID: <007801cff9e7$83fa3c10$8beeb430$@brioconcept.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac/52L3Fy3rRmQ5ZTHSLq3uHTPyvvQ== X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ecbiz156.inmotionhosting.com X-AntiAbuse: Original Domain - yoctoproject.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - brioconcept.com X-Get-Message-Sender-Via: ecbiz156.inmotionhosting.com: authenticated_id: gfournier@brioconcept.com Subject: Re: Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:31:49 -0000 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: en-ca 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.