summary refs log tree commit diff
path: root/pkgs/development/mobile/androidenv/make_standalone_toolchain.py_16b.patch
blob: 70b1f7e7f4a59b4f9b690a64f0fc2239034acbbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff --git a/build/tools/make_standalone_toolchain.py b/build/tools/make_standalone_toolchain.py
index a6ae8448..2739912e 100755
--- a/build/tools/make_standalone_toolchain.py
+++ b/build/tools/make_standalone_toolchain.py
@@ -398,7 +398,9 @@ def create_toolchain(install_path, arch, api, gcc_path, clang_path,
                      sysroot_path, stl, host_tag):
     """Create a standalone toolchain."""
     copy_directory_contents(gcc_path, install_path)
+    os.system('chmod -R +w "{}"'.format(install_path))
     copy_directory_contents(clang_path, install_path)
+    os.system('chmod -R +w "{}"'.format(install_path))
     triple = get_triple(arch)
     make_clang_scripts(
         install_path, triple, api, host_tag.startswith('windows'))
@@ -406,23 +408,28 @@ def create_toolchain(install_path, arch, api, gcc_path, clang_path,
     sysroot = os.path.join(NDK_DIR, 'sysroot')
     install_sysroot = os.path.join(install_path, 'sysroot')
     shutil.copytree(sysroot, install_sysroot)
+    os.system('chmod -R +w "{}"'.format(install_path))
 
     arch_headers = os.path.join(sysroot, 'usr/include', triple)
     copy_directory_contents(
         arch_headers, os.path.join(install_sysroot, 'usr/include'))
+    os.system('chmod -R +w "{}"'.format(install_path))
 
     lib_path = os.path.join(sysroot_path, 'usr/lib')
     lib_install = os.path.join(install_sysroot, 'usr/lib')
     if os.path.exists(lib_path):
         shutil.copytree(lib_path, lib_install)
+        os.system('chmod -R +w "{}"'.format(install_path))
 
     lib64_path = os.path.join(sysroot_path, 'usr/lib64')
     lib64_install = os.path.join(install_sysroot, 'usr/lib64')
     if os.path.exists(lib64_path):
         shutil.copytree(lib64_path, lib64_install)
+        os.system('chmod -R +w "{}"'.format(install_path))
 
     prebuilt_path = os.path.join(NDK_DIR, 'prebuilt', host_tag)
     copy_directory_contents(prebuilt_path, install_path)
+    os.system('chmod -R +w "{}"'.format(install_path))
 
     toolchain_lib_dir = os.path.join(gcc_path, 'lib/gcc', triple)
     dirs = os.listdir(toolchain_lib_dir)
@@ -444,29 +451,37 @@ def create_toolchain(install_path, arch, api, gcc_path, clang_path,
     if stl == 'gnustl':
         gnustl_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/gnu-libstdc++/4.9')
         shutil.copytree(os.path.join(gnustl_dir, 'include'), cxx_headers)
+        os.system('chmod -R +w "{}"'.format(install_path))
 
         for abi in get_abis(arch):
             copy_gnustl_abi_headers(gnustl_dir, install_path, gcc_ver, triple,
                                     abi)
+            os.system('chmod -R +w "{}"'.format(install_path))
             copy_gnustl_libs(gnustl_dir, install_path, triple, abi)
+            os.system('chmod -R +w "{}"'.format(install_path))
             if arch == 'arm':
                 copy_gnustl_abi_headers(gnustl_dir, install_path, gcc_ver,
                                         triple, abi, thumb=True)
+                os.system('chmod -R +w "{}"'.format(install_path))
                 copy_gnustl_libs(gnustl_dir, install_path, triple, abi,
                                  thumb=True)
+                os.system('chmod -R +w "{}"'.format(install_path))
     elif stl == 'libc++':
         libcxx_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/llvm-libc++')
         libcxxabi_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/llvm-libc++abi')
         support_dir = os.path.join(NDK_DIR, 'sources/android/support')
         copy_directory_contents(os.path.join(libcxx_dir, 'include'),
                                 cxx_headers)
+        os.system('chmod -R +w "{}"'.format(install_path))
         copy_directory_contents(os.path.join(support_dir, 'include'),
                                 support_headers)
+        os.system('chmod -R +w "{}"'.format(install_path))
 
         # I have no idea why we need this, but the old one does it too.
         copy_directory_contents(
             os.path.join(libcxxabi_dir, 'include'),
             os.path.join(install_path, 'include/llvm-libc++abi/include'))
+        os.system('chmod -R +w "{}"'.format(install_path))
 
         headers = [
             'cxxabi.h',
@@ -482,21 +497,25 @@ def create_toolchain(install_path, arch, api, gcc_path, clang_path,
             dest_libdir = get_dest_libdir(install_path, triple, abi)
             include_libunwind = arch == 'arm'
             copy_libcxx_libs(src_libdir, dest_libdir, include_libunwind)
+            os.system('chmod -R +w "{}"'.format(install_path))
             if arch == 'arm':
                 thumb_libdir = os.path.join(dest_libdir, 'thumb')
                 copy_libcxx_libs(src_libdir, thumb_libdir, include_libunwind)
+                os.system('chmod -R +w "{}"'.format(install_path))
     elif stl == 'stlport':
         stlport_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/stlport')
         gabixx_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/gabi++')
 
         copy_directory_contents(
             os.path.join(stlport_dir, 'stlport'), cxx_headers)
+        os.system('chmod -R +w "{}"'.format(install_path))
 
         # Same as for libc++. Not sure why we have this extra directory, but
         # keep the cruft for diff.
         copy_directory_contents(
             os.path.join(gabixx_dir, 'include'),
             os.path.join(install_path, 'include/gabi++/include'))
+        os.system('chmod -R +w "{}"'.format(install_path))
 
         headers = [
             'cxxabi.h',
@@ -512,9 +531,11 @@ def create_toolchain(install_path, arch, api, gcc_path, clang_path,
 
         for abi in get_abis(arch):
             copy_stlport_libs(stlport_dir, install_path, triple, abi)
+            os.system('chmod -R +w "{}"'.format(install_path))
             if arch == 'arm':
                 copy_stlport_libs(stlport_dir, install_path, triple, abi,
                                   thumb=True)
+                os.system('chmod -R +w "{}"'.format(install_path))
     else:
         raise ValueError(stl)