[yocto] any success with spartan6-lx9mb?

Elvis Dowson elvis.dowson at gmail.com
Thu Sep 6 20:21:57 PDT 2012


Hi,

On Sep 6, 2012, at 7:19 PM, Elvis Dowson wrote:

>> 
>> issues:
>> 
>> The first problem I encountered was trying to build gcc-cross-initial:
>>   This target does not support --with-float.
>> 
> 
> If you look at the tune file, it says TARGET_FPU = "soft", which means
> software floating point emulation.
> 
> However, the gcc toolchain recipes are trying to build with hardware floating
> point support, from the error message.

My bad, the error was because the --with-float option does not exist for the
microblaze processor

Looking at the gcc options for microblaze from 

http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

MicroBlaze Options

          -msoft-float -mhard-float -msmall-divides -mcpu=cpu 
          -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift 
          -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss 
          -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt 
          -mxl-mode-app-model

So, the next step is to try and modify the tune files, slightly. I recall someone from
windriver mentioned that TARGET_FPU is to be explicitly set specified only if a 
special hardware FPU was used. When it is blank, it means default, which is
hardware floating point. Software floating point gets set automatically from
other settings in the tune file.

So the first thing to try is to remove any entry for TARGET_FPU = "soft" from
any tune file that you are referencing. It will get set automatically at build time,
as far as I know from the other options in the tune file.



