This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Build errors while building C6x Linux for C6472 EVM

Greetings,

I downloaded the git repository for c6x Linux using the steps mentioned at http://linux-c6x.org/wiki/index.php/Downloading/Installing_Software.

I tried to build the Linux kernel using the steps mentioned at http://linux-c6x.org/wiki/index.php/Steps_to_build_the_Software.

On doing "make product", I get the following error:

amit@EICPU1178:~/ti-linux-c6x/linux-c6x-project$ make product
using full dependencies
if [ -z little ]; then          \
            make ENDIAN=little one-rootfs;      \
            make ENDIAN=big     one-rootfs;             \
        else                                    \
            make ENDIAN=little one-rootfs;      \
        fi
make[1]: Entering directory `/home/amit/ti-linux-c6x/linux-c6x-project'
[ -d /home/amit/ti-linux-c6x/product ] || mkdir -p /home/amit/ti-linux-c6x/product
using full dependencies
if [ -z little ]; then          \
            make ENDIAN=little one-sdk0;        \
            make ENDIAN=big     one-sdk0;               \
        else                                    \
            make ENDIAN=little one-sdk0;        \
        fi
make[2]: Entering directory `/home/amit/ti-linux-c6x/linux-c6x-project'
if [ -e /home/amit/ti-linux-c6x/sdk0/linux-c6x-sdk0-prebuilt ] ; then   \
            echo using pre-built sdk0;                          \
        else                                                    \
            if [ -e /home/amit/ti-linux-c6x/ti-gcc-wrap/tool-wrap/Makefile ] ; then             \
                cd /home/amit/ti-linux-c6x/ti-gcc-wrap/tool-wrap; make ENDIAN=little ABI=elf DSBT_SIZE=64 \
                        GCC_C6X_DEST=/home/amit/ti-linux-c6x/sdk0 ALIAS= all;   \
            else                                                                        \
                echo "You must install the prebuilt sdk0 or the build kit for it";      \
                false;                                          \
            fi;                                                 \
        fi;
