From patchwork Fri Aug 25 10:32:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: configure: Keep the old mingw pseudo-relocation behaviour for mingw32ce X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 63789 Message-Id: <20170825103206.37730-1-martin@martin.st> To: libav-devel@libav.org Date: Fri, 25 Aug 2017 13:32:06 +0300 From: =?utf-8?q?Martin_Storsj=C3=B6?= List-Id: libav development Using proper dllexport/dllimport seems to fail with the mingw32ce compiler (causing internal compiler errors). This toolchain is unmaintained since quite some time so there's no point in hoping for fixes. --- This is to be squashed into patch 4/5. Alternatively, we could just drop mingw32ce from fate and get rid of the extra mingw32ce references in the code (surprisingly few though). --- configure | 13 +++++++++---- libavcodec/internal.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 6f7af32bab..a644e7f52c 100755 --- a/configure +++ b/configure @@ -4032,7 +4032,7 @@ case $target_os in elif enabled arm; then LIBTARGET=arm-wince fi - if enabled shared; then + if enabled shared && test $target_os = "mingw32ce"; then # Cannot build both shared and static libs when using dllexport. disable static fi @@ -4043,13 +4043,18 @@ case $target_os in SLIBSUF=".dll" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' - SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' - SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' - SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)' + if test $target_os = "mingw32ce"; then + SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' + SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' + else + SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' + SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' + SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)' + fi enabled x86_64 && objformat="win64" || objformat="win32" dlltool="${cross_prefix}dlltool" ranlib=: diff --git a/libavcodec/internal.h b/libavcodec/internal.h index da1b2fa7d1..268c745940 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -285,7 +285,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame); */ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); -#if defined(_WIN32) && CONFIG_SHARED +#if defined(_WIN32) && CONFIG_SHARED && !defined(__MINGW32CE__) #ifdef BUILDING_avcodec # define av_export_avcodec __declspec(dllexport) #else