Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256472 - x11-base/xorg-server-1.3.0.0-r6: VGA driver makes an undefined symbol xf1bppDoBitbltCopy fatal error for 1 bit and 4 bits color depth
Summary: x11-base/xorg-server-1.3.0.0-r6: VGA driver makes an undefined symbol xf1bppD...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-26 23:58 UTC by André Gillibert
Modified: 2009-01-29 18:51 UTC (History)
0 users

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


Attachments
An ugly patch that seems to fix the bug but might not (due to the endtab and mask issue) (xorg-server-1.3.0.0-r6-1bpp.patch,1.10 KB, patch)
2009-01-27 00:09 UTC, André Gillibert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description André Gillibert 2009-01-26 23:58:18 UTC
With the standard "vga" driver, with -depth 1 or -depth 4 (parameter to the /usr/bin/X server), the X server fails to load the "xf1bpp" module with an error and quit.

dlopen: /usr/lib/xorg/modules//libxf1bpp.so: undefined symbol: xf1bppDoBitbltCopy

Reproducible: Always

Steps to Reproduce:
1. Create a Device section in xorg.conf with "vga" as Driver module, a Screen section using this display device, and a "VgaLayout" ServerLayout section using this screen.
2. xinit -- -layout VgaLayout -depth 1

Actual Results:  
xinit fails, with the following error message:

dlopen: /usr/lib/xorg/modules//libxf1bpp.so: undefined symbol: xf1bppDoBitbltCopy
(EE) Failed to load /usr/lib/xorg/modules//libxf1bpp.so
(EE) VGA: Failed to load module "xf1bpp" (loader failed, 7)
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found


Expected Results:  
The X server should start without error and display a bichrome desktop on the display.

It looks like /usr/lib/xorg/modules/libxf1bpp.so (as seen with objdump -t) imports some symbols (xf1bpp*) such as xf1bppDoBitbltCopy but exports them with a different name (mfb*) such as mfbDoBitbltCopy.
There seems to be some transition in naming conventions that hasn't been consistently applied to the source code, making some modules use one name, and other modules use the other name.

The relevant sources files are:
./hw/xfree86/xf1bpp/mfbmap.h
Which contains
#define mfbDoBitbltCopy  xf1bppDoBitbltCopy
#define mfbDoBitbltCopyInverted  xf1bppDoBitbltCopyInverted
...
And tons of similar #defines
This mfbmap.h isn't properly included in some files using these symbols, such as ./mfb/mfbbitblt.c ./mfb/mfbbstore.c ./mfb/mfbimage.c and a few others.
All these files #include a common "mfb.h" (./mfb/mfb.h).

Then, I added a line:
#include <../xf1bpp/mfbmap.h> /* added by me */
in ./mfb/mfb.h
(./hw/xfree86/os-support is in the include path when xorg-server is built)

There were undefined symbol errors related to two symbols remapped in mfbmap.h:
xf1bppendtab and xf1bppmask.
The relevant mfbmap.h lines are:
#define endtab  xf1bppendtab
#define mask  xf1bppmask

Commenting out these two lines + including mfbmap.h in mfb.h, makes the compilation process successful and seems to fixes the bug. X.org can be successfully started with 1 and 4 bits color depth.

I'll attach the patch. It's just a ugly hack given as a pointer to problem's direction.
Comment 1 André Gillibert 2009-01-27 00:09:05 UTC
Created attachment 179827 [details, diff]
An ugly patch that seems to fix the bug but might not (due to the endtab and mask issue)

There might be an issue due to the removal of the endtab and mask #defines, but, looking at objdump -t on libxf1bpp.so, xf1bppendtab and xf1bppmask don't appear, so, I guess it's ok, unless some third-party modules use them...
BTW, endtab and mask are global variables (in .data).

I think a proper patch should replace instances of mask and endtab with xf1bppmask and xf1bppendtab in the source code.
Comment 2 Rémi Cardona (RETIRED) gentoo-dev 2009-01-29 18:51:00 UTC
Sorry, but we won't include any more patches for 1.3. Feel free to keep it in a local overlay.

And in any case, the vga driver is now deprecated in favor of the vesa driver, and the mfb/ subdirectory has been completely removed from xorg-server in git.

Thanks for understanding.