From b97efe1ab7a43276f975f63a626751617651b94a Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 11 Jan 2019 04:45:19 +0000 Subject: [PATCH] Use HOST_CC, default CC, to compile findprim. This needs to run on the host system, not on the target system. This way we can cross-compile the microcode if you have a C cross-compiler handy, which makes iterating development a lot faster when the target's native C compiler is painfully slow. --- src/microcode/configure.ac | 3 +++ src/microcode/makegen/Makefile.in.in | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index ed078bc93..5c2ca51cd 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -203,6 +203,8 @@ AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +: ${HOST_CC:=${CC}} + if test x"${GCC}" = xyes; then dnl Discard flags computed by AC_PROG_CC; we'll use our own. @@ -928,6 +930,7 @@ AC_SUBST([AUXDIR_NAME]) AC_SUBST([EXE_NAME]) AC_SUBST([INSTALL_INCLUDE]) AC_SUBST([CCLD]) +AC_SUBST([HOST_CC]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/src/microcode/makegen/Makefile.in.in b/src/microcode/makegen/Makefile.in.in index 3124b5fc7..aafac46b4 100644 --- a/src/microcode/makegen/Makefile.in.in +++ b/src/microcode/makegen/Makefile.in.in @@ -69,6 +69,7 @@ EXE_NAME = @EXE_NAME@ AUXDIR = $(libdir)/$(AUXDIR_NAME) CC = @CC@ +HOST_CC = @HOST_CC@ CCLD = @CCLD@ M4 = $(srcdir)/makegen/m4.sh @M4@ AS = as @@ -172,7 +173,11 @@ usrdef.c: $(STD_SOURCES) findprim Makefile findprim: $(findprim_OBJECTS) $(findprim_DEPENDENCIES) -rm -f $@ - $(LINK) $(findprim_LDFLAGS) $(findprim_OBJECTS) $(findprim_LIBS) + $(HOST_CC) -o $@ $(findprim_LDFLAGS) $(findprim_OBJECTS) \ + $(findprim_LIBS) + +findprim.o: findprim.c config.h + $(HOST_CC) -o $@ $(findprim_CFLAGS) -c findprim.c gen-nonce: gen-nonce.o $(LINK) gen-nonce.o -- 2.25.1