From: Luke Kenneth Casson Leighton Date: Sun, 1 Jan 2023 15:51:52 +0000 (+0000) Subject: use qemu user-mode to run cross-compiled xchacha20 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55efda526a634379300df32099066820f02a0561;p=openpower-isa.git use qemu user-mode to run cross-compiled xchacha20 --- 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)