AnsweredAssumed Answered

Fail to link gadgetfs example code with AIO

Question asked by fschmid on May 23, 2012
Latest reply on May 25, 2012 by sonic

I'm trying to get the gadgetfs example code http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:usb-gadget:userspace-example to compile with AIO-support. However, I get linker errors when trying to link the application:

 

/home/schmid/src/R1208/src/apps/usbfs/usb.c:961: undefined reference to `_io_getevents'

/home/schmid/src/R1208/src/uclinux/debug-blackfin-linux-dist/staging/usr/lib/libaio.so: undefined reference to `_io_cancel'

 

Linker command: bfin-linux-uclibc-gcc build/debug/usb.o build/debug/usbstring.o -o build/debug/usbfstest -L/home/schmid/src/R1208/src/staging/debug/lib -L/home/schmid/src/R1208/src/uclinux/debug-blackfin-linux-dist/staging/usr/lib -Wl,--defsym,__stacksize=32768 -lpthread -laio

 

The symbol table in libaio.so also looks strange to me:

 

bfin-linux-uclibc-objdump -t src/uclinux/debug-blackfin-linux-dist/staging/usr/lib/libaio.so

 

src/uclinux/debug-blackfin-linux-dist/staging/usr/lib/libaio.so:     file format elf32-bfinfdpic

 

SYMBOL TABLE:

000000b4 l    d  .hash  00000000              .hash

00000110 l    d  .dynsym        00000000              .dynsym

00000230 l    d  .dynstr        00000000              .dynstr

000002e2 l    d  .gnu.version   00000000              .gnu.version

00000308 l    d  .gnu.version_d 00000000              .gnu.version_d

00000364 l    d  .rel.dyn       00000000              .rel.dyn

0000036c l    d  .rel.plt       00000000              .rel.plt

0000039c l    d  .plt   00000000              .plt

00000408 l    d  .text  00000000              .text

00000698 l    d  .rofixup       00000000              .rofixup

0000169c l    d  .dynamic       00000000              .dynamic

00001758 l    d  .got   00000000              .got

00001798 l    d  .bss   00000000              .bss

00000000 l    d  .comment       00000000              .comment

00000000 l    d  .debug_aranges 00000000              .debug_aranges

00000000 l    d  .debug_pubnames        00000000              .debug_pubnames

00000000 l    d  .debug_info    00000000              .debug_info

00000000 l    d  .debug_abbrev  00000000              .debug_abbrev

00000000 l    d  .debug_line    00000000              .debug_line

00000000 l    d  .debug_frame   00000000              .debug_frame

00000000 l    d  .debug_str     00000000              .debug_str

00000000 l    d  .debug_loc     00000000              .debug_loc

00000000 l    df *ABS*  00000000              io_queue_init.c

00000000 l    df *ABS*  00000000              io_queue_release.c

00000000 l    df *ABS*  00000000              io_queue_wait.c

00000000 l    df *ABS*  00000000              io_queue_run.c

00001798 l     O .bss   00000008              _timeout.2100

00000000 l    df *ABS*  00000000              io_getevents.c

00000000 l    df *ABS*  00000000              io_submit.c

00000000 l    df *ABS*  00000000              io_cancel.c

00000000 l    df *ABS*  00000000              io_setup.c

00000000 l    df *ABS*  00000000              io_destroy.c

00000000 l    df *ABS*  00000000              raw_syscall.c

00000000 l    df *ABS*  00000000              compat-0_1.c

0000169c l     O .dynamic       00000000              _DYNAMIC

0000056c l     F .text  0000003e              _io_cancel_0_4

00020000 l     O *ABS*  00000000              __stacksize

00000684 l     F .text  00000012              _compat0_1_io_cancel

00000618 l     F .text  00000032              _compat0_1_io_getevents

00001798 l       *ABS*  00000000              ___bss_start

000017a0 l       *ABS*  00000000              __end

00001798 l       *ABS*  00000000              __edata

0000069c l       .rofixup       00000000              __ROFIXUP_END__

00000698 l       .rofixup       00000000              __ROFIXUP_LIST__

00000438 l     F .text  00000016              _io_queue_wait_0_4

00001788 l     O .got   00000000              __GLOBAL_OFFSET_TABLE_

0000064c l     F .text  00000036              _compat0_1_io_queue_wait

000004dc l     F .text  0000004e              _io_getevents_0_4

00000494 l     F .text  00000046              ___io_getevents_0_4

0000042c g     F .text  0000000c              _io_queue_release

00000408 g     F .text  00000022              _io_queue_init

00000000 g     O *ABS*  00000000              LIBAIO_0.1

0000052c g     F .text  0000003e              _io_submit

00000000         *UND*  00000000              _syscall

00000000         *UND*  00000000              _io_getevents

00000000       F *UND*  00000000              ___errno_location

00000450 g     F .text  00000042              _io_queue_run

00000000         *UND*  00000000              _io_cancel

000005ac g     F .text  00000036              _io_setup

00000000 g     O *ABS*  00000000              LIBAIO_0.4

000005e4 g     F .text  00000032              _io_destroy

 

I thought this might have something to do with a toolchain mismatch. I'm using toolchain 2011R1-RC4 with uClinux 2011R1-RC3. I also tried toolchain 2010R1-RC4 with uClinux 2010R1-RC5 to no avail.

Outcomes