From d8e6f2a2bc81510ef9d8f25b79023397bdaa1277 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 1 Jan 2023 15:51:52 +0000 Subject: [PATCH] use qemu user-mode to run cross-compiled xchacha20 --- crypto/chacha20/Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/crypto/chacha20/Makefile b/crypto/chacha20/Makefile index fb64bfa5..deb5f4b9 100644 --- a/crypto/chacha20/Makefile +++ b/crypto/chacha20/Makefile @@ -1,12 +1,16 @@ # A simple Makefile, to build run: make all TARGET = test -CC = gcc +CROSS ?= powerpc64le-linux-gnu- +AS = $(CROSS)as +CC = $(CROSS)gcc +LD = $(CROSS)ld + #compiler flags here -CFLAGS = -O3 -Wall -Wextra +CFLAGS = -O3 -Wall -Wextra -static -mno-vsx -mno-altivec #linker flags here -LFLAGS = -Wall +LDFLAGS = -Wall -static SRCDIR = src @@ -18,13 +22,13 @@ OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(SRCDIR)/%.o) all: ${TARGET} $(TARGET): $(OBJECTS) - @$(CC) -o $@ $(LFLAGS) $(OBJECTS) + $(CC) -o $@ $(LDFLAGS) $(OBJECTS) $(OBJECTS): $(SRCDIR)/%.o : $(SRCDIR)/%.c - @$(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ clean: - @$ rm -f $(OBJECTS) + $ rm -f $(OBJECTS) remove: clean - @$ rm -f $(TARGET) + $ rm -f $(TARGET) -- 2.30.2