make[3]: Entering directory `/home/amit/ti-linux-c6x/ti-gcc-wrap/tool-wrap'
[: 9: xlittle: unexpected operator
[: 9: xelf: unexpected operator
make[4]: Entering directory `/home/amit/ti-linux-c6x/ti-gcc-wrap/tool-wrap'
ti-gcc-wrapper for ENDIAN=little ABI=elf ARCH=c6x-elf HOSTCC=gcc-4.4
HOSTCC must point to gcc-3.x
make[4]: *** [which_one] Error 1
make[4]: Leaving directory `/home/amit/ti-linux-c6x/ti-gcc-wrap/tool-wrap'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/amit/ti-linux-c6x/ti-gcc-wrap/tool-wrap'
make[2]: *** [one-sdk0] Error 2
make[2]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x-project'
make[1]: *** [sdk0] Error 2
make[1]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x-project'
make: *** [rootfs] Error 2

I am having my CG tools at /opt/TI/cgt and linux top directory at /home/amit/ti-linux-c6x.

Attached is my setenv file. (I have renamed it with .txt extension to upload here, as uploading file without extension is not supported in the forum.)

I am using ubuntu 10.04 and following are the linux kernel details:

Linux version 2.6.32-21-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010

My gcc version is gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5).

Can any one suggest what is causing this error?

Am I missing any thing?

 

Thanks,

Amit

  • Amit,

    We did build our Software on an Ubuntu machine.

    Can you use export HOSTCC=gcc-3.4.

    This had worked on a Ubuntu machine.

    gcc 4.4 is a little picky and your linux installation should be backward compatible and gcc-3.4 should work.

    Can you try it.

     

    Thanks,

    Sandeep

     

  • If you are building sdk0 you must use a 3.x gcc version

    Did you notice this comment in the setenv?

    We are building sdk0 in our case. Without sdk0, the kernel will not build.

    If you navigate your way to ti-linux-c6x/ti-gcc-wrap/tool-wrap/Makefile you will notice that we say that a 3.x version is required.

    Thanks,
    Sandeep

  • Hi Sandeep,

    Thank you for you reply.

    Sandeep Paulraj said:

    Did you notice this comment in the setenv?

    Yes, after I posted this, I noticed that comment.

    I am unable to install gcc-3.4 on my Ubuntu 10.04 using apt-get install gcc=3.4.

    Can you please explain me how you manage to get gcc-3.4 working on Ubuntu 10.04?

     

    Thanks,

    Amit

  • You will have to pull gcc-3.4 from Ubuntu 9.04.

    We will post the instructions soon

     

    Sandeep

  • I have updated the wiki with instructions for adding gcc-3.4 to Ubuntu 10.04.

    http://linux-c6x.org/wiki/index.php/Setting_up_the_Linux_Host

  • Thank you very much Bill and Sandeep for these steps.

    I installed gcc-3.4 on the Ubuntu 10.04 and tried building the project.

    But, now I see endianess incompatibility from kernel when I perform "make product" in "linux-c6x-project" as follows:

    make[4]: Entering directory `/home/amit/ti-linux-c6x/linux-c6x'
      GEN     /home/amit/ti-linux-c6x/Build/kobjs/evmc6472.el/Makefile
    scripts/kconfig/conf -s arch/c6x/Kconfig
      Using /home/amit/ti-linux-c6x/linux-c6x as source for kernel
      GEN     /home/amit/ti-linux-c6x/Build/kobjs/evmc6472.el/Makefile
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
      CALL    /home/amit/ti-linux-c6x/linux-c6x/scripts/checksyscalls.sh
      CHK     include/generated/compile.h
      AS-TI   arch/c6x/kernel/entry.o
      AS-TI   arch/c6x/kernel/unaligned.o
      LD      arch/c6x/kernel/built-in.o
      AS-TI   arch/c6x/kernel/head.o
      LD      fs/built-in.o
    ld: warning: discarding archive with no symbol directory: 'fs/nfs_common/built-in.o'
    ld: warning: discarding archive with no symbol directory: 'fs/quota/built-in.o'
    <Linking>
    fatal error #16001: object files have incompatible byte orderings
       ("/home/amit/ti-linux-c6x/sdk0/lib/gcc-lib/c6x-elf/3.2.2/empty.o" = little
       endian, "/home/amit/ti-linux-c6x/Build/kobjs/evmc6472.el/fs/open.o" = big
       endian)

    >> Compilation failure
    make[6]: *** [fs/built-in.o] Error 1
    make[5]: *** [fs] Error 2
    make[4]: *** [sub-make] Error 2
    make[4]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x'
    make[3]: *** [kernel-sub] Error 2
    make[3]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x'
    make[2]: *** [one-kernels] Error 2
    make[2]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x-project'
    make[1]: *** [kernels] Error 2
    make[1]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x-project'
    make: *** [rootfs] Error 2

    Am I missing some thing?

    Thanks,

    Amit

  • I tried building the linux in BIG endian mode but I end up with following error:

    <Linking>
    "/home/amit/ti-linux-c6x/Build/kobjs/evmc6472.eb/arch/c6x/vmlinux.cmd", line 473: warning #10098-D:
       specific address 0xe0000400 overrides alignment of 8192 for "GROUP_1"
      KSYM    .tmp_kallsyms2.S64
      AS-TI   .tmp_kallsyms2.o
      LD      vmlinux
    ld: warning: discarding archive with no symbol directory: 'crypto/built-in.o'
    ld: warning: discarding archive with no symbol directory: 'arch/c6x/lib/built-in.o'
    ld: warning: discarding archive with no symbol directory: 'sound/built-in.o'
    ld: warning: discarding archive with no symbol directory: 'firmware/built-in.o'
    <Linking>
    "/home/amit/ti-linux-c6x/Build/kobjs/evmc6472.eb/arch/c6x/vmlinux.cmd", line 473: warning #10098-D:
       specific address 0xe0000400 overrides alignment of 8192 for "GROUP_1"
      SYSMAP  System.map
      SYSMAP  .tmp_System.map
      Building modules, stage 2.
    echo "__modpost: vmlinux drivers/mtd/chips/cfi_cmdset_0001.o drivers/mtd/chips/cfi_cmdset_0002.o drivers/mtd/chips/cfi_cmdset_0020.o drivers/mtd/chips/cfi_probe.o drivers/mtd/chips/cfi_util.o drivers/mtd/chips/gen_probe.o drivers/mtd/chips/jedec_probe.o drivers/mtd/devices/mtdram.o drivers/mtd/maps/physmap.o fs/ext3/ext3.o fs/jbd/jbd.o  [drivers/mtd/chips/cfi_cmdset_0001.o drivers/mtd/chips/cfi_cmdset_0002.o drivers/mtd/chips/cfi_cmdset_0020.o drivers/mtd/chips/cfi_probe.o drivers/mtd/chips/cfi_util.o drivers/mtd/chips/gen_probe.o drivers/mtd/chips/jedec_probe.o drivers/mtd/devices/mtdram.o drivers/mtd/maps/physmap.o fs/ext3/ext3.o fs/jbd/jbd.o FORCE]"
    __modpost: vmlinux drivers/mtd/chips/cfi_cmdset_0001.o drivers/mtd/chips/cfi_cmdset_0002.o drivers/mtd/chips/cfi_cmdset_0020.o drivers/mtd/chips/cfi_probe.o drivers/mtd/chips/cfi_util.o drivers/mtd/chips/gen_probe.o drivers/mtd/chips/jedec_probe.o drivers/mtd/devices/mtdram.o drivers/mtd/maps/physmap.o fs/ext3/ext3.o fs/jbd/jbd.o  [drivers/mtd/chips/cfi_cmdset_0001.o drivers/mtd/chips/cfi_cmdset_0002.o drivers/mtd/chips/cfi_cmdset_0020.o drivers/mtd/chips/cfi_probe.o drivers/mtd/chips/cfi_util.o drivers/mtd/chips/gen_probe.o drivers/mtd/chips/jedec_probe.o drivers/mtd/devices/mtdram.o drivers/mtd/maps/physmap.o fs/ext3/ext3.o fs/jbd/jbd.o FORCE]
      MODPOST 11 modules
    WARNING: modpost: Found 16 section mismatch(es).
    To see full details build your kernel with:
    'make CONFIG_DEBUG_SECTION_MISMATCH=y'
    make[4]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x'
    make ARCH=c6x O=/home/amit/ti-linux-c6x/Build/kobjs/evmc6472.eb/ DEPMOD= INSTALL_MOD_PATH=/home/amit/ti-linux-c6x/Build/rootfs/kernel-modules-c6xeb modules_install
    make[4]: Entering directory `/home/amit/ti-linux-c6x/linux-c6x'
    Warning: you may need to install module-init-tools
    See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
      INSTALL drivers/mtd/chips/cfi_cmdset_0001.ko
      INSTALL drivers/mtd/chips/cfi_cmdset_0002.ko
      INSTALL drivers/mtd/chips/cfi_cmdset_0020.ko
      INSTALL drivers/mtd/chips/cfi_probe.ko
      INSTALL drivers/mtd/chips/cfi_util.ko
      INSTALL drivers/mtd/chips/gen_probe.ko
      INSTALL drivers/mtd/chips/jedec_probe.ko
      INSTALL drivers/mtd/devices/mtdram.ko
      INSTALL drivers/mtd/maps/physmap.ko
      INSTALL fs/ext3/ext3.ko
      INSTALL fs/jbd/jbd.ko
      DEPMOD  2.6.34-evmc6472.eb-20101005
    /bin/sh: -ae: not found
    make[5]: *** [_modinst_post] Error 127
    make[4]: *** [sub-make] Error 2
    make[4]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x'
    make[3]: *** [kernel-sub] Error 2
    make[3]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x'
    make[2]: *** [one-kernels] Error 2
    make[2]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x-project'
    make[1]: *** [kernels] Error 2
    make[1]: Leaving directory `/home/amit/ti-linux-c6x/linux-c6x-project'
    make: *** [rootfs] Error 2

    Can any one help me out with this?

     

    Thanks,

    Amit

  • Amit,

     

    We have seen this error before in an RHEL4 machine for a big endian build

     

    First can you confirm that this happens only in the big endian build. The little endian build should go through fine.

    As the warning suggests you might have to install module init tools

    Warning: you may need to install module-init-tools

    I picked the above from your kernel dump.

    We have a work around for this in the case of a RHEL4 machine.

    Please refer http://www.linux-c6x.org/wiki/index.php/Setting_up_the_Linux_Host#DEPMOD

     

    I do not know if the above rpm(available from the link in the wiki page) is applicable to an Ubuntu machine as well.

    You might have to get an updated rpm from the latest Ubuntu distribution.

     

    Regards,

    Sandeep

     


  • Sandeep Paulraj said:
    First can you confirm that this happens only in the big endian build. The little endian build should go through fine.

    Yes, this happens for big endian mode only. Can you help me out the Endianness incompatibility when little endian mode?

    Sandeep Paulraj said:
    As the warning suggests you might have to install module init tools

    Yes, I had a note of that too. But, I have it installed on my ubuntu. I get following on "depmod -V"

    module-init-tools 3.11.1

  • Amit,

    Normal 0 false false false MicrosoftInternetExplorer4

    Make sure that DEPMOD is not defined.  I was able to build big endian on 10.04 before release w/ stock /sbin/depmod but have not re-verified just now.  I will try this.

    You should be aware that little endian mode has more test time than big endian and that a greater body of code for c64x is running in little endian mode.  Some C6x devices only run in little endian mode (although all the current SOCs run in both endian mode.)  Unless you have a very strong reason to be using big endian the recommendation is to use little.

    Bill

  • Amit,

    Can you please try a clean build while attempting to build the little endian kernel.

     

    I can't think of a reason why a little endian build should complain about big endian failure.

     

    Thanks,

    Sandeep

     

  • Amit,

    I re verified big endian 6472 build on Ubuntu 10.04 using a fresh bootstrap of linux-c6x-0.7.0.  It completed w/o errors.

    Bill

  • Hi Bill,

    Thank you for your reply.

    Bill Mills said:
    Unless you have a very strong reason to be using big endian the recommendation is to use little.

    I am getting started with C6x linux on C6472 EVM

    As I was unable to build the linux in little endian mode, I tried to build the big endian mode to get some thing built and running on the EVM. :-)

    Untill now, I use to do all development for little endian mode only.

    As Sandeep suggested let me try to doing a clean make for little endian mode.

    Thanks,

    Amit

  • <Linking>
    fatal error #16001: object files have incompatible byte orderings
       ("/home/amit/ti-linux-c6x/sdk0/lib/gcc-lib/c6x-elf/3.2.2/empty.o" = little
       endian, "/home/amit/ti-linux-c6x/Build/kobjs/evmc6472.el/fs/open.o" = big
       endian

    the above doesn't seem right. Try a clean build. It should work. Don't forget to change the setenv

    to build a little endian kernel and then you will also have to 'source setenv' for the changes to take effect.

     

    Thanks,

    Sandeep

  • Hi Sandeep,

    Sandeep Paulraj said:

    Try a clean build. It should work. Don't forget to change the setenv

    to build a little endian kernel and then you will also have to 'source setenv' for the changes to take effect.

    I tried a clean build for little endian mode in vain. I got the fresh code from repository and tried to build the project. But I am facing the same error as before.

    Attached is my error log and setenv file.

     

    Thanks,

    Amit

    erro_setenv.zip
  • Amit,

     

    It still looks like dirty state to me.  When you started from the clean bootstrap did you go to a new directory or completely remove the old one?

     

    From the project directory do:

    ./prj git status

    ./prj git clean -ndx

     

    The above will not change anything but will show all mods and local files.  It should be clean except for

     .prj.local

    setenv

    .kernelrelease

     

     

  • Hi Bill,

    I have a seperate directory where I have the project source intact from the git repository.

    As suggested on wiki, I work in another local copy of that directory.

    I followed your suggestion and got following output, indicating that the source is clean:

    amit@EICPU1178:~/my-linux-c6x_not_to_modify/linux-c6x-project$ ./prj git status
    ****** linux-c6x-project
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** linux-c6x
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** busybox
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** uClibc
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** ti-gcc-wrap/binutils
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** ti-gcc-wrap/cil
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** ti-gcc-wrap/sources
    # Not currently on any branch.
    nothing to commit (working directory clean)
    ****** ti-gcc-wrap/tool-wrap
    # Not currently on any branch.
    nothing to commit (working directory clean)
    amit@EICPU1178:~/my-linux-c6x_not_to_modify/linux-c6x-project$ ./prj git clean -ndx
    ****** linux-c6x-project
    Would remove .prj.local
    ****** linux-c6x
    ****** busybox
    ****** uClibc
    ****** ti-gcc-wrap/binutils
    ****** ti-gcc-wrap/cil
    ****** ti-gcc-wrap/sources
    ****** ti-gcc-wrap/tool-wrap

     

    Thanks,

    Amit

  • Amit,

    Normal 0 false false false

    You should not be working in two directories.  I am sorry if you got that impression from the wiki.   It appears we have an inconsistency in the dir name we use in the examples: some use ti-linux-c6x and some use my-linux-c6x.  It does not matter what the dir name is but you should be working in just one.  The top level makefile keeps all the variations n separate build directories anyway.

    Please reissue the commands I gave you before in the project directory where you are issuing the build commands.  Your results should match what I told you.  If you have more or _less_ files listed that indicates some sort of disconnect.

  • Hi Bill,

    I understand that working in two different directories should not make any difference.

    We were able to build the kernel and target file system after making a change in the project Makefile.

    kernel-sub:
            @if [ -z "$(KNAME)" ] ; then echo Must define KNAME for this target; exit 1; fi
            [ -d $(KOBJDIR) ] || mkdir -p $(KOBJDIR)
            cp arch/c6x/configs/$(DEFCONFIG) $(KOBJDIR)/.config
            [ -z "$(CONFIGPATCH)" ] || patch -p1 -d $(KOBJDIR) -i $(PRJ)/kbuilds/$(CONFIGPATCH)
            [ -z "$(CONFIGSCRIPT)" ] || $(PRJ)/kbuilds/$(CONFIGSCRIPT) $(KOBJDIR)/.config $(CONFIGARGS)
            [ "$(ENDIAN)" == "little" ] || \
               sed -i -e 's,# CONFIG_CPU_BIG_ENDIAN is not set,CONFIG_CPU_BIG_ENDIAN=n,' $(KOBJDIR)/.config

    The CONFIG_CPU_BIG_ENDIAN was set to 'y'. After changing it to 'n', I am able to build the kernel and also the target file system.

    Even if I am building in little endian mode, I need to export the DEPMODE variable.

    Thank you Sandeep and Bill for all your help.

     

    Enjoy...

    Amit

  • Hi Sandeep,

    I had another observation. The link of IBL binaries are not working at http://linux-c6x.org/wiki/index.php/Burning_the_EEPROM_with_the_IBL

    Thanks,

    Amit

  • Amit,


    I'll fix it. I have to put it in version control first.

    It will be released soon.

     

    Thanks,
    Sandeep