Build dump_constants as a static binary

This change makes dump_constants a static binary. This should have no
effect on the size of the final image since it will only be used at
build time to generate constants.json.

Bug: None
Test: make check
Test: make constants.json
Change-Id: Iff1f6b7f9dcc43fac075c534ac008bed428fe0e8
diff --git a/Makefile b/Makefile
index 07336f2..a7c4357 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@
 parse_seccomp_policy: CXX_BINARY(parse_seccomp_policy)
-dump_constants: CXX_BINARY(dump_constants)
+dump_constants: CXX_STATIC_BINARY(dump_constants)
 tests: TEST(CXX_BINARY(libminijail_unittest)) \
 	TEST(CXX_BINARY(minijail0_cli_unittest)) \
@@ -147,12 +147,14 @@
 clean: CLEAN(parse_seccomp_policy)
-CXX_BINARY(dump_constants): dump_constants.o \
+# Compiling dump_constants as a static executable makes it easy to run under
+# qemu-user, which in turn simplifies cross-compiling bpf policies.
+CXX_STATIC_BINARY(dump_constants): dump_constants.o \
 		libconstants.gen.o libsyscalls.gen.o
 clean: CLEAN(dump_constants)
-constants.json: CXX_BINARY(dump_constants)
+constants.json: CXX_STATIC_BINARY(dump_constants)
 	./dump_constants > $@
 clean: CLEANFILE(constants.json)