Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: build/untrusted.gypi

Issue 24227003: [MIPS] Add support to gyp files to build Native Client inside of Chromium (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Update per comments. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 { 5 {
6 'variables': { 6 'variables': {
7 'variables': { 7 'variables': {
8 # Enable -Werror by default, but put it in a variable so it can 8 # Enable -Werror by default, but put it in a variable so it can
9 # be optionally disabled. 9 # be optionally disabled.
10 'werror%': '-Werror', 10 'werror%': '-Werror',
(...skipping 30 matching lines...) Expand all
41 'nacl_default_compile_flags': [ 41 'nacl_default_compile_flags': [
42 #'-std=gnu99', Added by build_nexe 42 #'-std=gnu99', Added by build_nexe
43 '-O2', 43 '-O2',
44 '-g', 44 '-g',
45 '-Wall', 45 '-Wall',
46 '-fdiagnostics-show-option', 46 '-fdiagnostics-show-option',
47 '<(werror)', 47 '<(werror)',
48 ] 48 ]
49 }, 49 },
50 'conditions': [ 50 'conditions': [
51 ['target_arch!="arm"', { 51 ['target_arch=="ia32" or target_arch=="x64"', {
52 # Common defaults for all x86 nacl-gcc targets 52 # Common defaults for all x86 nacl-gcc targets
53 'target_defaults': { 53 'target_defaults': {
54 'conditions': [ 54 'conditions': [
55 ['OS=="win"', { 55 ['OS=="win"', {
56 'variables': { 56 'variables': {
57 # NOTE: Python is invoked differently by the Native Client 57 # NOTE: Python is invoked differently by the Native Client
58 # builders than the Chromium builders. Invoking using 58 # builders than the Chromium builders. Invoking using
59 # this python_exe defn won't work in the Chrome tree. 59 # this python_exe defn won't work in the Chrome tree.
60 'python_exe': 'call <(DEPTH)/native_client/tools/win_py.cmd', 60 'python_exe': 'call <(DEPTH)/native_client/tools/win_py.cmd',
61 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/win_x86', 61 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/win_x86',
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 'scan_sources', 115 'scan_sources',
116 # This is needed to open the .c filenames, which are given 116 # This is needed to open the .c filenames, which are given
117 # relative to the .gyp file. 117 # relative to the .gyp file.
118 '-I.', 118 '-I.',
119 # This is needed to open the .h filenames, which are given 119 # This is needed to open the .h filenames, which are given
120 # relative to the native_client directory's parent. 120 # relative to the native_client directory's parent.
121 '-I<(DEPTH)', 121 '-I<(DEPTH)',
122 ], 122 ],
123 }, 123 },
124 }, 124 },
125 }, { 125 }],
126 ['target_arch=="arm"', {
126 # Common defaults for all ARM nacl-gcc targets 127 # Common defaults for all ARM nacl-gcc targets
127 'target_defaults': { 128 'target_defaults': {
128 'defines': [], 129 'defines': [],
129 'sources': [], 130 'sources': [],
130 'compile_flags': [], 131 'compile_flags': [],
131 'link_flags': [], 132 'link_flags': [],
132 'include_dirs': [], 133 'include_dirs': [],
133 'variables': { 134 'variables': {
134 'newlib_tls_flags': [ '-mtp=soft' ], 135 'newlib_tls_flags': [ '-mtp=soft' ],
135 'python_exe': 'python', 136 'python_exe': 'python',
(...skipping 26 matching lines...) Expand all
162 # This is needed to open the .c filenames, which are given 163 # This is needed to open the .c filenames, which are given
163 # relative to the .gyp file. 164 # relative to the .gyp file.
164 '-I.', 165 '-I.',
165 # This is needed to open the .h filenames, which are given 166 # This is needed to open the .h filenames, which are given
166 # relative to the native_client directory's parent. 167 # relative to the native_client directory's parent.
167 '-I<(DEPTH)', 168 '-I<(DEPTH)',
168 ], 169 ],
169 }, 170 },
170 }, 171 },
171 }], 172 }],
172 ['target_arch!="arm"', { 173 ['target_arch=="mipsel"', {
174 # Common defaults for all mips pnacl-clang targets
175 'target_defaults': {
176 'defines': [],
177 'sources': [],
178 'compile_flags': [],
179 'link_flags': [],
180 'include_dirs': [],
181 'variables': {
182 'newlib_tls_flags': [],
183 'python_exe': 'python',
184 'nexe_target': '',
185 'nlib_target': '',
186 'nso_target': '',
187 'build_newlib': 0,
188 'build_glibc': 0,
189 'build_irt': 0,
190 'disable_glibc%': 1,
191 'extra_args': [],
192 'enable_x86_32': 0,
193 'enable_x86_64': 0,
194 'enable_arm': 0,
195 'extra_deps_newlib_mips': [],
196 'tc_lib_dir_newlib_mips': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libmip s',
197 'tc_lib_dir_irt_mips': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/libmips',
198 'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include ',
199 'include_dirs': ['<(DEPTH)'],
200 'defines': [
201 '<@(nacl_default_defines)',
202 'NACL_BUILD_ARCH=mips',
203 ],
204 'sources': [],
205 'link_flags': [],
206 'get_sources': [
207 'scan_sources',
208 # This is needed to open the .c filenames, which are given
209 # relative to the .gyp file.
210 '-I.',
211 # This is needed to open the .h filenames, which are given
212 # relative to the native_client directory's parent.
213 '-I<(DEPTH)',
214 ],
215 },
216 },
217 }],
218 ['target_arch=="ia32" or target_arch=="x64"', {
173 'target_defaults': { 219 'target_defaults': {
174 # x86-64 newlib nexe action 220 # x86-64 newlib nexe action
175 'target_conditions': [ 221 'target_conditions': [
176 ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', { 222 ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', {
177 'variables': { 223 'variables': {
178 'tool_name': 'newlib', 224 'tool_name': 'newlib',
179 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe' , 225 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe' ,
180 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_ target_name)', 226 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_ target_name)',
181 'source_list_newlib64%': '<(tool_name)-x86-64.>(_target_name).so urce_list.gypcmd', 227 'source_list_newlib64%': '<(tool_name)-x86-64.>(_target_name).so urce_list.gypcmd',
182 }, 228 },
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 '--defines=^(defines) >(_defines)', 742 '--defines=^(defines) >(_defines)',
697 '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link _flags)', 743 '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link _flags)',
698 '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sour ces))', 744 '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sour ces))',
699 ], 745 ],
700 }, 746 },
701 ], 747 ],
702 }], 748 }],
703 ], # end target_conditions for arm newlib (nexe/nlib, force_arm_pnacl) 749 ], # end target_conditions for arm newlib (nexe/nlib, force_arm_pnacl)
704 }, 750 },
705 }], # end target_arch = arm 751 }], # end target_arch = arm
706 ['target_arch!="arm"', { 752 ['target_arch=="mipsel"', {
753 'target_defaults': {
754 'target_conditions': [
755 # mips newlib library action
Mark Seaborn 2013/09/23 19:15:28 I'm comparing this with the target_arch=="arm" sec
petarj 2013/09/25 23:21:31 We planned that to be part of a different patch, b
756 ['nlib_target!="" and build_newlib!=0', {
757 'variables': {
758 'tool_name': 'newlib',
759 'out_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/li bmips/>(nlib_target)',
760 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_t arget_name)',
761 'source_list_newlib_mips%': '<(tool_name)-mips.>(_target_name).sou rce_list.gypcmd',
762 },
763 'actions': [
764 {
765 'action_name': 'build newlib mips nlib',
766 'msvs_cygwin_shell': 0,
767 'description': 'building >(out_newlib_mips)',
768 'inputs': [
769 '<(DEPTH)/native_client/build/build_nexe.py',
770 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
771 '>@(extra_deps_newlib_mips)',
772 '>(source_list_newlib_mips)',
773 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.p rep',
774 ],
775 'outputs': ['>(out_newlib_mips)'],
776 'action': [
777 '>(python_exe)',
778 '<(DEPTH)/native_client/build/build_nexe.py',
779 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
780 '>@(extra_args)',
781 '--arch', 'mips',
782 '--build', 'newlib_nlib',
783 '--root', '<(DEPTH)',
784 '--name', '>(out_newlib_mips)',
785 '--objdir', '>(objdir_newlib_mips)',
786 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_in clude_dirs)',
787 '--compile_flags= ^(compile_flags) >(_compile_flags) ^(pnacl_c ompile_flags) >(_pnacl_compile_flags)',
788 '--defines=^(defines) >(_defines)',
789 '--link_flags=-B>(tc_lib_dir_newlib_mips) ^(link_flags) >(_lin k_flags)',
790 '--source-list=^|(<(source_list_newlib_mips) ^(_sources) ^(sou rces))',
791 ],
792 },
793 ],
794 }],
795 # mips irt nexe action
796 ['nexe_target!="" and build_irt!=0', {
797 'variables': {
798 'tool_name': 'irt',
799 'out_newlib_mips%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_mips.ne xe',
800 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_ target_name)',
801 'source_list_newlib_mips%': '<(tool_name)-mips.>(_target_name).so urce_list.gypcmd',
802 },
803 'actions': [
804 {
805 'action_name': 'build IRT mips nexe',
806 'msvs_cygwin_shell': 0,
807 'description': 'building >(out_newlib_mips)',
808 'inputs': [
809 '<(DEPTH)/native_client/build/build_nexe.py',
810 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
811 '>@(extra_deps_newlib_mips)',
812 '>(source_list_newlib_mips)',
813 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.p rep',
814 ],
815 'outputs': ['>(out_newlib_mips)'],
816 'action': [
817 '>(python_exe)',
818 '<(DEPTH)/native_client/build/build_nexe.py',
819 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
820 '>@(extra_args)',
821 '--arch', 'mips',
822 '--build', 'newlib_nexe',
823 '--root', '<(DEPTH)',
824 '--name', '>(out_newlib_mips)',
825 '--objdir', '>(objdir_newlib_mips)',
826 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_in clude_dirs)',
827 '--compile_flags= ^(compile_flags) >(_compile_flags) ^(pnacl_c ompile_flags) >(_pnacl_compile_flags)',
828 '--defines=^(defines) >(_defines)',
829 '--link_flags= -arch mips --pnacl-allow-translate --pnacl-allo w-native -Wt,-mtls-use-call --pnacl-disable-abi-check -Wn,--section-start=.rodat a=<(NACL_IRT_DATA_START) -Wn,--section-start=.text=<(NACL_IRT_TEXT_START) -B>(tc _lib_dir_irt_mips) ^(link_flags) >(_link_flags)',
Mark Seaborn 2013/09/23 19:15:28 Why do you need "--pnacl-disable-abi-check" here?
petarj 2013/09/25 23:21:31 This is needed for two reasons when we build IRT.N
830 '--source-list=^|(<(source_list_newlib_mips) ^(_sources) ^(sou rces))',
831 ],
832 },
833 ],
834 }],
835 # mips IRT library action
836 ['nlib_target!="" and build_irt!=0', {
837 'variables': {
838 'tool_name': 'irt',
839 'out_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/li bmips/>(nlib_target)',
840 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_t arget_name)',
841 'source_list_newlib_mips%': '<(tool_name)-mips.>(_target_name).sou rce_list.gypcmd',
842 },
843 'actions': [
844 {
845 'action_name': 'build IRT mips nlib',
846 'msvs_cygwin_shell': 0,
847 'description': 'building >(out_newlib_mips)',
848 'inputs': [
849 '<(DEPTH)/native_client/build/build_nexe.py',
850 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
851 '>@(extra_deps_newlib_mips)',
852 '>(source_list_newlib_mips)',
853 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.p rep',
854 ],
855 'outputs': ['>(out_newlib_mips)'],
856 'action': [
857 '>(python_exe)',
858 '<(DEPTH)/native_client/build/build_nexe.py',
859 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
860 '>@(extra_args)',
861 '--arch', 'mips',
862 '--build', 'newlib_nlib',
863 '--root', '<(DEPTH)',
864 '--name', '>(out_newlib_mips)',
865 '--objdir', '>(objdir_newlib_mips)',
866 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_in clude_dirs)',
867 '--compile_flags= ^(compile_flags) >(_compile_flags) ^(pnacl_c ompile_flags) >(_pnacl_compile_flags)',
868 '--defines=^(defines) >(_defines)',
869 '--link_flags=-B>(tc_lib_dir_irt_mips) ^(link_flags) >(_link_f lags)',
870 '--source-list=^|(<(source_list_newlib_mips) ^(_sources) ^(sou rces))',
871 ],
872 },
873 ],
874 }],
875 ], # end target_conditions for mips newlib
876 },
877 }], # end target_arch = mips
878 ['target_arch=="ia32" or target_arch=="x64"', {
707 'target_defaults': { 879 'target_defaults': {
708 # x86-64 glibc nexe action 880 # x86-64 glibc nexe action
709 'target_conditions': [ 881 'target_conditions': [
710 ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable _glibc==0', { 882 ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable _glibc==0', {
711 'variables': { 883 'variables': {
712 'tool_name': 'glibc', 884 'tool_name': 'glibc',
713 'out_glibc64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe', 885 'out_glibc64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe',
714 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_t arget_name)', 886 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_t arget_name)',
715 'source_list_glibc64%': '<(tool_name)-x86-64.>(_target_name).sou rce_list.gypcmd', 887 'source_list_glibc64%': '<(tool_name)-x86-64.>(_target_name).sou rce_list.gypcmd',
716 }, 888 },
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 '--compile_flags=-m32 -fPIC ^(gcc_compile_flags) >(_gcc_compi le_flags) ^(compile_flags) >(_compile_flags)', 1113 '--compile_flags=-m32 -fPIC ^(gcc_compile_flags) >(_gcc_compi le_flags) ^(compile_flags) >(_compile_flags)',
942 '--defines=^(defines) >(_defines)', 1114 '--defines=^(defines) >(_defines)',
943 '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_l ink_flags)', 1115 '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_l ink_flags)',
944 '--source-list=^|(<(source_list_glibc32) ^(_sources) ^(source s))', 1116 '--source-list=^|(<(source_list_glibc32) ^(_sources) ^(source s))',
945 ], 1117 ],
946 }, 1118 },
947 ], 1119 ],
948 }], 1120 }],
949 ], # end target_conditions for glibc (nexe/nlib/nso, x86-32/64) 1121 ], # end target_conditions for glibc (nexe/nlib/nso, x86-32/64)
950 }, 1122 },
951 }], # end target_arch != arm 1123 }], # end target_arch == ia32 or x64
952 ], 1124 ],
953 # Common defaults for pnacl targets 1125 # Common defaults for pnacl targets
954 'target_defaults': { 1126 'target_defaults': {
955 'gcc_compile_flags': [], 1127 'gcc_compile_flags': [],
956 'pnacl_compile_flags': [], 1128 'pnacl_compile_flags': [],
957 'variables': { 1129 'variables': {
958 'disable_pnacl%': 0, 1130 'disable_pnacl%': 0,
959 'build_pnacl_newlib': 0, 1131 'build_pnacl_newlib': 0,
960 'nlib_target': '', 1132 'nlib_target': '',
961 'extra_deps_pnacl_newlib': [], 1133 'extra_deps_pnacl_newlib': [],
(...skipping 21 matching lines...) Expand all
983 '-Wno-unused-function', 1155 '-Wno-unused-function',
984 ], 1156 ],
985 }, 1157 },
986 'target_conditions': [ 1158 'target_conditions': [
987 # pnacl actions for building pexes and translating them 1159 # pnacl actions for building pexes and translating them
988 ['nexe_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0', { 1160 ['nexe_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0', {
989 'variables': { 1161 'variables': {
990 'out_pnacl_newlib_x86_32_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnac l_newlib_x32.nexe', 1162 'out_pnacl_newlib_x86_32_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnac l_newlib_x32.nexe',
991 'out_pnacl_newlib_x86_64_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnac l_newlib_x64.nexe', 1163 'out_pnacl_newlib_x86_64_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnac l_newlib_x64.nexe',
992 'out_pnacl_newlib_arm_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_n ewlib_arm.nexe', 1164 'out_pnacl_newlib_arm_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_n ewlib_arm.nexe',
1165 'out_pnacl_newlib_mips_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_ newlib_mips.nexe',
993 'tool_name': 'pnacl_newlib', 1166 'tool_name': 'pnacl_newlib',
994 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib', 1167 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib',
995 'out_pnacl_newlib%': '<(PRODUCT_DIR)/>(nexe_target)_newlib.pexe', 1168 'out_pnacl_newlib%': '<(PRODUCT_DIR)/>(nexe_target)_newlib.pexe',
996 'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_na me)', 1169 'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_na me)',
997 'source_list_pnacl_newlib%': '<(tool_name).>(_target_name).source_list .gypcmd', 1170 'source_list_pnacl_newlib%': '<(tool_name).>(_target_name).source_list .gypcmd',
998 'link_flags': [ 1171 'link_flags': [
999 '-O3', 1172 '-O3',
1000 ], 1173 ],
1001 'translate_flags': [], 1174 'translate_flags': [],
1002 }, 1175 },
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 '--defines=^(defines) >(_defines)', 1317 '--defines=^(defines) >(_defines)',
1145 '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_f lags)', 1318 '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_f lags)',
1146 '--source-list=^|(<(source_list_pnacl_newlib) ^(_sources) ^(source s))', 1319 '--source-list=^|(<(source_list_pnacl_newlib) ^(_sources) ^(source s))',
1147 ], 1320 ],
1148 }, 1321 },
1149 ], 1322 ],
1150 }], 1323 }],
1151 ], # end target_conditions for pnacl pexe/plib 1324 ], # end target_conditions for pnacl pexe/plib
1152 }, 1325 },
1153 } 1326 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698