Index: pydir/targets.py |
diff --git a/pydir/targets.py b/pydir/targets.py |
index 0f6433c30e0f414001606ad68f6c25ecf2220801..c2188e5dec3af236498a9343a3c7bd45b416de65 100644 |
--- a/pydir/targets.py |
+++ b/pydir/targets.py |
@@ -1,26 +1,44 @@ |
#!/usr/bin/env python2 |
from collections import namedtuple |
+import glob |
+ |
+ |
+# Why have 'cross_headers': |
+# For some reason, clang doesn't know how to find some of the libstdc++ |
+# headers (c++config.h). Manually add in one of the paths: |
+# https://llvm.org/bugs/show_bug.cgi?id=22937 |
+# Otherwise, we could assume the system has arm-linux-gnueabihf-g++ and |
+# use that instead of clang, but so far we've just been using clang for |
+# the unsandboxed build. |
+def FindARMCrossInclude(): |
+ return glob.glob( |
+ '/usr/arm-linux-gnueabihf/include/c++/*/arm-linux-gnueabihf')[-1] |
+ |
TargetInfo = namedtuple('TargetInfo', |
- ['target', 'triple', 'llc_flags', 'ld_emu']) |
+ ['target', 'triple', 'llc_flags', 'ld_emu', |
+ 'cross_headers']) |
X8632Target = TargetInfo(target='x8632', |
triple='i686-none-linux', |
llc_flags=['-mcpu=pentium4m'], |
- ld_emu='elf_i386_nacl') |
+ ld_emu='elf_i386_nacl', |
+ cross_headers=[]) |
X8664Target = TargetInfo(target='x8664', |
triple='x86_64-none-linux', |
llc_flags=['-mcpu=x86-64'], |
- ld_emu='elf_x86_64_nacl') |
+ ld_emu='elf_x86_64_nacl', |
+ cross_headers=[]) |
ARM32Target = TargetInfo(target='arm32', |
triple='armv7a-none-linux-gnueabihf', |
llc_flags=['-mcpu=cortex-a9', |
'-float-abi=hard', |
'-mattr=+neon'], |
- ld_emu='armelf_nacl') |
+ ld_emu='armelf_nacl', |
+ cross_headers=['-isystem', FindARMCrossInclude()]) |
def ConvertTripleToNaCl(nonsfi_triple): |