diff --git a/tests/run-make/issue-47551/Makefile b/tests/run-make/issue-47551/Makefile
index 5a6ac725701b3..3fe0a6e74e020 100644
--- a/tests/run-make/issue-47551/Makefile
+++ b/tests/run-make/issue-47551/Makefile
@@ -4,6 +4,7 @@
 include ../tools.mk
 
 all:
-	$(RUSTC) eh_frame-terminator.rs
+	# --target $(TARGET) ensures the right gcc flags are used for cross compilation
+	$(RUSTC) --target $(TARGET) eh_frame-terminator.rs
 	$(call RUN,eh_frame-terminator) | $(CGREP) '1122334455667788'
 	objdump --dwarf=frames $(TMPDIR)/eh_frame-terminator | $(CGREP) 'ZERO terminator'