diff options
author | Robert Sesek <rsesek@google.com> | 2016-12-15 14:16:55 -0500 |
---|---|---|
committer | Robert Sesek <rsesek@google.com> | 2016-12-15 16:28:42 -0500 |
commit | bfa234af0282808dec2aa262fabfd9f6dd3332b0 (patch) | |
tree | 05033a07674e3a9bd48dbe59e752b7f94bc7424c | |
parent | 60aa1eedc716d2c51273a6f6b581500879292870 (diff) | |
download | seccomp-tests-bfa234af0282808dec2aa262fabfd9f6dd3332b0.tar.gz |
Create Android.mk file and a wrapper header for use by CTS.
This re-lands 60aa1eedc716d2c51273a6f6b581500879292870, but excludes compiling
the code on mips and mips64, since Seccomp is not supported on those
architectures.
In addition, several warnings are suppressed.
Test: lunch aosp_mips-eng
Test: m external_seccomp_tests
Bug: 32616302
Change-Id: Ibd95b2392c8a59bf21211c7a9f6f1cc7523bc712
-rw-r--r-- | Android.mk | 40 | ||||
-rw-r--r-- | seccomp_bpf_tests.h | 28 |
2 files changed, 68 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..317416c --- /dev/null +++ b/Android.mk @@ -0,0 +1,40 @@ +# Copyright (C) 2016 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := external_seccomp_tests + +# mips and mips64 don't support Seccomp. +LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64 + +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := linux/seccomp_bpf.c + +LOCAL_CFLAGS := -Wno-gnu-designator \ + -Wno-unused-parameter \ + -Wno-literal-conversion \ + -Wno-incompatible-pointer-types-discards-qualifiers \ + -Wno-sign-compare \ + -Wno-empty-body \ + -D__ARCH_WANT_SYSCALL_DEPRECATED # TODO(rsesek): Remove after syncing in upstream. + +LOCAL_SHARED_LIBRARIES := liblog + +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + +include $(BUILD_STATIC_LIBRARY) diff --git a/seccomp_bpf_tests.h b/seccomp_bpf_tests.h new file mode 100644 index 0000000..a46be51 --- /dev/null +++ b/seccomp_bpf_tests.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * This header provides access to the Seccomp-BPF kernel test suite, + * for use by CTS. + */ + +#include "linux/test_harness.h" + +// Forward declare from seccomp_bpf_tests.c. +extern "C" { +struct __test_metadata* get_seccomp_test_list(); +} |