seccomp: Generate the policy files at compile time
This change avoids having to run the genseccomp.py script every time a
policy file is edited, and instead generates these files at
compile-time.
Bug: None
Test: m
Test: find out/soong/ -name x86_64_global_policy.cpp # Shows files
Test: generated policies are equivalent to original policies
Change-Id: I12461fe0c5fb02c008c1b2503fbb994b8aa2f56b
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index 2fa4e0f..01c580f 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -26,7 +26,8 @@
# Make sure the directory is deleted when the script exits.
atexit.register(shutil.rmtree, bionic_temp)
-bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc")
+bionic_libc_root = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ "..")
warning = "Generated by gensyscalls.py. Do not edit."