diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 3145f47cc..9a25e8754 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -424,7 +424,7 @@ endif $(EBACKTRACEDLL): platform/Windows/src/backtrace.c $(COMPILE_STATUS) - if $(CC) $(OURCONLYFLAGS) -O2 -shared -Wall -Wextra -I$(EINC) -o $@ $^ -lbfd -liberty -limagehlp; then $(COMPILE_OK); else $(COMPILE_FAILED); fi + if $(CC) $(OURCONLYFLAGS) -O2 -shared -Wall -Wextra -static-libgcc -I$(EINC) -o $@ $^ -lbfd -liberty -limagehlp; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/%.nasm $(COMPILE_STATUS) diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 47de546fc..c16817a45 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -434,6 +434,7 @@ endif ifeq ($(PLATFORM),WINDOWS) BASELIBDIRS+= -L$(abspath $(MAKEFILE_COMMON_DIR)/platform/Windows/lib$(WINLIB)) BASECOMMONFLAGS+= -I$(abspath $(MAKEFILE_COMMON_DIR)/platform/Windows/include) + BASELDFLAGS+= -static-libgcc endif ifeq ($(PLATFORM),DARWIN) # include port and brew diff --git a/polymer/eduke32/platform/Windows/src/backtrace.c b/polymer/eduke32/platform/Windows/src/backtrace.c index bbe747da3..38e37acc3 100644 --- a/polymer/eduke32/platform/Windows/src/backtrace.c +++ b/polymer/eduke32/platform/Windows/src/backtrace.c @@ -419,7 +419,7 @@ backtrace_unregister(void) } BOOL WINAPI -DllMain(HANDLE hinstDLL ATTRIBUTE((unused)), DWORD dwReason, LPVOID lpvReserved ATTRIBUTE((unused))) +DllMain(HINSTANCE hinstDLL ATTRIBUTE((unused)), DWORD dwReason, LPVOID lpvReserved ATTRIBUTE((unused))) { switch (dwReason) { case DLL_PROCESS_ATTACH: @@ -440,6 +440,7 @@ char *libintl_dgettext (const char *domain_name ATTRIBUTE((unused)), const char return buf; } +int __printf__ ( const char * format, ... ); int libintl_fprintf ( FILE * stream, const char * format, ... ); int libintl_sprintf ( char * str, const char * format, ... ); int libintl_snprintf ( char *buffer, int buf_size, const char *format, ... ); @@ -447,6 +448,16 @@ int libintl_vprintf ( const char * format, va_list arg ); int libintl_vfprintf ( FILE * stream, const char * format, va_list arg ); int libintl_vsprintf ( char * str, const char * format, va_list arg ); +int __printf__ ( const char * format, ... ) +{ + int value; + va_list arg; + va_start(arg, format); + value = vprintf ( format, arg ); + va_end(arg); + return value; +} + int libintl_fprintf ( FILE * stream, const char * format, ... ) { int value; @@ -486,3 +497,30 @@ int libintl_vsprintf ( char * str, const char * format, va_list arg ) { return vsprintf ( str, format, arg ); } + +/* cut dependence on zlib... libbfd needs this */ + +int compress (unsigned char *dest ATTRIBUTE((unused)), unsigned long destLen ATTRIBUTE((unused)), const unsigned char source ATTRIBUTE((unused)), unsigned long sourceLen ATTRIBUTE((unused))) +{ + return 0; +} +unsigned long compressBound (unsigned long sourceLen) +{ + return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13; +} +int inflateEnd(void *strm ATTRIBUTE((unused))) +{ + return 0; +} +int inflateInit_(void *strm ATTRIBUTE((unused)), const char *version ATTRIBUTE((unused)), int stream_size ATTRIBUTE((unused))) +{ + return 0; +} +int inflateReset(void *strm ATTRIBUTE((unused))) +{ + return 0; +} +int inflate(void *strm ATTRIBUTE((unused)), int flush ATTRIBUTE((unused))) +{ + return 0; +}