[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Compiling XFree86 4.2.x--sig11



I just tried compiling XFree86 4.2.x on Alpha with fairly bad 
luck--more or less a segfault, see below:

--------
(WW) Open APM failed (/dev/apm_bios) (No such file or directory)
(II) Module ABI versions:
        XFree86 ANSI C Emulation: 0.1
        XFree86 Video Driver: 0.5
        XFree86 XInput driver : 0.3
        XFree86 Server Extension : 0.1
        XFree86 Font Renderer : 0.3
(II) Loader running on linux
(II) LoadModule: "bitmap"
(II) Loading /usr/X11R6/lib/modules/fonts/libbitmap.a
(II) Module bitmap: vendor="The XFree86 Project"
        compiled for 4.2.0, module version = 1.0.0
        Module class: XFree86 Font Renderer
        ABI class: XFree86 Font Renderer, version 0.3

Fatal server error:
Caught signal 11.  Server aborting


When reporting a problem related to a server crash, please send
the full server output, not just the last messages.
This can be found in the log file "/var/log/XFree86.0.log".
Please report problems to xfree86@xfree86.org.
--------

The above is stock 4.2.0, with a patch applied from Thorsten 
Kranzkowski for gcc-3.x compatibility in the XFree86 module 
loader.  I've also tried 4.2.1 with similar results.  Since the 
posting relating to this patch is apparently no longer in google 
(it was yesterday...), I've attached a text copy of it below.  
FYI, I'm using gcc-3.2.

Without the patch, XFree86 compiles on alpha but cannot load any 
modules (thanks to the R_ALPHA_GPREL{HIGH,LOW} relocation types 
being added somewhere around gcc-3.1).  With the patch, it seems 
XFree86 crashes when trying to load the first module...

I have a few ideas on how to get around this, but I figured I'd 
run them by some people on the list rather than spend another 
3-4 hours building XFree86 for each wild goose-chase I go off 
on:

1) A lot of this module loading trouble appears to spring from 
XFree86 using a misbegotten module loader that monkeys around 
with ELF format directly.  If I compile it to load modules the 
proper, portable way (via the dlopen API), will it solve this 
problem for good?  How well supported is this?

2) Do I need to manually specify compilation with -fPIC (via the 
DefaultGcc2AxpOpts definition?)  It occurs to me that the 
XFree86 build isn't smart enough to figure out how to 
selectively apply this flag on its own.  Then again, considering 
XFree86's jacked module loader, neither am I.

-- 
Kelledin
"If a server crashes in a server farm and no one pings it, does 
it still cost four figures to fix?"
FROM: Thorsten Kranzkowski
DATE: 02/09/2002 08:09:18
SUBJECT:  [PATCH] XFree86 4.2 and gcc 3.1

 


Hi!
When building XFree86 4.2 with gcc 3.1 (20020207) i get this runtime error:

<---snip--->
XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
        If the server is older than 6-12 months, or if your card is
        newer than the above date, look for a newer version before
        reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.18-pre7 alpha [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Sat Feb  9 00:59:35 2002
(==) Using config file: "/etc/X11/XF86Config"
Elf_RelocateEntry() Unsupported relocation type 18
Elf_RelocateEntry() Unsupported relocation type 17
Elf_RelocateEntry() Unsupported relocation type 18
[ .... lots of these .... ]
Elf_RelocateEntry() Unsupported relocation type 17
Elf_RelocateEntry() Unsupported relocation type 18
Elf_RelocateEntry() Unsupported relocation type 17

Fatal server error:
Caught signal 11.  Server aborting
<---snip--->

After some investigation I made the following patch:


diff -ur xc-orig/programs/Xserver/hw/xfree86/loader/elfloader.c xc/programs/Xserver/hw/xfree86/loader/elfloader.c
--- xc-orig/programs/Xserver/hw/xfree86/loader/elfloader.c      Mon Jan 14 18:16:52 2002
+++ xc/programs/Xserver/hw/xfree86/loader/elfloader.c   Sat Feb  9 01:26:37 2002
@@ -1113,6 +1113,7 @@
 #if defined(__alpha__)
     unsigned int *dest32h;     /* address of the high 32 bit place being modified */
     unsigned long *dest64;
+    unsigned short *dest16;
 #endif
 #if defined(__ia64__)
     unsigned long *dest64;
@@ -1233,6 +1234,34 @@
 #ifdef ELFDEBUG
            ELFDEBUG( "*dest32=%x\n", *dest32 );
 #endif
+           break;
+           }
+       case R_ALPHA_GPRELLOW:
+           {
+           dest64=(unsigned long *)(secp+rel->r_offset);
+           dest16=(unsigned short *)dest64;
+
+           symval += rel->r_addend;
+           symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+
+           *dest16=symval;
+           break;
+           }
+       case R_ALPHA_GPRELHIGH:
+           {
+           dest64=(unsigned long *)(secp+rel->r_offset);
+           dest16=(unsigned short *)dest64;
+
+           symval += rel->r_addend;
+           symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+           symval = ((long)symval > 16) + ((symval > 15) & 1);
+           if( (long)symval > 0x7fff ||
+               (long)symval < -(long)0x8000 ) {
+               FatalError("R_ALPHA_GPRELHIGH symval-got is too large for %s:%lx\n",
+                       ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)),symval);
+           }
+
+           *dest16=symval;
            break;
            }
        case R_ALPHA_LITERAL:


Now I can start X and it passed a first cursory test (GeForce2 MX PCI on
a Compaq DS20)

I'd like to have a comment whether this is the right fix before I send this
in to the xfree folks.

Thanks,
Thorsten

-- 
| Thorsten Kranzkowski        Internet: <EMAIL: PROTECTED>                      |
| Mobile: ++49 170 1876134       Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, <EMAIL: PROTECTED> [44.130.8.19] |



_______________________________________________
Axp-list mailing list
<EMAIL: PROTECTED>
https://listman.redhat.com/mailman/listinfo/axp-list

Reply to: