[quake3-bugzilla] [Bug 6429] vm_x86.c inline assembly error on hosts using -fPIC

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Wed Jun 15 14:34:02 EDT 2016


https://bugzilla.icculus.org/show_bug.cgi?id=6429

--- Comment #7 from Mark <mark at noffle.net> ---
Sadly, no go with the most recent push. Same error in impossible constraint
violation with gcc 4.9.3.

That said, shortly before you pushed your latest commit I had modified the
assembly to pretty much what you had:

"mov %%ebx, %2\n"

and compiled the resulting code with gcc 6.1.0 which resulted in the binary
being compiled properly. In this case once the binary was compiled with all the
object files using -fPIC (including vm_x86.c) with no errors, I enabled -pie on
the linker to finalize the process. 

Once I confirmed that was working, additional hardening compiler flags were set
with gcc 6.1.0 and the binary was copied over to the hardened host which had no
issues with the binary.

Interesting that the compiler constraint error occurs with gcc 4.9.3 but is
fine with 6.1.0. a 2016-03 gcc post
(https://gcc.gnu.org/ml/gcc-help/2016-03/msg00156.html) suggests that EBX was
considered reserved on i686 when generating PIC code but was changed to no
longer be reserved as of gcc 5. I guess it's possible gcc 4 considers all usage
of ebx in inline assembly, regardless of manually saving and restoring ebx, as
violating the reservation when -fPIC is enabled?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/quake3-bugzilla/attachments/20160615/dced26e4/attachment.html>


More information about the quake3-bugzilla mailing list