> opening microblaze-c.o: No such file or directory
> make[1]: *** [cc1-checksum.c] Error 1
> rm cpp.pod gcov.pod gfdl.pod gcc.pod fsf-funding.pod
> make[1]: Leaving directory
> `/home/trevor/devel/yocto/git-method/spartan6-lx9/tmp/work/microblazeel-poky-linux/gcc-cross-initial-4.7.1.0+git1+d07e24f4ab59f264d68d21838795349faab5dede-r11/gcc-4_7-branch/build.x86_64-linux.microblaze-poky-linux/gcc'
> make: *** [all-gcc] Error 2
> ERROR: oe_runmake failed
> ERROR: Function failed: do_compile

The second thing to look at is the above error that you got. 

Perhaps the reason why it couldn't find the microblaze-c.o output file was because in the gcc sources, there is no cpu=microblazeel, but only cpu=microblaze

http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/microblaze/microblaze-c.c;h=32c38da311b12b07cc1ed9fbf13f7946291f2857;hb=refs/heads/gcc-4_7-branch

void 
microblaze_cpp_define (cpp_reader *pfile)
{
  builtin_assert ("cpu=microblaze");
  builtin_assert ("machine=microblaze");
  builtin_define ("__MICROBLAZE__");
  if (!TARGET_SOFT_MUL) 
    {
      if (!flag_iso)
        builtin_define ("HAVE_HW_MUL");
      builtin_define ("__HAVE_HW_MUL__");
    }

So, we will need to examine the tune files that you are using for your particular machine configuration, and ensure that it is setting the correct cpu type

What you could start off, as a quick test would be to replace the selected tune file in spartan6-lx9mb.conf and change it to use tune-microblaze.inc instead of tune-microblazeel.inc, because the latter appears to incorrectly set the cpu to microblazeel, I think.

File: meta-xilinx/tree/conf/machine/spartan6-lx9mb.conf
# Copyright (C) 2011, SecretLab Technologies Ltd.
# Adrian Alonso <aalonso at secretlab.ca>
# Released under the MIT license (see packages/COPYING)
#@TYPE: Machine
#@Name: Xilinx generic microblaze target support
#@DESCRIPTION: Machine configuration for Xilinx Microblaze
# Supported target: spartan6-lx9mb
#
# Xilinx EDK override hardware  definitions for xilinx-bsp
# Include in your local.conf
# XILINX_BSP_PATH = "complete path for Xilinx XPS project"

TARGET_CPU = "microblaze"
# tune for the microblaze little endian cpu
-require conf/machine/include/tune-microblazeel.inc
+require conf/machine/include/tune-microblaze.inc

PREFERRED_PROVIDER_virtual/kernel = "linux-xilinx"
PREFERRED_VERSION_u-boot = "uboot-xilinx"
# Add uboot to rootfs
EXTRA_IMAGEDEPENDS += "u-boot-xilinx"
XILINX_BOARD = "microblaze-generic"

KERNEL_IMAGETYPE = "simpleImage.system"

MACHINE_FEATURES = "kernel26 apm ext2 vfat ethernet"
MACHINE_EXTRA_RECOMMENDS = "kernel-modules"

UBOOT_ENTRYPOINT ?= "0xBC000000"
UBOOT_LOADADDRESS ?= "0xBC000000"
UBOOT_MACHINE ?= "microblaze-generic_config"

# Don't use tty1
USE_VT = "0"
SERIAL_CONSOLE = "115200 ttyUL0"

# Device nodes add xsa for (system ace)
IMAGE_DEVICE_TABLES = "files/device_table-minimal.txt \
                       files/device_table_add-xsa.txt"

Perhaps if you could try the above two changes, i.e. remove the TARGET_FPU = "soft" from the tune file, and switch tune files so that the correct cpu type is set, and see if the gcc-initial compilation progresses?

File: meta-xilinx/plain/conf/machine/include/tune-microblaze.inc
# Tune options for microblaze

require conf/machine/include/microblaze/arch-microblaze.inc

-TARGET_FPU = "soft"
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "microblaze", "-mcpu=v8.10a", "", d)}"

#MACHINEOVERRIDES .= "microblaze"

If that works, then maybe we could update the tune-microblaze.inc files, so that it uses the variables defined in the following file, which I updated recently for powerpc440 soft float

File: meta-xilinx/tree/conf/machine/include/tune-ppc440.inc

DEFAULTTUNE ?= "ppc440"

require conf/machine/include/powerpc/arch-powerpc.inc

TUNEVALID[ppc440] = "Enable ppc440 specific processor optimizations"
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc440", "-mcpu=440", "", d)}"

AVAILTUNES += "ppc440"
TUNE_FEATURES_tune-ppc440 = "m32 fpu-soft ppc440"
TUNE_PKGARCH_tune-ppc440 = "ppc440"
PACKAGE_EXTRA_ARCHS_tune-ppc440 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppc440"

# glibc configure options to get ppc440 specific library (for sqrt)
GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppc440", "-with-cpu=440", "", d)}"

I don't see the need for tune-microblazeel.inc, and you could merge the contents of tune-microblazeel.inc, taking care not to define cpu = "microblazeel", as highlighed in red below. that should only be microblaze. 

meta-xilinx/conf.machine/include/tune-microblazeel.inc

# Tune options for microblaze endian little
DEFAULTTUNE ?= "microblazeel"

require conf/machine/include/microblaze/arch-microblaze.inc

TUNEVALID[microblazeel] = "Enable microblaze endian little optimizations"
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "microblazeel", "-mcpu=v8.10a", "", d)}"
TUNE_PKGARCH = "${@bb.utils.contains("TUNE_FEATURES", "microblazeel", "microblazeel", "microblazeel", d)}"

TARGET_FPU = "soft"

AVAILTUNES += "microblazeel"
TUNE_FEATURES_tune-microblazeel = "m32 microblazeel"
PACKAGE_EXTRA_ARCHS_tune-microblazeel = "microblazeel"

#MACHINEOVERRIDES .= "microblaze"


Summary

01. Remove the TARGET_FPU = "soft" specification

02. Quickly test the machine/spartan6-lx9mb.conf by temporarily changing the tune file to include/tune-microblaze.inc, and see if the toolchain gets built using gcc-4.7 recipes.

03. If that works, then update the include/tune-microblaze.inc, to make it more current by looking at include/tune-ppc440.inc. We could potentially delete include/tune-microblazeel.inc, since after including same variables from include/tune-ppc440.inc, into 
include/tune-microblaze.inc, it would end up nearly looking like include/tune-microblazeel.inc, without the erroneous cpu=microblazeel spec in TUNE_CCARGS.

04. Later on create a include/tune-microblazee.inc file, for hardware floating point support.

Do let me know how it goes!

Best regards,

Elvis Dowson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20120907/6d8520e4/attachment.html>


More information about the yocto mailing list