Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 1 | // Copyright (C) 2017 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Bob Badour | da05a0f | 2021-02-12 19:50:01 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["external_libffi_license"], |
| 17 | } |
| 18 | |
| 19 | // Added automatically by a large-scale-change that took the approach of |
| 20 | // 'apply every license found to every target'. While this makes sure we respect |
| 21 | // every license restriction, it may not be entirely correct. |
| 22 | // |
| 23 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 24 | // |
| 25 | // Please consider splitting the single license below into multiple licenses, |
| 26 | // taking care not to lose any license_kind information, and overriding the |
| 27 | // default license using the 'licenses: [...]' property on targets as needed. |
| 28 | // |
| 29 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 30 | // to attach the license to, and including a comment whether the files may be |
| 31 | // used in the current project. |
| 32 | // |
| 33 | // large-scale-change included anything that looked like it might be a license |
| 34 | // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. |
| 35 | // |
| 36 | // Please consider removing redundant or irrelevant files from 'license_text:'. |
| 37 | // See: http://go/android-license-faq |
| 38 | license { |
| 39 | name: "external_libffi_license", |
| 40 | visibility: [":__subpackages__"], |
| 41 | license_kinds: [ |
| 42 | "SPDX-license-identifier-Apache-2.0", |
| 43 | "SPDX-license-identifier-GPL", |
| 44 | "SPDX-license-identifier-GPL-2.0", |
| 45 | "SPDX-license-identifier-GPL-3.0", |
| 46 | "SPDX-license-identifier-LGPL", |
| 47 | "SPDX-license-identifier-LGPL-2.1", |
| 48 | "SPDX-license-identifier-MIT", |
| 49 | "SPDX-license-identifier-MPL", |
| 50 | "legacy_unencumbered", |
| 51 | ], |
| 52 | license_text: [ |
| 53 | "LICENSE", |
| 54 | "LICENSE-BUILDTOOLS", |
| 55 | ], |
| 56 | } |
| 57 | |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 58 | genrule { |
| 59 | name: "ffi_header", |
| 60 | cmd: "$(location gen_ffi_header.sh) < $(in) > $(out)", |
| 61 | srcs: ["include/ffi.h.in"], |
| 62 | out: ["ffi_gen.h"], |
| 63 | tool_files: ["gen_ffi_header.sh"], |
| 64 | } |
| 65 | |
Stephen Hines | 1b454c4 | 2020-08-06 08:25:43 -0700 | [diff] [blame] | 66 | cc_library { |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 67 | name: "libffi", |
Ivan Lozano | 60c5e00 | 2019-08-05 10:20:26 -0700 | [diff] [blame] | 68 | host_supported: true, |
Ben Lin | c82cc18 | 2018-04-25 10:33:27 -0700 | [diff] [blame] | 69 | vendor_available: true, |
Chih-Hung Hsieh | a051dfe | 2017-10-30 10:24:17 -0700 | [diff] [blame] | 70 | cflags: [ |
| 71 | "-Wall", |
| 72 | "-Werror", |
Elliott Hughes | c318499 | 2020-03-26 14:21:32 -0700 | [diff] [blame] | 73 | |
Chih-Hung Hsieh | a051dfe | 2017-10-30 10:24:17 -0700 | [diff] [blame] | 74 | "-Wno-error=incompatible-pointer-types", |
Dan Willemsen | 46504e9 | 2019-10-22 17:58:27 -0700 | [diff] [blame] | 75 | "-Wno-incompatible-pointer-types", |
Elliott Hughes | c318499 | 2020-03-26 14:21:32 -0700 | [diff] [blame] | 76 | |
| 77 | "-Wno-deprecated-declarations", |
| 78 | "-Wno-missing-field-initializers", |
Dan Willemsen | 46504e9 | 2019-10-22 17:58:27 -0700 | [diff] [blame] | 79 | "-Wno-null-pointer-arithmetic", |
Chih-Hung Hsieh | a051dfe | 2017-10-30 10:24:17 -0700 | [diff] [blame] | 80 | "-Wno-pointer-arith", |
| 81 | "-Wno-sign-compare", |
| 82 | "-Wno-unused-parameter", |
Dan Willemsen | 46504e9 | 2019-10-22 17:58:27 -0700 | [diff] [blame] | 83 | "-Wno-unused-result", |
Chih-Hung Hsieh | a051dfe | 2017-10-30 10:24:17 -0700 | [diff] [blame] | 84 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 85 | local_include_dirs: ["include"], |
| 86 | generated_headers: ["ffi_header"], |
| 87 | export_generated_headers: ["ffi_header"], |
| 88 | srcs: [ |
Dan Willemsen | 46504e9 | 2019-10-22 17:58:27 -0700 | [diff] [blame] | 89 | "src/closures.c", |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 90 | "src/debug.c", |
| 91 | "src/java_raw_api.c", |
| 92 | "src/prep_cif.c", |
| 93 | "src/raw_api.c", |
| 94 | "src/types.c", |
| 95 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 96 | arch: { |
| 97 | arm: { |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 98 | srcs: [ |
| 99 | "src/arm/sysv.S", |
| 100 | "src/arm/ffi.c", |
| 101 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 102 | export_include_dirs: ["linux-arm"], |
| 103 | }, |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 104 | arm64: { |
| 105 | srcs: [ |
| 106 | "src/aarch64/sysv.S", |
| 107 | "src/aarch64/ffi.c", |
| 108 | ], |
| 109 | export_include_dirs: ["linux-arm64"], |
| 110 | }, |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 111 | x86: { |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 112 | srcs: [ |
| 113 | "src/x86/ffi.c", |
| 114 | "src/x86/sysv.S", |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 115 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 116 | asflags: [ |
| 117 | "-DHAVE_AS_X86_PCREL", |
| 118 | "-DHAVE_AS_ASCII_PSEUDO_OP", |
| 119 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 120 | export_include_dirs: ["linux-x86"], |
| 121 | }, |
| 122 | x86_64: { |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 123 | srcs: [ |
| 124 | "src/x86/ffi64.c", |
Elliott Hughes | c318499 | 2020-03-26 14:21:32 -0700 | [diff] [blame] | 125 | "src/x86/ffiw64.c", |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 126 | "src/x86/unix64.S", |
Elliott Hughes | c318499 | 2020-03-26 14:21:32 -0700 | [diff] [blame] | 127 | "src/x86/win64.S", |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 128 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 129 | asflags: [ |
| 130 | "-DHAVE_AS_X86_PCREL", |
| 131 | "-DHAVE_AS_ASCII_PSEUDO_OP", |
| 132 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 133 | export_include_dirs: ["linux-x86_64"], |
| 134 | }, |
| 135 | }, |
Jiyong Park | 7d2db95 | 2020-12-07 15:09:07 +0900 | [diff] [blame] | 136 | apex_available: [ |
| 137 | "//apex_available:platform", |
| 138 | "com.android.virt", |
| 139 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 140 | } |