aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Hector Chavez <lhchavez@google.com>2020-01-30 21:39:13 -0800
committerTreehugger Robot <treehugger-gerrit@google.com>2020-02-01 05:21:34 +0000
commitcf504ca8d6ab416e16c930c6eaf257a65831e1e1 (patch)
tree727d9e4a28558d983b033800191449b37cc4f368
parent4ce3ab1d0a90d9e3d5b94f6f8cbc756dc4869903 (diff)
downloadplatform_external_minijail-cf504ca8d6ab416e16c930c6eaf257a65831e1e1.tar.gz
platform_external_minijail-cf504ca8d6ab416e16c930c6eaf257a65831e1e1.tar.bz2
platform_external_minijail-cf504ca8d6ab416e16c930c6eaf257a65831e1e1.zip
Build dump_constants as a static binarylinux-v13android-r-preview-1
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
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 07336f25..a7c4357c 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@ all: CC_BINARY(minijail0) CC_LIBRARY(libminijail.so) \
CC_LIBRARY(libminijailpreload.so)
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 @@ CXX_BINARY(parse_seccomp_policy): parse_seccomp_policy.o syscall_filter.o \
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)