1// Copyright 2017 Google Inc. All rights reserved.
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
15subdirs = [
16    "Lib",
17]
18
19cc_defaults {
20    name: "py2-interp-defaults",
21    cflags: [
22        "-fwrapv",
23        "-O3",
24        "-Wall",
25        "-Wstrict-prototypes",
26        "-DPy_BUILD_CORE",
27        "-Werror",
28        "-Wno-error=invalid-source-encoding",
29        "-Wno-error=macro-redefined",
30        "-Wno-int-conversion",
31        "-Wno-missing-field-initializers",
32        "-Wno-shift-count-overflow",
33        "-Wno-sign-compare",
34        "-Wno-tautological-compare",
35        "-Wno-tautological-constant-out-of-range-compare",
36        "-Wno-unused-parameter",
37        "-Wno-unused-result",
38    ],
39    local_include_dirs: ["Include"],
40    target: {
41        android_arm: {
42            local_include_dirs: ["android_arm/pyconfig"],
43        },
44        android_arm64: {
45            local_include_dirs: ["android_arm64/pyconfig"],
46        },
47        android_x86: {
48            local_include_dirs: ["android_x86/pyconfig"],
49        },
50        android_x86_64: {
51            local_include_dirs: ["android_x86_64/pyconfig"],
52        },
53        // Regenerate include dirs with android_regen.sh
54        darwin_x86: {
55            enabled: false,
56        },
57        darwin_x86_64: {
58            local_include_dirs: ["darwin_x86_64/pyconfig"],
59            cflags: [
60                "-Wno-deprecated-declarations",
61                "-Wno-pointer-arith",
62            ],
63        },
64        linux_glibc_x86: {
65            enabled: false,
66        },
67        linux_glibc_x86_64: {
68            local_include_dirs: ["linux_x86_64/pyconfig"],
69            cflags: ["-Werror"],
70        },
71        windows: {
72            enabled: false,
73        },
74    },
75    host_supported: true,
76    compile_multilib: "both",
77    multilib: {
78        lib32: {
79            suffix: "32",
80        },
81        lib64: {
82            suffix: "64",
83        },
84    },
85}
86
87cc_library_static {
88    name: "py2-interp-parser",
89    defaults: ["py2-interp-defaults"],
90    srcs: [
91        "Parser/acceler.c",
92        "Parser/bitset.c",
93        "Parser/firstsets.c",
94        "Parser/grammar.c",
95        "Parser/grammar1.c",
96        "Parser/listnode.c",
97        "Parser/metagrammar.c",
98        "Parser/myreadline.c",
99        "Parser/node.c",
100        "Parser/parser.c",
101        "Parser/parsetok.c",
102        "Parser/pgen.c",
103        "Parser/tokenizer.c",
104    ],
105}
106
107cc_library_static {
108    name: "py2-interp-object",
109    defaults: ["py2-interp-defaults"],
110    srcs: [
111        "Objects/abstract.c",
112        "Objects/boolobject.c",
113        "Objects/bufferobject.c",
114        "Objects/bytes_methods.c",
115        "Objects/bytearrayobject.c",
116        "Objects/capsule.c",
117        "Objects/cellobject.c",
118        "Objects/classobject.c",
119        "Objects/cobject.c",
120        "Objects/codeobject.c",
121        "Objects/complexobject.c",
122        "Objects/descrobject.c",
123        "Objects/enumobject.c",
124        "Objects/exceptions.c",
125        "Objects/genobject.c",
126        "Objects/fileobject.c",
127        "Objects/floatobject.c",
128        "Objects/frameobject.c",
129        "Objects/funcobject.c",
130        "Objects/intobject.c",
131        "Objects/iterobject.c",
132        "Objects/listobject.c",
133        "Objects/longobject.c",
134        "Objects/dictobject.c",
135        "Objects/memoryobject.c",
136        "Objects/methodobject.c",
137        "Objects/moduleobject.c",
138        "Objects/object.c",
139        "Objects/obmalloc.c",
140        "Objects/rangeobject.c",
141        "Objects/setobject.c",
142        "Objects/sliceobject.c",
143        "Objects/stringobject.c",
144        "Objects/structseq.c",
145        "Objects/tupleobject.c",
146        "Objects/typeobject.c",
147        "Objects/weakrefobject.c",
148        "Objects/unicodeobject.c",
149        "Objects/unicodectype.c",
150    ],
151}
152
153cc_library_static {
154    name: "py2-interp-python",
155    defaults: ["py2-interp-defaults"],
156    target: {
157        linux: {
158            cflags: [
159                "-DPLATFORM=\"linux2\"",
160            ],
161        },
162        darwin_x86_64: {
163            cflags: [
164                "-DPLATFORM=\"darwin\"",
165            ],
166        },
167    },
168    srcs: [
169        "Python/_warnings.c",
170        "Python/Python-ast.c",
171        "Python/asdl.c",
172        "Python/ast.c",
173        "Python/bltinmodule.c",
174        "Python/ceval.c",
175        "Python/compile.c",
176        "Python/codecs.c",
177        "Python/errors.c",
178        "Python/frozen.c",
179        "Python/frozenmain.c",
180        "Python/future.c",
181        "Python/getargs.c",
182        "Python/getcompiler.c",
183        "Python/getcopyright.c",
184        "Python/getplatform.c",
185        "Python/getversion.c",
186        "Python/graminit.c",
187        "Python/import.c",
188        "Python/importdl.c",
189        "Python/marshal.c",
190        "Python/modsupport.c",
191        "Python/mystrtoul.c",
192        "Python/mysnprintf.c",
193        "Python/peephole.c",
194        "Python/pyarena.c",
195        "Python/pyctype.c",
196        "Python/pyfpe.c",
197        "Python/pymath.c",
198        "Python/pystate.c",
199        "Python/pythonrun.c",
200        "Python/random.c",
201        "Python/structmember.c",
202        "Python/symtable.c",
203        "Python/sysmodule.c",
204        "Python/traceback.c",
205        "Python/getopt.c",
206        "Python/pystrcmp.c",
207        "Python/pystrtod.c",
208        "Python/dtoa.c",
209        "Python/formatter_unicode.c",
210        "Python/formatter_string.c",
211        "Python/dynload_shlib.c",
212        "Python/thread.c",
213    ],
214}
215
216cc_binary {
217    name: "py2-launcher",
218    defaults: ["py2-interp-defaults"],
219    cflags: [
220        "-DVERSION=\"2.7\"",
221        "-DVPATH=\"\"",
222        "-DPREFIX=\"\"",
223        "-DEXEC_PREFIX=\"\"",
224        "-DPYTHONPATH=\"\"",
225        "-DDATE=\"xx/xx/xx\"",
226        "-DTIME=\"xx:xx:xx\"",
227    ],
228    srcs: [
229        "Launcher/launcher_main.cpp",
230        "Launcher/launcher_internal.cpp",
231        "Modules/gcmodule.c",
232        "Modules/getpath.c",
233        "Modules/config.c",
234        "Modules/getbuildinfo.c",
235        // Default built-in extension py2-c-modules.
236        "Modules/threadmodule.c",
237        "Modules/signalmodule.c",
238        "Modules/posixmodule.c",
239        "Modules/errnomodule.c",
240        "Modules/pwdmodule.c",
241        "Modules/_sre.c",
242        "Modules/_codecsmodule.c",
243        "Modules/_weakref.c",
244        "Modules/zipimport.c",
245        "Modules/symtablemodule.c",
246    ],
247    local_include_dirs: [
248        "Launcher",
249    ],
250    // NOTE: Please update Modules/config.c if new lib get added in the static_libs.
251    static_libs: [
252        "libbase",
253        // Be careful the order of these three static libraries below due to
254        // missing symbols issues.
255        "py2-interp-object",
256        "py2-interp-python",
257        "py2-interp-parser",
258        "py2-c-module-array",
259        "py2-c-module-cmath",
260        "py2-c-module-math",
261        "py2-c-module-_struct",
262        "py2-c-module-time",
263        "py2-c-module-operator",
264        "py2-c-module-_testcapi",
265        "py2-c-module-_random",
266        "py2-c-module-_collections",
267        "py2-c-module-_heapq",
268        "py2-c-module-itertools",
269        "py2-c-module-strop",
270        "py2-c-module-_functools",
271        "py2-c-module-datetime",
272        "py2-c-module-_bisect",
273        "py2-c-module-unicodedata",
274        "py2-c-module-_io",
275        "py2-c-module-fcntl",
276        "py2-c-module-select",
277        "py2-c-module-mmap",
278        "py2-c-module-_csv",
279        "py2-c-module-_socket",
280        "py2-c-module-termios",
281        "py2-c-module-_md5",
282        "py2-c-module-_sha",
283        "py2-c-module-_sha256",
284        "py2-c-module-_sha512",
285        "py2-c-module-binascii",
286        "py2-c-module-parser",
287        "py2-c-module-cStringIO",
288        "py2-c-module-cPickle",
289        "py2-c-module-xxsubtype",
290        "py2-c-module-future_builtins",
291        "py2-c-module-_json",
292        "py2-c-module-_hotshot",
293        "py2-c-module-_lsprof",
294        "py2-c-module-grp",
295        "py2-c-module-syslog",
296        "py2-c-module-audioop",
297        "py2-c-module-resource",
298        "py2-c-module-_multibytecodec",
299        "py2-c-module-_codecs_kr",
300        "py2-c-module-_codecs_jp",
301        "py2-c-module-_codecs_cn",
302        "py2-c-module-_codecs_tw",
303        "py2-c-module-_codecs_hk",
304        "py2-c-module-_codecs_iso2022",
305        "py2-c-module-_multiprocessing",
306        "py2-c-module-zlib",
307        "py2-c-module-pyexpat",
308        "py2-c-module-_sqlite3",
309        "py2-c-module-_ctypes_test",
310        "py2-c-module-_ctypes",
311        "libz",
312        "libexpat",
313    ],
314    target: {
315        linux_glibc_x86_64: {
316            host_ldlibs: ["-lutil"],
317            static_libs: [
318                "libsqlite",
319            ],
320        },
321        darwin_x86_64: {
322            static_libs: [
323                "libsqlite",
324            ],
325        },
326        // Use shared libsqlite for device side, otherwise
327        // the executable size will be really huge.
328        android: {
329            shared_libs: [
330                "libsqlite",
331            ],
332        },
333    },
334}
335
336// Enabled extension py2-c-modules.
337
338cc_library_static {
339    name: "py2-c-module-array",
340    defaults: ["py2-interp-defaults"],
341    srcs: [
342        "Modules/arraymodule.c",
343    ],
344}
345
346cc_library_static {
347    name: "py2-c-module-cmath",
348    defaults: ["py2-interp-defaults"],
349    srcs: [
350        "Modules/cmathmodule.c",
351        "Modules/_math.c",
352    ],
353}
354
355cc_library_static {
356    name: "py2-c-module-math",
357    defaults: ["py2-interp-defaults"],
358    srcs: [
359        "Modules/mathmodule.c",
360        "Modules/_math.c",
361    ],
362}
363
364cc_library_static {
365    name: "py2-c-module-_struct",
366    defaults: ["py2-interp-defaults"],
367    srcs: [
368        "Modules/_struct.c",
369    ],
370}
371
372cc_library_static {
373    name: "py2-c-module-time",
374    defaults: ["py2-interp-defaults"],
375    srcs: [
376        "Modules/timemodule.c",
377    ],
378}
379
380cc_library_static {
381    name: "py2-c-module-operator",
382    defaults: ["py2-interp-defaults"],
383    srcs: [
384        "Modules/operator.c",
385    ],
386}
387
388cc_library_static {
389    name: "py2-c-module-_testcapi",
390    defaults: ["py2-interp-defaults"],
391    srcs: [
392        "Modules/_testcapimodule.c",
393    ],
394}
395
396cc_library_static {
397    name: "py2-c-module-_random",
398    defaults: ["py2-interp-defaults"],
399    srcs: [
400        "Modules/_randommodule.c",
401    ],
402}
403
404cc_library_static {
405    name: "py2-c-module-_collections",
406    defaults: ["py2-interp-defaults"],
407    srcs: [
408        "Modules/_collectionsmodule.c",
409    ],
410}
411
412cc_library_static {
413    name: "py2-c-module-_heapq",
414    defaults: ["py2-interp-defaults"],
415    srcs: [
416        "Modules/_heapqmodule.c",
417    ],
418}
419
420cc_library_static {
421    name: "py2-c-module-itertools",
422    defaults: ["py2-interp-defaults"],
423    srcs: [
424        "Modules/itertoolsmodule.c",
425    ],
426}
427
428cc_library_static {
429    name: "py2-c-module-strop",
430    defaults: ["py2-interp-defaults"],
431    srcs: [
432        "Modules/stropmodule.c",
433    ],
434}
435
436cc_library_static {
437    name: "py2-c-module-_functools",
438    defaults: ["py2-interp-defaults"],
439    srcs: [
440        "Modules/_functoolsmodule.c",
441    ],
442}
443
444cc_library_static {
445    name: "py2-c-module-datetime",
446    defaults: ["py2-interp-defaults"],
447    srcs: [
448        "Modules/datetimemodule.c",
449    ],
450}
451
452cc_library_static {
453    name: "py2-c-module-_bisect",
454    defaults: ["py2-interp-defaults"],
455    srcs: [
456        "Modules/_bisectmodule.c",
457    ],
458}
459
460cc_library_static {
461    name: "py2-c-module-unicodedata",
462    defaults: ["py2-interp-defaults"],
463    srcs: [
464        "Modules/unicodedata.c",
465    ],
466}
467
468cc_library_static {
469    name: "py2-c-module-_io",
470    defaults: ["py2-interp-defaults"],
471    srcs: [
472        "Modules/_io/bufferedio.c",
473        "Modules/_io/bytesio.c",
474        "Modules/_io/fileio.c",
475        "Modules/_io/iobase.c",
476        "Modules/_io/_iomodule.c",
477        "Modules/_io/stringio.c",
478        "Modules/_io/textio.c",
479    ],
480    local_include_dirs: [
481        "Modules/_io",
482    ],
483}
484
485cc_library_static {
486    name: "py2-c-module-fcntl",
487    defaults: ["py2-interp-defaults"],
488    srcs: [
489        "Modules/fcntlmodule.c",
490    ],
491}
492
493cc_library_static {
494    name: "py2-c-module-select",
495    defaults: ["py2-interp-defaults"],
496    srcs: [
497        "Modules/selectmodule.c",
498    ],
499}
500
501cc_library_static {
502    name: "py2-c-module-mmap",
503    defaults: ["py2-interp-defaults"],
504    srcs: [
505        "Modules/mmapmodule.c",
506    ],
507}
508
509cc_library_static {
510    name: "py2-c-module-_csv",
511    defaults: ["py2-interp-defaults"],
512    srcs: [
513        "Modules/_csv.c",
514    ],
515}
516
517cc_library_static {
518    name: "py2-c-module-_socket",
519    defaults: ["py2-interp-defaults"],
520    srcs: [
521        "Modules/socketmodule.c",
522        "Modules/timemodule.c",
523    ],
524}
525
526cc_library_static {
527    name: "py2-c-module-termios",
528    defaults: ["py2-interp-defaults"],
529    srcs: [
530        "Modules/termios.c",
531    ],
532}
533
534cc_library_static {
535    name: "py2-c-module-_md5",
536    defaults: ["py2-interp-defaults"],
537    srcs: [
538        "Modules/md5module.c",
539        "Modules/md5.c",
540    ],
541}
542
543cc_library_static {
544    name: "py2-c-module-_sha",
545    defaults: ["py2-interp-defaults"],
546    srcs: [
547        "Modules/shamodule.c",
548    ],
549}
550
551cc_library_static {
552    name: "py2-c-module-_sha256",
553    defaults: ["py2-interp-defaults"],
554    srcs: [
555        "Modules/sha256module.c",
556    ],
557}
558
559cc_library_static {
560    name: "py2-c-module-_sha512",
561    defaults: ["py2-interp-defaults"],
562    srcs: [
563        "Modules/sha512module.c",
564    ],
565}
566
567cc_library_static {
568    name: "py2-c-module-binascii",
569    defaults: ["py2-interp-defaults"],
570    srcs: [
571        "Modules/binascii.c",
572    ],
573}
574
575cc_library_static {
576    name: "py2-c-module-parser",
577    defaults: ["py2-interp-defaults"],
578    srcs: [
579        "Modules/parsermodule.c",
580    ],
581}
582
583cc_library_static {
584    name: "py2-c-module-cStringIO",
585    defaults: ["py2-interp-defaults"],
586    srcs: [
587        "Modules/cStringIO.c",
588    ],
589}
590
591cc_library_static {
592    name: "py2-c-module-cPickle",
593    defaults: ["py2-interp-defaults"],
594    srcs: [
595        "Modules/cPickle.c",
596    ],
597}
598
599cc_library_static {
600    name: "py2-c-module-xxsubtype",
601    defaults: ["py2-interp-defaults"],
602    srcs: [
603        "Modules/xxsubtype.c",
604    ],
605}
606
607cc_library_static {
608    name: "py2-c-module-future_builtins",
609    defaults: ["py2-interp-defaults"],
610    srcs: [
611        "Modules/future_builtins.c",
612    ],
613}
614
615cc_library_static {
616    name: "py2-c-module-_json",
617    defaults: ["py2-interp-defaults"],
618    srcs: [
619        "Modules/_json.c",
620    ],
621}
622
623cc_library_static {
624    name: "py2-c-module-_hotshot",
625    defaults: ["py2-interp-defaults"],
626    srcs: [
627        "Modules/_hotshot.c",
628    ],
629}
630
631cc_library_static {
632    name: "py2-c-module-_lsprof",
633    defaults: ["py2-interp-defaults"],
634    srcs: [
635        "Modules/_lsprof.c",
636        "Modules/rotatingtree.c",
637    ],
638}
639
640cc_library_static {
641    name: "py2-c-module-grp",
642    defaults: ["py2-interp-defaults"],
643    srcs: [
644        "Modules/grpmodule.c",
645        "Modules/rotatingtree.c",
646    ],
647}
648
649cc_library_static {
650    name: "py2-c-module-syslog",
651    defaults: ["py2-interp-defaults"],
652    srcs: [
653        "Modules/syslogmodule.c",
654    ],
655}
656
657cc_library_static {
658    name: "py2-c-module-audioop",
659    defaults: ["py2-interp-defaults"],
660    srcs: [
661        "Modules/audioop.c",
662    ],
663}
664
665cc_library_static {
666    name: "py2-c-module-resource",
667    defaults: ["py2-interp-defaults"],
668    srcs: [
669        "Modules/resource.c",
670    ],
671}
672
673cc_library_static {
674    name: "py2-c-module-_multibytecodec",
675    defaults: ["py2-interp-defaults"],
676    srcs: [
677        "Modules/cjkcodecs/multibytecodec.c",
678    ],
679}
680
681cc_library_static {
682    name: "py2-c-module-_codecs_kr",
683    defaults: ["py2-interp-defaults"],
684    srcs: ["Modules/cjkcodecs/_codecs_kr.c"],
685}
686
687cc_library_static {
688    name: "py2-c-module-_codecs_jp",
689    defaults: ["py2-interp-defaults"],
690    srcs: ["Modules/cjkcodecs/_codecs_jp.c"],
691}
692
693cc_library_static {
694    name: "py2-c-module-_codecs_cn",
695    defaults: ["py2-interp-defaults"],
696    srcs: ["Modules/cjkcodecs/_codecs_cn.c"],
697}
698
699cc_library_static {
700    name: "py2-c-module-_codecs_tw",
701    defaults: ["py2-interp-defaults"],
702    srcs: ["Modules/cjkcodecs/_codecs_tw.c"],
703}
704
705cc_library_static {
706    name: "py2-c-module-_codecs_hk",
707    defaults: ["py2-interp-defaults"],
708    srcs: ["Modules/cjkcodecs/_codecs_hk.c"],
709}
710
711cc_library_static {
712    name: "py2-c-module-_codecs_iso2022",
713    defaults: ["py2-interp-defaults"],
714    srcs: ["Modules/cjkcodecs/_codecs_iso2022.c"],
715}
716
717cc_library_static {
718    name: "py2-c-module-_multiprocessing",
719    defaults: ["py2-interp-defaults"],
720    srcs: [
721        "Modules/_multiprocessing/multiprocessing.c",
722        "Modules/_multiprocessing/semaphore.c",
723        "Modules/_multiprocessing/socket_connection.c",
724    ],
725}
726
727cc_library_static {
728    name: "py2-c-module-zlib",
729    defaults: [
730        "py2-interp-defaults",
731    ],
732    cflags: [
733        "-DUSE_ZLIB_CRC32",
734    ],
735    srcs: [
736        "Modules/zlibmodule.c",
737    ],
738    static_libs: [
739        "libz",
740    ],
741}
742
743cc_library_static {
744    name: "py2-c-module-pyexpat",
745    defaults: [
746        "py2-interp-defaults",
747    ],
748    cflags: [
749        "-DUSE_PYEXPAT_CAPI",
750    ],
751    srcs: [
752        "Modules/pyexpat.c",
753    ],
754    static_libs: [
755        "libexpat",
756    ],
757}
758
759cc_library_static {
760    name: "py2-c-module-_sqlite3",
761    defaults: [
762        "py2-interp-defaults",
763    ],
764    cflags: [
765        "-DMODULE_NAME=\"sqlite3\"",
766        "-DSQLITE_OMIT_LOAD_EXTENSION",
767        "-Wno-format-security",
768        "-Wno-type-limits",
769        "-Wno-char-subscripts",
770    ],
771    local_include_dirs: [
772        "Modules/_sqlite",
773    ],
774    srcs: [
775        "Modules/_sqlite/cache.c",
776        "Modules/_sqlite/connection.c",
777        "Modules/_sqlite/cursor.c",
778        "Modules/_sqlite/microprotocols.c",
779        "Modules/_sqlite/module.c",
780        "Modules/_sqlite/prepare_protocol.c",
781        "Modules/_sqlite/row.c",
782        "Modules/_sqlite/statement.c",
783        "Modules/_sqlite/util.c",
784    ],
785    target: {
786        linux_glibc_x86_64: {
787            static_libs: [
788                "libsqlite",
789            ],
790        },
791        darwin_x86_64: {
792            static_libs: [
793                "libsqlite",
794            ],
795        },
796        android: {
797            shared_libs: [
798                "libsqlite",
799            ]
800        },
801    },
802}
803
804cc_library_static {
805    name: "py2-c-module-_ctypes_test",
806    defaults: ["py2-interp-defaults"],
807    srcs: ["Modules/_ctypes/_ctypes_test.c"],
808}
809
810cc_library_static {
811    name: "py2-c-module-_ctypes",
812    defaults: [
813        "py2-interp-defaults",
814    ],
815    local_include_dirs: [
816        "Modules/_ctypes/libffi/include",
817    ],
818    srcs: [
819        "Modules/_ctypes/_ctypes.c",
820        "Modules/_ctypes/callbacks.c",
821        "Modules/_ctypes/callproc.c",
822        "Modules/_ctypes/stgdict.c",
823        "Modules/_ctypes/cfield.c",
824        "Modules/_ctypes/libffi/src/prep_cif.c",
825        "Modules/_ctypes/libffi/src/closures.c",
826    ],
827    arch: {
828        x86_64: {
829            local_include_dirs: [
830                "Modules/_ctypes/libffi/src/x86",
831            ],
832            srcs: [
833                "Modules/_ctypes/libffi/src/x86/ffi64.c",
834                "Modules/_ctypes/libffi/src/x86/ffi.c",
835                "Modules/_ctypes/libffi/src/x86/sysv.S",
836            ],
837        },
838        x86: {
839            local_include_dirs: [
840                "Modules/_ctypes/libffi/src/x86",
841            ],
842            srcs: [
843                "Modules/_ctypes/libffi/src/x86/ffi.c",
844                "Modules/_ctypes/libffi/src/x86/sysv.S",
845            ],
846        },
847        arm: {
848            local_include_dirs: [
849                "android_arm/libffi",
850                "Modules/_ctypes/libffi/src/arm",
851            ],
852            srcs: [
853                "Modules/_ctypes/libffi/src/arm/ffi.c",
854                "Modules/_ctypes/libffi/src/arm/sysv.S",
855                "Modules/_ctypes/libffi/src/arm/trampoline.S",
856            ]
857        },
858        arm64: {
859            // arithmetic on a pointer in _ctypes/libffi/src/aarch64/ffi.c
860            cflags: ["-Wno-pointer-arith"],
861            local_include_dirs: [
862                "android_arm64/libffi",
863                "Modules/_ctypes/libffi/src/aarch64",
864            ],
865            srcs: [
866                "Modules/_ctypes/libffi/src/aarch64/ffi.c",
867                "Modules/_ctypes/libffi/src/aarch64/sysv.S",
868            ]
869        },
870    },
871    target: {
872        // Regenerate include dirs with android_regen.sh
873        darwin_x86_64: {
874            local_include_dirs: ["darwin_x86_64/libffi"],
875            srcs: [
876                "Modules/_ctypes/libffi/src/x86/darwin.S",
877                "Modules/_ctypes/libffi/src/x86/darwin64.S",
878            ],
879        },
880        linux_glibc_x86_64: {
881            local_include_dirs: ["linux_x86_64/libffi"],
882            srcs: [
883                "Modules/_ctypes/libffi/src/x86/unix64.S",
884            ],
885        },
886        android_x86: {
887            local_include_dirs: ["android_x86/libffi"],
888            srcs: [
889                "Modules/_ctypes/libffi/src/x86/win32.S",
890            ],
891        },
892        android_x86_64: {
893            local_include_dirs: ["android_x86_64/libffi"],
894            srcs: [
895                "Modules/_ctypes/libffi/src/x86/unix64.S",
896            ],
897        },
898    },
899}
900