[AD] vbeafex.c and gcc 4 patch |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
A reminder of the problem with _int_ds in vbeafex.c and gcc 4. Since we
don't have a proper fix, the attached patch should be applied for beta 4.
http://www.allegro.cc/forums/view_thread.php?_id=490467
http://www.allegro.cc/forums/view_thread.php?_id=495515
Peter
Index: src/misc/vbeafex.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/misc/vbeafex.c,v
retrieving revision 1.5
diff -u -r1.5 vbeafex.c
--- src/misc/vbeafex.c 4 Jul 2004 13:44:49 -0000 1.5
+++ src/misc/vbeafex.c 5 Jun 2005 23:07:32 -0000
@@ -680,8 +680,11 @@
-/* temporary global for storing the data selector */
-static int int_ds;
+/* temporary global for storing the data selector
+ * FIXME: this is supposed to be static but that doesn't work with the
+ * following asm code with gcc 4
+ */
+int __al_vbeafex_int_ds;
@@ -702,7 +705,7 @@
" movw (%%esi), %%es ; " /* load selectors */
" movw 6(%%esi), %%ax ; "
- " movw %%ax, _int_ds ; "
+ " movw %%ax, ___al_vbeafex_int_ds ; "
" movw 8(%%esi), %%fs ; "
" movw 10(%%esi), %%gs ; "
@@ -713,13 +716,13 @@
" movl 16(%%edi), %%esi ; "
" movl 20(%%edi), %%edi ; "
- " movw _int_ds, %%ds ; " /* load %ds selector */
+ " movw ___al_vbeafex_int_ds, %%ds ; " /* load %ds selector */
" clc ; " /* generate the interrupt */
" popl %%ebp ; "
" call *%%ebp ; "
- " movw %%ds, %%ss:_int_ds ; " /* store returned %ds value */
+ " movw %%ds, %%ss:___al_vbeafex_int_ds ; " /* store returned %ds value */
" popw %%ds ; " /* restore original %ds */
" movl %%edi, %%ebp ; " /* store %edi */
@@ -740,7 +743,7 @@
" popl %%esi ; " /* pop sregs pointer into %esi */
" movw %%es, (%%esi) ; " /* store output selectors */
- " movw _int_ds, %%ax ; "
+ " movw ___al_vbeafex_int_ds, %%ax ; "
" movw %%ax, 6(%%esi) ; "
" movw %%fs, 8(%%esi) ; "
" movw %%gs, 10(%%esi) ; "