Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 548906 - x11-drivers/xf86-video-mga - fails to load: undefined symbol: xf86WriteMmio16
Summary: x11-drivers/xf86-video-mga - fails to load: undefined symbol: xf86...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Alpha Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
Keywords: PATCH
Depends on:
Reported: 2015-05-08 12:17 UTC by Christopher May-Townsend
Modified: 2018-06-11 02:50 UTC (History)
1 user (show)

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

patch (0001-xfree86-Inline-xf86-Read-Write-Mmio-8-16-32-on-alpha.patch,7.79 KB, patch)
2018-05-23 04:58 UTC, Matt Turner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher May-Townsend 2015-05-08 12:17:27 UTC
With x11-server- 1.17.1-r1, I'm unable to load the mga_drv driver due the aforementioned issue.

I get the same problem with the vesa drivers as well. 

[104357.196] (II) LoadModule: "mga"
[104357.197] (II) Loading /usr/lib/xorg/modules/drivers/
[104357.230] (EE) Failed to load /usr/lib/xorg/modules/drivers/ /usr/lib/xorg/modules/drivers/ undefined symbol: xf86WriteMmio16
[104357.230] (II) UnloadModule: "mga"
[104357.230] (II) Unloading mga

Portage 2.2.18 (python 2.7.9-final-0, default/linux/alpha/13.0/desktop, gcc-4.8.4, glibc-2.19-r1, 4.0.0-gentoo alpha)
System uname: Linux-4.0.0-gentoo-alpha-PCA56-with-gentoo-2.2
KiB Mem:      120256 total,     17648 free
KiB Swap:    1060280 total,   1054136 free
Timestamp of repository gentoo: Thu, 07 May 2015 07:00:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.24 p1.4) 2.24
distcc 3.1 alpha-unknown-linux-gnu [disabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.3_p33-r2::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r1::gentoo, 3.3.5-r1::gentoo
dev-util/ccache:          3.1.9-r4::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.11::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.13.4::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.7.3-r1::gentoo, 4.8.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.19-r1::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

CFLAGS="-mieee -pipe -O2 -mcpu=pca56"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-mieee -pipe -O2 -mcpu=pca56"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac acl acpi alpha alsa berkdb bindist branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr encode exif fam firefox flac fortran gdbm gif glamor gpm gtk gudev iconv ipv6 jpeg lcms libnotify lock mad mng modules mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support readline sdl session spell ssl startup-notification svg tcpd thunar tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ALSA_CARDS="ali5451 als4000 bt87x ca0106 cmipci emu10k1 ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 maestro3 trident usb-audio via82xx ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 1 Christopher May-Townsend 2015-05-08 12:18:54 UTC
Calculating dependencies  ..... .... done!
[ebuild   R   ~] x11-base/xorg-server-1.17.1-r1:0/1.17.1::gentoo  USE="glamor ipv6 nptl suid udev xorg -dmx -doc -kdrive -minimal (-selinux) -static-libs -systemd -tslib (-unwind) (-wayland) -xephyr -xnest -xvfb" 0 KiB
[ebuild   R   ~] x11-drivers/xf86-video-mga-1.6.4::gentoo  USE="dri" 0 KiB
Comment 2 Matt Turner gentoo-dev 2018-05-10 02:30:39 UTC
I can confirm the bug.
Comment 3 Matt Turner gentoo-dev 2018-05-11 06:13:25 UTC
The commit that broke this is

   commit 9db2af6f757ef9680c70eb731698b7c9f9aca203
   Author: Adam Jackson <>
   Date:   Fri May 2 12:14:10 2014 -0400

       xfree86: Remove xf86{Map,Unmap}VidMem

which is indeed first in xserver 1.17.

I understand the breakage and have a simple fix. There's a better fix that involves deleting some code. When I return from vacation I'll do that and upstream it. It'll probably be in one of the 1.20.x stable releases.
Comment 4 Matt Turner gentoo-dev 2018-05-11 06:14:30 UTC
Oh, just in case you're still waiting with baited breath for a fix after almost exactly three years, here's the simple fix:

diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index c09d71947..258c92e73 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -38,12 +38,11 @@
 #include "xf86Priv.h"
 #include "xf86_OSlib.h"
 #include "xf86OSpriv.h"
+#include "compiler.h"

 static Bool ExtendedEnabled = FALSE;

 #ifdef __ia64__
-#include "compiler.h"
 #include <sys/io.h>

 #elif !defined(__powerpc__) && \
Comment 5 Christopher May-Townsend 2018-05-11 13:13:32 UTC
Wouldn't say baited breath but I have been hoping someone would look into this! (for the life of me I can't get another OS working properly on this box). 

