1// Copyright (C) 2013 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 15cc_library_static { 16 name: "libelf", 17 host_supported: true, 18 vendor_available: true, 19 20 srcs: [ 21 "elf32_checksum.c", 22 "elf32_fsize.c", 23 "elf32_getchdr.c", 24 "elf32_getehdr.c", 25 "elf32_getphdr.c", 26 "elf32_getshdr.c", 27 "elf32_newehdr.c", 28 "elf32_newphdr.c", 29 "elf32_offscn.c", 30 "elf32_updatefile.c", 31 "elf32_updatenull.c", 32 "elf32_xlatetof.c", 33 "elf32_xlatetom.c", 34 "elf64_checksum.c", 35 "elf64_fsize.c", 36 "elf64_getchdr.c", 37 "elf64_getehdr.c", 38 "elf64_getphdr.c", 39 "elf64_getshdr.c", 40 "elf64_newehdr.c", 41 "elf64_newphdr.c", 42 "elf64_offscn.c", 43 "elf64_updatefile.c", 44 "elf64_updatenull.c", 45 "elf64_xlatetof.c", 46 "elf64_xlatetom.c", 47 "elf_begin.c", 48 "elf_clone.c", 49 "elf_cntl.c", 50 "elf_compress.c", 51 "elf_end.c", 52 "elf_error.c", 53 "elf_fill.c", 54 "elf_flagdata.c", 55 "elf_flagehdr.c", 56 "elf_flagelf.c", 57 "elf_flagphdr.c", 58 "elf_flagscn.c", 59 "elf_flagshdr.c", 60 "elf_getarhdr.c", 61 "elf_getaroff.c", 62 "elf_getarsym.c", 63 "elf_getbase.c", 64 "elf_getdata.c", 65 "elf_getdata_rawchunk.c", 66 "elf_getident.c", 67 "elf_getphdrnum.c", 68 "elf_getscn.c", 69 "elf_getshdrnum.c", 70 "elf_getshdrstrndx.c", 71 "elf_gnu_hash.c", 72 "elf_hash.c", 73 "elf_kind.c", 74 "elf_memory.c", 75 "elf_ndxscn.c", 76 "elf_newdata.c", 77 "elf_newscn.c", 78 "elf_next.c", 79 "elf_nextscn.c", 80 "elf_rand.c", 81 "elf_rawdata.c", 82 "elf_rawfile.c", 83 "elf_readall.c", 84 "elf_scnshndx.c", 85 "elf_strptr.c", 86 "elf_update.c", 87 "elf_version.c", 88 "gelf_checksum.c", 89 "gelf_fsize.c", 90 "gelf_getauxv.c", 91 "gelf_getchdr.c", 92 "gelf_getclass.c", 93 "gelf_getdyn.c", 94 "gelf_getehdr.c", 95 "gelf_getlib.c", 96 "gelf_getmove.c", 97 "gelf_getnote.c", 98 "gelf_getphdr.c", 99 "gelf_getrela.c", 100 "gelf_getrel.c", 101 "gelf_getshdr.c", 102 "gelf_getsym.c", 103 "gelf_getsyminfo.c", 104 "gelf_getsymshndx.c", 105 "gelf_getverdaux.c", 106 "gelf_getverdef.c", 107 "gelf_getvernaux.c", 108 "gelf_getverneed.c", 109 "gelf_getversym.c", 110 "gelf_newehdr.c", 111 "gelf_newphdr.c", 112 "gelf_offscn.c", 113 "gelf_update_auxv.c", 114 "gelf_update_dyn.c", 115 "gelf_update_ehdr.c", 116 "gelf_update_lib.c", 117 "gelf_update_move.c", 118 "gelf_update_phdr.c", 119 "gelf_update_rela.c", 120 "gelf_update_rel.c", 121 "gelf_update_shdr.c", 122 "gelf_update_sym.c", 123 "gelf_update_syminfo.c", 124 "gelf_update_symshndx.c", 125 "gelf_update_verdaux.c", 126 "gelf_update_verdef.c", 127 "gelf_update_vernaux.c", 128 "gelf_update_verneed.c", 129 "gelf_update_versym.c", 130 "gelf_xlate.c", 131 "gelf_xlatetof.c", 132 "gelf_xlatetom.c", 133 "libelf_crc32.c", 134 "libelf_next_prime.c", 135 "nlist.c", 136 ], 137 138 cflags: [ 139 "-DHAVE_CONFIG_H", 140 "-std=gnu99", 141 "-D_GNU_SOURCE", 142 "-Werror", 143 // to suppress the "pointer of type ‘void *’ used in arithmetic" warning 144 "-Wno-pointer-arith", 145 ], 146 147 static_libs: [ 148 "libz", 149 "libelf_headers", 150 ], 151 152 export_include_dirs: ["."], 153 154 target: { 155 darwin: { 156 enabled: false, 157 }, 158 android: { 159 cflags: [ 160 "-D_FILE_OFFSET_BITS=64", 161 "-include AndroidFixup.h", 162 ], 163 }, 164 }, 165} 166