Skip to content

Commit 920c243

Browse files
committed
Merge pull request #7 from luke-jr/x32
Fix build on x32
2 parents 50713b0 + 282ebc6 commit 920c243

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ EXTRA_DIST = nasm_lt.sh
5959
#x86_64 only
6060
if USE_ASM
6161
.asm.lo:
62-
$(LIBTOOL) --mode=compile --tag YASM $(srcdir)/nasm_lt.sh $(YASM) -f elf64 $(YAFLAGS) -I$(srcdir) -I. $< -o $@
62+
$(LIBTOOL) --mode=compile --tag YASM $(srcdir)/nasm_lt.sh $(YASM) -f $(YASM_BINFMT) $(YAFLAGS) -I$(srcdir) -I. $< -o $@
6363
endif

configure.ac

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,23 @@ if test x$YASM = x; then
7373
fi
7474
has_64bit_asm=no
7575
else
76-
has_64bit_asm=yes
76+
case x"$host_os" in
77+
x*-gnux32)
78+
YASM_BINFMT=elfx32
79+
;;
80+
*)
81+
YASM_BINFMT=elf64
82+
;;
83+
esac
84+
if $YASM -f help | grep -q $YASM_BINFMT; then
85+
has_64bit_asm=yes
86+
else
87+
if test x"$set_field" = x"64bit_asm"; then
88+
AC_MSG_ERROR([$set_field field support explicitly requested but yasm doesn't support $YASM_BINFMT format])
89+
fi
90+
AC_MSG_WARN([yasm too old for $YASM_BINFMT format])
91+
has_64bit_asm=no
92+
fi
7793
fi
7894
])
7995

@@ -273,6 +289,7 @@ AC_SUBST(SECP_INCLUDES)
273289
AC_SUBST(SECP_LIBS)
274290
AC_SUBST(SECP_TEST_LIBS)
275291
AC_SUBST(SECP_TEST_INCLUDES)
292+
AC_SUBST(YASM_BINFMT)
276293
AM_CONDITIONAL([USE_ASM], [test x"$set_field" == x"64bit_asm"])
277294
AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" != x"no"])
278295
AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" != x"no"])

0 commit comments

Comments
 (0)