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 | |
| 15 | genrule { |
| 16 | name: "ffi_header", |
| 17 | cmd: "$(location gen_ffi_header.sh) < $(in) > $(out)", |
| 18 | srcs: ["include/ffi.h.in"], |
| 19 | out: ["ffi_gen.h"], |
| 20 | tool_files: ["gen_ffi_header.sh"], |
| 21 | } |
| 22 | |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 23 | cc_library_static { |
| 24 | name: "libffi", |
Ivan Lozano | 60c5e00 | 2019-08-05 10:20:26 -0700 | [diff] [blame^] | 25 | host_supported: true, |
Ben Lin | c82cc18 | 2018-04-25 10:33:27 -0700 | [diff] [blame] | 26 | vendor_available: true, |
Chih-Hung Hsieh | a051dfe | 2017-10-30 10:24:17 -0700 | [diff] [blame] | 27 | cflags: [ |
| 28 | "-Wall", |
| 29 | "-Werror", |
| 30 | "-Wno-error=incompatible-pointer-types", |
| 31 | "-Wno-pointer-arith", |
| 32 | "-Wno-sign-compare", |
| 33 | "-Wno-unused-parameter", |
| 34 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 35 | local_include_dirs: ["include"], |
| 36 | generated_headers: ["ffi_header"], |
| 37 | export_generated_headers: ["ffi_header"], |
| 38 | srcs: [ |
| 39 | "src/debug.c", |
| 40 | "src/java_raw_api.c", |
| 41 | "src/prep_cif.c", |
| 42 | "src/raw_api.c", |
| 43 | "src/types.c", |
| 44 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 45 | arch: { |
| 46 | arm: { |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 47 | srcs: [ |
| 48 | "src/arm/sysv.S", |
| 49 | "src/arm/ffi.c", |
| 50 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 51 | export_include_dirs: ["linux-arm"], |
| 52 | }, |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 53 | arm64: { |
| 54 | srcs: [ |
| 55 | "src/aarch64/sysv.S", |
| 56 | "src/aarch64/ffi.c", |
| 57 | ], |
| 58 | export_include_dirs: ["linux-arm64"], |
| 59 | }, |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 60 | x86: { |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 61 | srcs: [ |
| 62 | "src/x86/ffi.c", |
| 63 | "src/x86/sysv.S", |
| 64 | "src/x86/win32.S", |
| 65 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 66 | asflags: [ |
| 67 | "-DHAVE_AS_X86_PCREL", |
| 68 | "-DHAVE_AS_ASCII_PSEUDO_OP", |
| 69 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 70 | export_include_dirs: ["linux-x86"], |
| 71 | }, |
| 72 | x86_64: { |
Garfield Tan | 872ed7e | 2017-10-17 11:13:15 -0700 | [diff] [blame] | 73 | srcs: [ |
| 74 | "src/x86/ffi64.c", |
| 75 | "src/x86/unix64.S", |
| 76 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 77 | asflags: [ |
| 78 | "-DHAVE_AS_X86_PCREL", |
| 79 | "-DHAVE_AS_ASCII_PSEUDO_OP", |
| 80 | ], |
Garfield Tan | 51060f9 | 2017-10-11 10:39:03 -0700 | [diff] [blame] | 81 | export_include_dirs: ["linux-x86_64"], |
| 82 | }, |
| 83 | }, |
| 84 | } |