Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

About the nios-elf-gcc problem

I install the tools CDK4NIOS and use nios-elf-gcc to compile the U-Boot-1.1.4.For the test,I input:

make DK1C20_config

make

......

The follow message is like this

make[1]: Entering directory `/root/u-boot-1.1.4/common'

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o main.o main.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o ACEX1K.o ACEX1K.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o altera.o altera.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o bedbug.o bedbug.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o circbuf.o circbuf.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_ace.o cmd_ace.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_autoscript.o cmd_autoscript.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_bdinfo.o cmd_bdinfo.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_bedbug.o cmd_bedbug.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_bmp.o cmd_bmp.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_boot.o cmd_boot.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_bootm.o cmd_bootm.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_cache.o cmd_cache.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_console.o cmd_console.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_date.o cmd_date.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_dcr.o cmd_dcr.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_diag.o cmd_diag.c

/usr/local/nios-elf/bin/nios-elf-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0x018c0000 -I/root/u-boot-1.1.4/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/nios-elf/lib/gcc-lib/nios-elf/2.9-nios-010801-20030923/include -pipe -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs -Wall -Wno-trigraphs -c -o cmd_display.o cmd_display.c

cmd_display.c: In function `do_display':

cmd_display.c:41: `CFG_DISP_CWORD' undeclared (first use in this function)

cmd_display.c:41: (Each undeclared identifier is reported only once

cmd_display.c:41: for each function it appears in.)

cmd_display.c:51: `CFG_DISP_CHR_RAM' undeclared (first use in this function)

make[1]: *** [cmd_display.o] Error 1

