Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 200661 - dev-libs/DirectFB-0.9.25.1 - directfb-config does not set -lsysfs
Summary: dev-libs/DirectFB-0.9.25.1 - directfb-config does not set -lsysfs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo Games
URL: http://www.directfb.org/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-28 16:59 UTC by Andrew Williams
Modified: 2007-12-02 22:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch against DirectFB-0.9.25.1 (DirectFB-0.9.25.1-sysfs.patch,1.10 KB, patch)
2007-11-28 17:02 UTC, Andrew Williams
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Williams 2007-11-28 16:59:45 UTC
I have been trying to get splashy to work on gentoo and ran into a small directfb bug that seems to have been around for some time.

When DirectFB is built with the "sysfs" USE flag linking against the library fails  with the following errors.

then mv -f ".deps/splashy-splashy_functions.Tpo" ".deps/splashy-splashy_functions.Po"; else rm -f ".deps/splashy-splashy_functions.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link i686-pc-linux-gnu-gcc -O2 -march=athlon64 -msse3 -fomit-frame-pointer -pipe -Wall -Werror -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -o splashy -all-static -static-libgcc -Wl,-uIDirectFBFont_Default -Wl,-uIDirectFBFont_FT2 -Wl,-uIDirectFBImageProvider_PNG splashy-splashy_main.o splashy-splashy_functions.o libsplashycnf.la libsplashy.la -lpthread -lm -lglib-2.0 -static /usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o /usr/lib/directfb-0.9.25/wm/libdirectfbwm_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_ft2.o -lfreetype /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o -lpng -lz -lm /usr/lib/directfb-0.9.25/inputdrivers/libdirectfb_keyboard.o -L/usr/lib -ldirectfb -lfusion -ldirect -lpthread -lz
i686-pc-linux-gnu-gcc -O2 -march=athlon64 -msse3 -fomit-frame-pointer -pipe -Wall -Werror -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -o splashy -static -static-libgcc -Wl,-uIDirectFBFont_Default -Wl,-uIDirectFBFont_FT2 -Wl,-uIDirectFBImageProvider_PNG splashy-splashy_main.o splashy-splashy_functions.o /usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o /usr/lib/directfb-0.9.25/wm/libdirectfbwm_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_ft2.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o /usr/lib/directfb-0.9.25/inputdrivers/libdirectfb_keyboard.o ./.libs/libsplashycnf.a ./.libs/libsplashy.a /var/tmp/portage/media-gfx/splashy-0.3.6/work/splashy-0.3.6/src/.libs/libsplashycnf.a /usr/lib/libglib-2.0.a /usr/lib/libfreetype.a /usr/lib/libpng12.a -lm -L/usr/lib /usr/lib/libdirectfb.a /usr/lib/libfusion.a /usr/lib/libdirect.a -ldl -lpthread -lz
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0x121b): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0x120e): warning: Using 'setpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0x1227): warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0x10cf): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
(.text+0x1117): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libdirect.a(log.o): In function `parse_host_addr':
(.text+0x231): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev':
(.text+0x4c1c): undefined reference to `sysfs_get_mnt_path'
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev':
(.text+0x4cb5): undefined reference to `sysfs_open_class_device'
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev':
(.text+0x4cc7): undefined reference to `sysfs_get_classdev_device'
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev':
(.text+0x4ce1): undefined reference to `sysfs_get_device_attr'
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev':
(.text+0x4d18): undefined reference to `sysfs_get_device_attr'
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev':
(.text+0x4db2): undefined reference to `sysfs_close_class_device'
collect2: ld returned 1 exit status
make[2]: *** [splashy] Error 1
make[2]: Leaving directory `/var/tmp/portage/media-gfx/splashy-0.3.6/work/splashy-0.3.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-gfx/splashy-0.3.6/work/splashy-0.3.6'
make: *** [all] Error 2

More details here http://forums.gentoo.org/viewtopic-t-326522.html

I tracked this down to directfb itself, directfb-config does not set -lsysfs
so linking against it fails as noted above.
I went looking into why this was happening on Gentoo and not other distros and it seems this is because they are ALL patching the DirectFB sources.
I have attached a simple patch that fixed the problem.
Please add this patch to the ebuild. I have tested it in my overlay and it works as it should.

diff -uNr DirectFB-0.9.25.1/directfb-config.in DirectFB-0.9.25.1-sysfs/directfb-config.in
--- DirectFB-0.9.25.1/directfb-config.in        2005-12-01 11:51:06.000000000 -0700
+++ DirectFB-0.9.25.1-sysfs/directfb-config.in  2007-11-27 21:45:03.000000000 -0700
@@ -300,7 +300,7 @@
       libs=-L@libdir@

       if test "$lib_directfb" = "yes"; then
-        libs="$libs -ldirectfb -lfusion -ldirect @THREADLIB@ @ZLIB_LIBS@"
+        libs="$libs -ldirectfb -lfusion -ldirect @THREADLIB@ @ZLIB_LIBS@ @SYSFS_LIBS@"

         if test -z "$echo_static"; then
            libs="$libs @DYNLIB@"
diff -uNr DirectFB-0.9.25.1/directfb.pc.in DirectFB-0.9.25.1-sysfs/directfb.pc.in
--- DirectFB-0.9.25.1/directfb.pc.in    2005-10-18 17:14:04.000000000 -0600
+++ DirectFB-0.9.25.1-sysfs/directfb.pc.in      2007-11-27 21:44:04.000000000 -0700
@@ -7,5 +7,5 @@
 Description: Graphics and windowing library for the Linux frame buffer device
 Version: @VERSION@
 Requires: fusion direct
-Libs: -L${libdir} -ldirectfb @THREADLIB@ @DYNLIB@ @ZLIB_LIBS@ @OSX_LIBS@
+Libs: -L${libdir} -ldirectfb @THREADLIB@ @DYNLIB@ @ZLIB_LIBS@ @SYSFS_LIBS@ @OSX_LIBS@
 Cflags: @THREADFLAGS@ -I@INCLUDEDIR@
Comment 1 Andrew Williams 2007-11-28 17:02:58 UTC
Created attachment 137249 [details, diff]
Patch against DirectFB-0.9.25.1
Comment 2 SpanKY gentoo-dev 2007-12-02 21:17:14 UTC
should really convert the additional libs to Libs.private

Libs: -L${libdir} -ldirectfb
Libs.private: @THREADLIB@ @DYNLIB@ @ZLIB_LIBS@ @SYSFS_LIBS@ @OSX_LIBS@
Comment 3 SpanKY gentoo-dev 2007-12-02 22:21:13 UTC
fixed in DirectFB-1.1.0 ... thanks for the report/patch !

i'll see about opening a bug report upstream about the Libs.private thing