undef.ref. to`_dl_app_fini_array' OR linked wrong libc ?!

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
I am using buildroot-avr32-v2.2.0-rc5, compiled SDL an directfb with buildroot and everything is OK so far.

Now i tried do compile a simple program:

#include 
#include 

int main(int argc, char *argv[])
{
	
	printf("huhu\n");
return 0;	
}

... with this command:

avr32-linux-gcc -L$SDIR/lib -o test.elf main.c

where SDIR is the staging_dir of the buildroot.

The command above results in the following error:

/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/lib/libc.so.0: undefined reference to `_dl_app_init_array'
/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/lib/libc.so.0: undefined reference to `_dl_app_fini_array'
collect2: ld returned 1 exit status

This error occurs when linking with the staging_dir/lib directory (-L/.../staging_dir/lib).
By compiling whithout this link everything is fine.

But i need this link and its libraries to compile SDL programs for example.
Is this correct?

The libc.so.0 in staging_dir/lib links to libuClibc-0.9.29.so in the same directory.

What a library is used when compiling the HelloWorld stuff without -L/.../staging_dir/lib declaration?

The libc.so. in /usr/avr32-linux/lib links to libuClibc-0.9.28.so.
Is this a problem? Is this the problem?

Thank you very much.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK OK searching intelligent in this forum before posting is sometimes a good Idea.

I try to solve this issue with the information below.

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=60630&highlight=dlappfiniarray

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you only miss a -ldl at the end, telling the linker to explicit grab the dynamic loader library.

IIRC there is a sdl-config application in staging_dir/bin/sdl-config, use it to generate prefixes, should be a ./staging_dir/bin/sdl-config --help.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you HCE for the info, -ldl is good.
Now i am able to initialize SDL Audio. But when i try to initialize Video, following error occurred:

     =======================|  DirectFB 1.0.1  |=======================
          (c) 2001-2007  The DirectFB Organization (directfb.org)
          (c) 2000-2004  Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Multi Application Core. (2008-08-01 09:09) 
(*) Fusion/SHM: Using MADV_REMOVE (2.6.25.10 >= 2.6.19.2)
(!) Direct/Util: opening '/dev/fusion0' and '/dev/fusion/0' failed
    --> No such file or directory
(!) Fusion/Init: Opening fusion device (world 0) as 'any' failed!
    --> No such file or directory

There is no /dev/fusion directory,
And there is no fusion kernel Module.

I thought the Kernel module will be generated by selecting linux-fusion in the menuconfig.

Please tell me how to generate the fusion kernel-module with
buildroot.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Please tell me how to generate the fusion kernel-module with
buildroot.

the kernel need virtual terminal / console on virtual terminal (both under Character devices)

Download linux-fusion
"Hack the Makefile":
I changed some Paths in the Makefile to work with the buildroot toolchain:

#KERNEL_VERSION    = $(shell uname -r)
KERNEL_VERSION    = 2.6.25.10.atmel.2
KERNEL_MODLIB     = /home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/project_build_avr32/r1/root/lib/modules/$(KERNEL_VERSION)
#KERNEL_BUILD     = $(KERNEL_MODLIB)/build
KERNEL_BUILD     = /home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/project_build_avr32/r1/linux-2.6.25.10
#KERNEL_SOURCE    = $(KERNEL_MODLIB)/source
KERNEL_SOURCE    = /home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/project_build_avr32/r1/linux-2.6.25.10
...
...
...
all:
	rm -f $(SUB)/Makefile
	ln -s Makefile-2.$(KERNEL_PATCHLEVEL) $(SUB)/Makefile
	$(MAKE) -C $(KERNEL_BUILD) ARCH=avr32 CROSS_COMPILE=avr32-linux- modules  \
		

The entries.c has to be manipulated in order to get rid of problems with xtime.

After that i tried to install the kernel module by the tutorial in thread
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=67292&start=0&postdays=0&postorder=asc&
and...

IT WORKS, ... unbelievable

I am able to modprobe fusion and /dev/fusion appears on the avr32.

So far so good.

Now there are old issus with directfb an unsupported pixel format, so SDL is not running properly!
Have a nice day.