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