So I'll give this a go over the weekend, and I look forward to raising other issues I come against!

Thanks again!
Comment 6 Matt Turner gentoo-dev 2018-05-23 04:58:14 UTC
Created attachment 532658 [details, diff]

Please give this a try. It's what I plan to send to the mailing list for review if it fixes the problem for you. You will have to rebuild xf86-video-mga against the new Xserver, FWIW.
Comment 7 Christopher May-Townsend 2018-05-26 21:05:18 UTC
Evening, just wanted to confirm that I have the alpha out and running again. It's almost 3yrs out of date (which feels like a 100 in Gentoo years). So I'm busy getting the system into a "safe" state. Luckily I have a crossdev node up and running as of 5mins ago to help. 

Once done, I'll test this, just wanted to confirm that I am getting there! 

Cheers again!
Comment 8 Christopher May-Townsend 2018-06-06 21:36:48 UTC
Evening, so finally at the point I can try this (thanks to a drive with bad sectors) anyways, I've tried to put the above patch file in "/etc/portage/patches/x11-base/xorg-server/" and it flat out doesn't work. 

In "/var/tmp/portage/x11-base/xorg-server-1.19.5-r2/work/xorg-server-1.19.5" I can run;

"patch -p1 -g0 -E --no-backup-if-mismatch  --dry-run -f < '/etc/portage/patches//x11-base/xorg-server/0001-xfree86-Inline-xf86-Read-Write-Mmio-8-16-32-on-alpha.patch'"

and it mostly works, but not completely, is this patch for a very specific version of xorg-server? 

checking file
Hunk #1 succeeded at 1964 (offset 56 lines).
Hunk #2 succeeded at 2129 (offset 57 lines).
checking file hw/xfree86/common/compiler.h
checking file hw/xfree86/os-support/bsd/
checking file hw/xfree86/os-support/linux/
Hunk #1 succeeded at 1 with fuzz 2.
Hunk #2 succeeded at 28 (offset -3 lines).
checking file hw/xfree86/os-support/linux/lnx_video.c
can't find file to patch at input line 216
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|diff --git a/hw/xfree86/os-support/ b/hw/xfree86/os-support/
|index 901422786..b6e5c975d 100644
|--- a/hw/xfree86/os-support/
|+++ b/hw/xfree86/os-support/
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Comment 9 Christopher May-Townsend 2018-06-06 21:50:24 UTC
ignore me - I just realised you would have this against 1.20, so doing that now. Will have results "later"!
Comment 10 Christopher May-Townsend 2018-06-07 07:35:58 UTC
congratulations - 

[ 87315.353] (II) MGA(0): MAPPED Framebuffer 09000000 400000 to 20001332000.
[ 87315.354] (II) MGA(0): vgaHWGetIOBase: hwp->IOBase is 0x03d0
[ 87315.370] (--) MGA(0): 32 DWORD fifo
[ 87315.390] (==) MGA(0): Default visual is TrueColor
[ 87315.390] (EE) MGA(0): Static buffer allocation failed, not initializing the DRI
[ 87315.390] (EE) MGA(0): Need at least 10800 kB video memory at this resolution, bit depth
[ 87315.417] (II) MGA(0): Using 99 lines for offscreen memory.
[ 87315.417] (==) MGA(0): Backing store enabled
[ 87315.417] (==) MGA(0): Silken mouse enabled
[ 87315.433] (==) MGA(0): DPMS enabled
[ 87315.433] (WW) MGA(0): Direct rendering disabled

X loaded first time. First time I've managed to get it working on Alpha. So that's loads for this!
Comment 11 Matt Turner gentoo-dev 2018-06-07 16:29:06 UTC
Excellent! Thank you. I will send the patch upstream.
Comment 12 Larry the Git Cow gentoo-dev 2018-06-11 02:48:18 UTC
The bug has been closed via the following commit(s):

commit 2b48a745f377d884219c60a6169a1aee94b59975
Author:     Matt Turner <>
AuthorDate: 2018-06-11 02:45:35 +0000
Commit:     Matt Turner <>
CommitDate: 2018-06-11 02:48:01 +0000

    x11-base/xorg-server: Apply patch to fix module loading on alpha

 ...ine-xf86-Read-Write-Mmio-8-16-32-on-alpha.patch | 224 +++++++++++++++++++++
 x11-base/xorg-server/xorg-server-1.20.0.ebuild     |   2 +
 2 files changed, 226 insertions(+)
Comment 13 Matt Turner gentoo-dev 2018-06-11 02:50:45 UTC
The patch is just waiting to be pushed upstream at this point. Since I don't know when 1.20.1 will be released I've added it to our 1.20.0 ebuild.

Thanks a bunch for the report and the testing (and the patience!)