unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob e87559c3fa93196dfc7b6e207cd0393136e7794a 1833 bytes (raw)
name: gnu/packages/patches/qbe-makefile-add-target.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
This patch modifies the QBE makefile to add a TARGET variable that allows us to support
cross-compiling it. We modify the case...esac in the config.h target to use this variable
instead of TARGET.
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,8 @@ OBJ      = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ) $(RV64OBJ)
 
 CFLAGS += -Wall -Wextra -std=c99 -g -pedantic
 
+TARGET = unknown
+
 $(OBJDIR)/$(BIN): $(OBJ) $(OBJDIR)/timestamp
 	@test -z "$(V)" || echo "ld $@"
 	$(V)$(CC) $(LDFLAGS) $(OBJ) -o $@
@@ -39,26 +41,21 @@ $(RV64OBJ): rv64/all.h
 $(OBJDIR)/main.o: config.h
 
 config.h:
-	@case `uname` in                               \
-	*Darwin*)                                      \
-		echo "#define Defasm Gasmacho";        \
-		echo "#define Deftgt T_amd64_sysv";    \
-		;;                                     \
-	*)                                             \
-		echo "#define Defasm Gaself";          \
-		case `uname -m` in                     \
-		*aarch64*)                             \
-			echo "#define Deftgt T_arm64"; \
-			;;                             \
-		*riscv64*)                             \
-			echo "#define Deftgt T_rv64";  \
-			;;                             \
-		*)                                     \
-			echo "#define Deftgt T_amd64_sysv";\
-			;;                             \
-		esac                                   \
-		;;                                     \
-	esac > $@
+	@echo "#define Defasm Gaself" >> $@
+	@case $(TARGET) in \
+	*x86_64*) \
+		echo "#define Deftgt T_amd64_sysv"; \
+		;; \
+	*aarch64*) \
+		echo "#define Deftgt T_arm64"; \
+		;; \
+	*riscv64*) \
+		echo "#define Deftgt T_rv64"; \
+		;; \
+	*) \
+		echo "#error target not set to x86_64, aarch64, or riscv64 in makefile"; \
+		;; \
+	esac >> $@
 
 install: $(OBJDIR)/$(BIN)
 	mkdir -p "$(DESTDIR)/$(PREFIX)/bin/"

debug log:

solving e87559c3fa ...
found e87559c3fa in https://yhetil.org/guix-patches/20220507171104.13861-1-paren@disroot.org/

applying [1/1] https://yhetil.org/guix-patches/20220507171104.13861-1-paren@disroot.org/
diff --git a/gnu/packages/patches/qbe-makefile-add-target.patch b/gnu/packages/patches/qbe-makefile-add-target.patch
new file mode 100644
index 0000000000..e87559c3fa

1:13: trailing whitespace.
 
1:15: trailing whitespace.
 
1:19: space before tab in indent.
 	@test -z "$(V)" || echo "ld $@"
1:20: space before tab in indent.
 	$(V)$(CC) $(LDFLAGS) $(OBJ) -o $@
1:23: trailing whitespace.
 
Checking patch gnu/packages/patches/qbe-makefile-add-target.patch...
Applied patch gnu/packages/patches/qbe-makefile-add-target.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

index at:
100644 e87559c3fa93196dfc7b6e207cd0393136e7794a	gnu/packages/patches/qbe-makefile-add-target.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).