Commit 4b32fd0d authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Use position-independent code in assembly glue when building .so.

Include if1632/ and graphics/win16drv/ into WineLib. Move miscemu/emulate.c into dlls/win87em/.
parent 5c92ff21
......@@ -103,10 +103,10 @@ OBJS = $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o)
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
.spec.spec.c:
$(BUILD) -o $@ -spec $<
$(BUILD) @BUILDFLAGS@ -o $@ -spec $<
.c.glue.s:
$(BUILD) -o $@ -glue $<
$(BUILD) @BUILDFLAGS@ -o $@ -glue $<
# Rule to rebuild the resource compiler
......
......@@ -42,6 +42,7 @@ LIBSUBDIRS = \
dlls/tapi32 \
dlls/ver \
dlls/version \
dlls/win87em \
dlls/winaspi \
dlls/winspool \
dlls/wnaspi32 \
......@@ -51,6 +52,8 @@ LIBSUBDIRS = \
graphics/metafiledrv \
graphics/psdrv \
graphics/ttydrv \
graphics/win16drv \
if1632 \
library \
loader \
loader/ne \
......@@ -76,8 +79,6 @@ X11SUBDIRS = \
EMUSUBDIRS = \
debugger \
graphics/win16drv \
if1632 \
miscemu
PROGSUBDIRS = libtest programs
......@@ -117,6 +118,7 @@ LIBOBJS = \
dlls/tapi32/tapi32.o \
dlls/ver/ver.o \
dlls/version/version.o \
dlls/win87em/win87em.o \
dlls/winaspi/winaspi.o \
dlls/winspool/winspool.o \
dlls/wnaspi32/wnaspi32.o \
......@@ -126,6 +128,8 @@ LIBOBJS = \
graphics/metafiledrv/metafiledrv.o \
graphics/psdrv/psdrv.o \
graphics/ttydrv/ttydrv.o \
graphics/win16drv/win16drv.o \
if1632/if1632.o \
loader/loader.o \
loader/ne/ne.o \
loader/dos/dos.o \
......@@ -150,8 +154,6 @@ X11OBJS = \
EMUOBJS = \
debugger/debugger.o \
graphics/win16drv/win16drv.o \
if1632/if1632.o \
miscemu/miscemu.o
LIB_TARGET = @LIB_TARGET@
......
......@@ -320,6 +320,7 @@ fi
dnl **** Check for working dll ****
DLLFLAGS=""
BUILDFLAGS=""
LDSHARED=""
if test "$LIB_TARGET" = "libwine.so.1.0"
then
......@@ -332,6 +333,7 @@ then
])
if test "$ac_cv_c_dll_linux" = "yes"
then
BUILDFLAGS="-pic"
DLLFLAGS="-fPIC"
LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so"
else
......@@ -344,6 +346,7 @@ then
])
if test "$ac_cv_c_dll_netbsd" = "yes"
then
BUILDFLAGS="-pic"
DLLFLAGS="-fPIC"
LDSHARED="ld -Bshareable -Bforcearchive"
fi
......@@ -353,6 +356,7 @@ then
LIB_TARGET="libwine.a"
fi
fi
AC_SUBST(BUILDFLAGS)
AC_SUBST(DLLFLAGS)
AC_SUBST(LDSHARED)
......@@ -766,6 +770,7 @@ dlls/shell32/Makefile
dlls/tapi32/Makefile
dlls/ver/Makefile
dlls/version/Makefile
dlls/win87em/Makefile
dlls/winaspi/Makefile
dlls/winspool/Makefile
dlls/wnaspi32/Makefile
......
......@@ -12,6 +12,7 @@ SUBDIRS = \
tapi32 \
ver \
version \
win87em \
winaspi \
wnaspi32
......
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = win87em
C_SRCS = \
emulate.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
......@@ -68,8 +68,10 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context )
/* I don't know much about asm() programming. This could be
* wrong.
*/
#ifdef __i386__
__asm__ __volatile__("frndint");
__asm__ __volatile__("fist %0;wait" : "=m" (dw) : : "memory");
#endif
TRACE("On top of stack is %ld\n",dw);
}
break;
......
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
......
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
......@@ -67,6 +67,6 @@ all: $(MODULE).o
@MAKE_RULES@
call16.s: $(BUILD)
$(BUILD) -o $@ -call16
$(BUILD) @BUILDFLAGS@ -o $@ -call16
### Dependencies:
......@@ -42,8 +42,6 @@ DECLARE_DEBUG_CHANNEL(io)
(IS_SELECTOR_SYSTEM(SS_sig(context)) ? (void *)ESP_sig(context) : \
(PTR_SEG_OFF_TO_LIN(SS_sig(context),STACK_sig(context)))))
/* For invalid registers fixup */
int (*INSTR_IsRelay)( const void *addr ) = NULL;
/***********************************************************************
* INSTR_ReplaceSelector
......@@ -58,8 +56,11 @@ int (*INSTR_IsRelay)( const void *addr ) = NULL;
*/
static BOOL INSTR_ReplaceSelector( SIGCONTEXT *context, WORD *sel )
{
extern char Call16_Start, Call16_End;
if (IS_SELECTOR_SYSTEM(CS_sig(context)))
if (INSTR_IsRelay && INSTR_IsRelay( (void *)EIP_sig(context) ))
if ( (char *)EIP_sig(context) >= &Call16_Start
&& (char *)EIP_sig(context) < &Call16_End )
{
/* Saved selector may have become invalid when the relay code */
/* tries to restore it. We simply clear it. */
......
......@@ -6,7 +6,6 @@ VPATH = @srcdir@
MODULE = miscemu
C_SRCS = \
emulate.c \
main.c
all: $(MODULE).o
......
......@@ -23,13 +23,6 @@
static int MAIN_argc;
static char **MAIN_argv;
extern int (*INSTR_IsRelay)( const void *addr );
static int is_relay_addr( const void *addr )
{
extern char Call16_Start, Call16_End;
return ((char *)addr >= &Call16_Start) && ((char *)addr < &Call16_End);
}
/***********************************************************************
* Emulator initialisation
......@@ -149,7 +142,6 @@ int main( int argc, char *argv[] )
MAIN_argc = argc; MAIN_argv = argv;
/* Set up debugger hook */
INSTR_IsRelay = is_relay_addr;
EXC_SetDebugEventHook( wine_debugger );
if (Options.debug)
......
......@@ -64,6 +64,6 @@ all: $(MODULE).o
@MAKE_RULES@
call32.s: $(BUILD)
$(BUILD) -o $@ -call32
$(BUILD) @BUILDFLAGS@ -o $@ -call32
### Dependencies:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment