From d44935cbf4e42e842c11b1eeeaa28377dc8fd6d2 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 1 Mar 2017 18:42:21 +0000 Subject: build: Explicitly set 32-bit/64-bit object formats for nasm/yasm Consistently use object format names with "32" suffix and set object format to "win64" on Windows x86_64, which fixes assembling with nasm. (Cherry-picked from libav commit 808ef43597b1e3d6e69a5b9abe2237c8ddb97b44) Signed-off-by: James Almer --- configure | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 2f32f99944..e7691404b6 100755 --- a/configure +++ b/configure @@ -3254,7 +3254,6 @@ doxygen_default="doxygen" install="install" ln_s_default="ln -s -f" nm_default="nm -g" -objformat="elf" pkg_config_default=pkg-config ranlib_default="ranlib" strip_default="strip" @@ -4797,6 +4796,8 @@ esac enable $subarch enabled spic && enable_weak pic +enabled x86_64 && objformat=elf64 || objformat="elf32" + # OS specific case $target_os in aix) @@ -4867,7 +4868,7 @@ case $target_os in SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)' objformat="macho" - enabled x86_64 && objformat="macho64" + enabled x86_64 && objformat="macho64" || objformat="macho32" enabled_any pic shared x86_64 || { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } check_header dispatch/dispatch.h && @@ -4911,7 +4912,7 @@ case $target_os in SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--disable-auto-image-base' - objformat="win32" + enabled x86_64 && objformat="win64" || objformat="win32" ranlib=: enable dos_paths check_ldflags -Wl,--nxcompat,--dynamicbase @@ -4951,7 +4952,7 @@ case $target_os in SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)' - objformat="win32" + enabled x86_64 && objformat="win64" || objformat="win32" ranlib=: enable dos_paths ;; @@ -4966,7 +4967,7 @@ case $target_os in SLIB_INSTALL_LINKS= SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a' SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' - objformat="win32" + enabled x86_64 && objformat="win64" || objformat="win32" enable dos_paths enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 @@ -5377,7 +5378,8 @@ EOF EOF # llvm's integrated assembler supports .object_arch from llvm 3.5 - [ "$objformat" = elf ] && check_as <