Hello, Mike!
MF> when building with -fPIC and gcc-3.4.0, a few files fail to compile
Hm, and what about hermes sublibrary in SDL ? It’s also damnely broken as
for PIC/shared. I’ve wrote about this a quite time ago, but got noone
respond.
Here my mail:------------------------------------------------------------------
==========================================================================
- Newsgroup: gmane.comp.lib.sdl
- From: “Mike Gorchak” <@Mike_Gorchak>
- Date: Mon, 5 Apr 2004 08:39:29 +0300
- To: All
- Subj: Oops ! Really big problem with hermes sublibrary of SDL under QNX6
==========================================================================
Hello, All!
Got a big problem yesterday, trying to enable MMX accelerated code under
QNX6. Hermes library isn’t a valid PIC code, so it’s usage in shared library
objects can cause continuous segmentation faults in different places
(including at initialization stage). Of course it depends on OS
architecture.
For example file mmxp2_32.asm: it contains the following line:
movq mm6, qword [mmx32_rgb888_mask]
which is wrong. According to NASM manual (check this section:
http://ivs.cs.uni-magdeburg.de/bs/lehre/sose99/bs1/nasm/nasmdoc8.html#sectio
n-8.2) it must be:
…
call .get_GOT
.get_GOT: pop ebx
add ebx,GLOBAL_OFFSET_TABLE+$$-.get_GOT wrt …gotpc
…
otherwise it will fail ! QNX6 is very sensetive to this problems with PIC
code. One mistake and you’ll get SEGFAULT. Only static library works in this
case.
Maybe better to rewrite all this code via ‘asm’ includes in C modules ? Any
suggestions ?
And three days later:
Sorry, but anyone have any comments about described problems above ? Does
anyone have the similar problems ? Btw, I’ve found that ebx register was
destroyed in some of hermes’s assembly routines, which is not allowed in the
shared object modules, which also can cause many problems, while using it.
With best regards, Mike Gorchak. E-mail: @Mike_Gorchak