make[1]: Leaving directory `/root/u-boot-1.1.4/common'

make: *** [common/libcommon.a] Error 2

[root@localhost u-boot-1.1.4]#

I don't know what's wrong.Beacause I don't modify any file except set the gcc PATH.

I'll be very happy if anyone can reply.

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi young,

    > I install the tools CDK4NIOS

    Don't use CDK4NIOS -- it is junk ... it is old ... it is unmaintained. If you must use it, you're on

    your own :-(

    > and use nios-elf-gcc to compile the U-Boot-1.1.4.

    Just to make sure: this is for Nios-32, not Nios II -- is that what you intend?

    > For the test,I input: make DK1C20_config

    ... snip ...

    > CFG_DISP_CWORD' undeclared (first use in this function)

    > cmd_display.c:41: (Each undeclared identifier is reported only once

    > cmd_display.c:41: for each function it appears in.)

    > cmd_display.c:51: `CFG_DISP_CHR_RAM'

    It looks like CFG_CMD_DISPLAY is now a default option. Try adding it to the

    excluded options where CONFIG_COMMANDS is defined in the board

    config file:

    include/configs/DK1C20.h<div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    #define CONFIG_COMMANDS (CFG_CMD_ALL & ~(

    CFG_CMD_ASKENV |

    CFG_CMD_BEDBUG |

    CFG_CMD_BMP |

    CFG_CMD_BSP |

    CFG_CMD_CACHE |

    CFG_CMD_DATE |

    cfg_cmd_display | \

    CFG_CMD_DOC |

    CFG_CMD_DTT |

    CFG_CMD_EEPROM |

    CFG_CMD_ELF |

    ...[/b]

    --- Quote End ---

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by smcnutt@Nov 4 2006, 01:20 AM

    hi young,

    > i install the tools cdk4nios

    don&#39;t use cdk4nios -- it is junk ... it is old ... it is unmaintained. if you must use it, you&#39;re on

    your own :-(

    > and use nios-elf-gcc to compile the u-boot-1.1.4.

    just to make sure: this is for nios-32, not nios ii -- is that what you intend?

    > for the test,i input: make dk1c20_config

    ... snip ...

    > cfg_disp_cword&#39; undeclared (first use in this function)

    > cmd_display.c:41: (each undeclared identifier is reported only once

    > cmd_display.c:41: for each function it appears in.)

    > cmd_display.c:51: `cfg_disp_chr_ram&#39;

    it looks like cfg_cmd_display is now a default option. try adding it to the

    excluded options where config_commands is defined in the board

    config file:

    include/configs/dk1c20.h<div class='quotetop'>quote

    --- quote end ---

    --- quote start ---

    #define config_commands (cfg_cmd_all & ~(

    cfg_cmd_askenv |

    cfg_cmd_bedbug |

    cfg_cmd_bmp |

    cfg_cmd_bsp |

    cfg_cmd_cache |

    cfg_cmd_date |

    CFG_CMD_DISPLAY | \ [/b]

    CFG_CMD_DOC |

    CFG_CMD_DTT |

    CFG_CMD_EEPROM |

    CFG_CMD_ELF |

    ...[/b]

    --- Quote End ---

    Regards,

    --Scott

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=19153)</div>

    [/b]

    --- Quote End ---

    Hi,smcnutt.Thank you so much for replying,and intalling the CDK4NIOS.CDK4NIOS is not the best one ,but I have to,for I can&#39;t find a suitable one.would you please look for a new cross compile tool for me.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Really, you should not user Nios, unless you are maintaining an old product.

    You should move to Nios II. You can find evaluation software from Altera&#39;s site.

    And there are binary toolchain, which you can download from Nios wiki.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by hippo@Nov 4 2006, 11:42 PM

    really, you should not user nios, unless you are maintaining an old product.

    you should move to nios ii. you can find evaluation software from altera&#39;s site.

    and there are binary toolchain, which you can download from nios wiki.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=19165)

    --- quote end ---

    --- Quote End ---

    Thanks for Hippo.I follow the instruction and install the gcc for nios2 successfully.Thanks again,and I compile the U-Boot-1.1.4 successful too.To make sure what I did is right.I show my configuration simply as below:

    1.Intall BinaryToolchain.

    2.download the u-boot-1.1.4 and uncompress it under the catalog /home/yy

    3.modify the file /home/yy/u-boot-1.1.4/Makefile like this:

    ifeq ($ARCH),nios2)

    CROSS_COMPILE = /opt/nios2/bin/nios2-linux-uclibc-

    endif

    4.make a nios2 target for test,what I did is like this:

    [root@localhost u-boot-1.1.4]#make PK1C20_config

    Configuring for PK1C20 board...

    [root@localhost u-boot-1.1.4]#make

    ...snip...

    make[1]: Leaving directory `/home/yy/u-boot-1.1.4/common&#39;

    UNDEF_SYM=`/opt/nios2/bin/nios2-linux-uclibc-objdump -x lib_generic/libgeneric.a board/psyent/pk1c20/libpk1c20.a cpu/nios2/libnios2.a lib_nios2/libnios2.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a |sed -n -e &#39;s/.*\(__u_boot_cmd_.*\)/-u\1/p&#39;|sort|uniq`;

    /opt/nios2/bin/nios2-linux-uclibc-ld -Bstatic -T /home/yy/u-boot-1.1.4/board/psyent/pk1c20/u-boot.lds -Ttext 0x018e0000 $UNDEF_SYM cpu/nios2/start.o

    --start-group lib_generic/libgeneric.a board/psyent/pk1c20/libpk1c20.a cpu/nios2/libnios2.a lib_nios2/libnios2.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a --end-group -L /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6 -lgcc

    -Map u-boot.map -o u-boot

    /opt/nios2/bin/nios2-linux-uclibc-objcopy --gap-fill=0xff -O srec u-boot u-boot.srec

    /opt/nios2/bin/nios2-linux-uclibc-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin

    [root@localhost u-boot-1.1.4]#

    At last,I found u-boot.map u-boot.srec u-boot.bin and u-boot these files.

    Thanks for anyone who ever helped me,and I will continue to study u-boot and uClinux. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It seems OK.

    You may also try out the latest u-boot release 1.1.5 .

    Next you will need to download to sdram, and try out.

    Then you need to learn to program u-boot to flash.

    You may search the forum and find a lot of helpful posts from Scott.

    During your learning, it would be great if you can take down your experience on the wiki.

    Finally, welcome to the wonderful world of Nios II.