Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

add fdisk --> compilation error!

Altera_Forum
Honored Contributor II
1,481 Views

Hi all, 

 

I'm new to the uClinux, I try to implement usb device (isp1761 Usb controller) 

I want to create and partition a local disk (8 MB) to emulate a mass storage (diskemu). So I add fdisk in uClinux configuration. 

 

BusyBox ---> Linux System Utilities ---> [*] fdisk 

 

But the compilation doesn't correctly! I don't know how to correct this error!  

 

Here is the error message when compiling : 

 

.... 

LD util-linux/built-in.o 

CC util-linux/dmesg.o 

CC util-linux/fdisk.o 

CC util-linux/mount.o 

AR util-linux/lib.a 

LINK busybox_unstripped 

busybox_unstripped.elf2flt(.text.read_line+0x8): In function `read_line': 

util-linux/fdisk.c:335: Unable to reach ptr_to_globals (at 0x0003d420) from the global pointer (at 0x00045d60) because the offset (-35136) is out of the allowed range, -32678 to 32767. 

 

collect2: ld returned 1 exit status 

make[3]: *** [busybox_unstripped] Erreur 1 

make[3]: Leaving directory « /uClinux-dist/user/busybox » 

make[2]: *** [busybox] Erreur 2 

make[2]: Leaving directory « /uClinux-dist/user » 

make[1]: *** [all] Erreur 2 

make[1]: Leaving directory « /uClinux-dist/user » 

make: *** [subdirs] Erreur 1 

 

 

 

When I compile without fdisk the kernel is compiled correctly (Kernel : 2.6.23-uc) 

 

Thanks for your help. 

Regards,
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
792 Views

Hi all, 

 

Here are some details about my problem (selection of "fdisk" in menuconfig) 

 

In compiling uClinux by running Cmd: make NON_SMP_BUILD=1 

 

Here is the error obtained: 

 

fdisk.elf2flt(.text+0x4f64): In function `xbsd_readlabel':/uClinux-dist/user/fdisk/fdiskbsdlabel.c:732: undefined reference to `bcopy' 

fdisk.elf2flt(.text+0x5560): In function `bselect':/uClinux-dist/user/fdisk/fdiskbsdlabel.c:534: undefined reference to `bcopy' 

fdisk.elf2flt(.text+0x556c):/uClinux-dist/user/fdisk/fdiskbsdlabel.c:537: undefined reference to `bzero' 

fdisk.elf2flt(.text+0x55d4):/uClinux-dist/user/fdisk/fdiskbsdlabel.c:552: undefined reference to `bcopy' 

fdisk.elf2flt(.text+0x58cc):/uClinux-dist/user/fdisk/fdiskbsdlabel.c:767: undefined reference to `bcopy' 

fdisk.elf2flt(.text+0x5a6c):/uClinux-dist/user/fdisk/fdiskbsdlabel.c:657: undefined reference to `bzero' 

collect2: ld returned 1 exit status 

make[3]: *** [fdisk] Erreur 1 

make[3]: Leaving directory « /uClinux-dist/user/fdisk » 

make[2]: *** [fdisk] Erreur 2 

make[2]: Leaving directory « /uClinux-dist/user » 

make[1]: *** [all] Erreur 2 

make[1]: Leaving directory « /uClinux-dist/user » 

make: *** [subdirs] Erreur 1 

 

Are there other features to enable (or not) when using fdisk? 

Someone he knows why I have this error? 

 

thanks!
0 Kudos
Altera_Forum
Honored Contributor II
792 Views

I once saw the bcopy() problem with some other Busyboc appltet some time ago. 

 

IIRC, bcopy is an old style function that is depreciated now and needs to be replaced by something else (supposedly memcpy() - I seem to remember that the parameter order is different, bzero supposedly is replaced by memset). 

 

Moreover the French error message suggests that you don't use the original toolchain as described in the NIOSWiki. This is not supported by this community. 

 

I suggest following closely http://www.nioswiki.com/operatingsystems/uclinux (http://www.nioswiki.com/operatingsystems/uclinux) and http://www.nioswiki.com/installnios2linux (http://www.nioswiki.com/installnios2linux) before trying to solve any errors on your own. 

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
792 Views

Thank you Mschnell for your reply, 

 

I have successfully compiled after updating the busybox. 

 

For have fdisk in sbin directory I add it in busybox --> Linux system utilities and not in Filesystemt applications. 

 

Thanks,
0 Kudos
Reply