Index: build/untrusted.gypi |
=================================================================== |
--- build/untrusted.gypi (revision 8056) |
+++ build/untrusted.gypi (working copy) |
@@ -11,7 +11,6 @@ |
'NACL_IRT_TEXT_START': '0x0fc00000', |
}, |
'conditions': [ |
- # NOTE: we do not support untrusted gyp build on arm yet. |
['target_arch!="arm"', { |
'target_defaults': { |
'conditions': [ |
@@ -68,6 +67,49 @@ |
], |
}, |
}, |
+ }, { |
+ # ARM case |
robertm
2012/03/23 15:03:38
can this be better merged with the one above so th
Nikolay
2012/03/26 13:29:56
I tried to follow style of the rest of this file.
|
+ 'target_defaults': { |
+ 'variables': { |
+ 'python_exe': 'python', |
+ 'nexe_target': '', |
+ 'nlib_target': '', |
+ 'build_newlib': 0, |
+ 'build_glibc': 0, |
+ 'disable_glibc%': 1, |
+ 'extra_args': [], |
+ 'enable_arm': 1, |
+ 'extra_depsarm': [], |
+ 'lib_dirs': [], |
+ 'include_dirs': ['<(DEPTH)','<(DEPTH)/ppapi'], |
+ 'defines': [ |
+ '-DNACL_BUILD_ARCH=arm', |
+ '-D__linux__', |
+ '-D__STDC_LIMIT_MACROS=1', |
+ '-D__STDC_FORMAT_MACROS=1', |
+ '-D_GNU_SOURCE=1', |
+ '-D_BSD_SOURCE=1', |
+ '-D_POSIX_C_SOURCE=199506', |
+ '-D_XOPEN_SOURCE=600', |
+ '-DDYNAMIC_ANNOTATIONS_ENABLED=1', |
+ '-DDYNAMIC_ANNOTATIONS_PREFIX=NACL_', |
+ ], |
+ 'compile_flags': [ |
+ #'-std=gnu99', Added by build_nexe |
+ '-O3', |
+ ], |
+ 'link_flags': [], |
+ 'get_sources': [ |
+ '>(python_exe)', '<(DEPTH)/native_client/build/scan_sources.py', |
+ # This is needed to open the .c filenames, which are given |
+ # relative to the .gyp file. |
+ '-I.', |
+ # This is needed to open the .h filenames, which are given |
+ # relative to the native_client directory's parent. |
+ '-I<(DEPTH)', |
+ ], |
+ }, |
+ }, |
}], |
['target_arch=="x64" or OS=="win"', { |
'target_defaults': { |
@@ -189,7 +231,7 @@ |
'--name', '>(out32)', |
'--objdir', '>(objdir)', |
'--include-dirs', '>(inst_dir)/include >(include_dirs) >(include_dirs)', |
- '--lib-dirs', '>(lib_dirs) ', |
+ '--lib-dirs', '>(lib_dirs)', |
'--compile_flags', '-m32 >@(compile_flags)', |
'>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
'--link_flags', '-m32 -B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32 >(link_flags)', |
@@ -245,42 +287,42 @@ |
], |
}, |
}], |
- ['target_arch=="x64" or OS=="win"', { |
+ ['target_arch=="arm"', { |
'target_defaults': { |
'target_conditions': [ |
- ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', { |
+ ['nexe_target!="" and build_newlib!=0', { |
'variables': { |
- 'tool_name': 'glibc', |
- 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc', |
- 'out64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe', |
- 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-x86-64/>(_target_name)', |
+ 'tool_name': 'newlib', |
+ 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib', |
+ 'outarm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe', |
+ 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-arm/>(_target_name)', |
}, |
'actions': [ |
{ |
- 'action_name': 'build glibc x86-64 nexe', |
+ 'action_name': 'build newlib arm nexe', |
'msvs_cygwin_shell': 0, |
- 'description': 'building >(out64)', |
+ 'description': 'building >(outarm)', |
'inputs': [ |
'<(DEPTH)/native_client/build/build_nexe.py', |
'<(DEPTH)/ppapi/ppapi_cpp.gypi', |
'>!@(>(get_sources) >(sources))', |
- '>@(extra_deps64)', |
+ '>@(extra_depsarm)', |
], |
- 'outputs': ['>(out64)'], |
+ 'outputs': ['>(outarm)'], |
'action': [ |
'>(python_exe)', |
'<(DEPTH)/native_client/build/build_nexe.py', |
'>@(extra_args)', |
- '--arch', 'x86-64', |
- '--build', 'glibc_nexe', |
+ '--arch', 'arm', |
+ '--build', 'newlib_nexe', |
'--root', '<(DEPTH)', |
- '--name', '>(out64)', |
+ '--name', '>(outarm)', |
'--objdir', '>(objdir)', |
'--include-dirs', '>(inst_dir)/include >(include_dirs) >(include_dirs)', |
'--lib-dirs', '>(lib_dirs) ', |
- '--compile_flags', '-m64 >@(compile_flags) ', |
- '>@(defines)', '-DNACL_BUILD_SUBARCH=64', |
- '--link_flags', '-B<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64 >(link_flags) ', |
+ '--compile_flags', '>@(compile_flags)', |
+ '>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
+ '--link_flags', '-B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32 >(link_flags)', |
'>@(sources)', |
], |
}, |
@@ -289,9 +331,97 @@ |
], |
}, |
}], |
+ ['target_arch=="arm"', { |
+ 'target_defaults': { |
+ 'target_conditions': [ |
+ ['nlib_target!="" and build_newlib!=0', { |
+ 'variables': { |
+ 'tool_name': 'newlib', |
+ 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib', |
+ 'outarm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)', |
+ 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-arm/>(_target_name)', |
+ }, |
+ 'actions': [ |
+ { |
+ 'action_name': 'build newlib arm nlib', |
+ 'msvs_cygwin_shell': 0, |
+ 'description': 'building >(outarm)', |
+ 'inputs': [ |
+ '<(DEPTH)/native_client/build/build_nexe.py', |
+ '<(DEPTH)/ppapi/ppapi_cpp.gypi', |
+ '>!@(>(get_sources) >(sources))', |
+ '>@(extra_depsarm)', |
+ ], |
+ 'outputs': ['>(outarm)'], |
+ 'action': [ |
+ '>(python_exe)', |
+ '<(DEPTH)/native_client/build/build_nexe.py', |
+ '>@(extra_args)', |
+ '--arch', 'arm', |
+ '--build', 'newlib_nlib', |
+ '--root', '<(DEPTH)', |
+ '--name', '>(outarm)', |
+ '--objdir', '>(objdir)', |
+ '--include-dirs', '>(inst_dir)/include >(include_dirs) >(include_dirs)', |
+ '--lib-dirs', '>(lib_dirs) ', |
+ '--compile_flags', '>@(compile_flags)', |
+ '>@(defines)', '-DNACL_BUILD_SUBARCH=32', |
+ '--link_flags', '-B<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm >(link_flags)', |
+ '>@(sources)', |
+ ], |
+ }, |
+ ], |
+ }], |
+ ], |
+ }, |
+ }], |
['target_arch=="x64" or OS=="win"', { |
'target_defaults': { |
'target_conditions': [ |
+ ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', { |
+ 'variables': { |
+ 'tool_name': 'glibc', |
+ 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc', |
+ 'out64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe', |
+ 'objdir%': '>(INTERMEDIATE_DIR)/>(tool_name)-x86-64/>(_target_name)', |
+ }, |
+ 'actions': [ |
+ { |
+ 'action_name': 'build glibc x86-64 nexe', |
+ 'msvs_cygwin_shell': 0, |
+ 'description': 'building >(out64)', |
+ 'inputs': [ |
+ '<(DEPTH)/native_client/build/build_nexe.py', |
+ '<(DEPTH)/ppapi/ppapi_cpp.gypi', |
+ '>!@(>(get_sources) >(sources))', |
+ '>@(extra_deps64)', |
+ ], |
+ 'outputs': ['>(out64)'], |
+ 'action': [ |
+ '>(python_exe)', |
+ '<(DEPTH)/native_client/build/build_nexe.py', |
+ '>@(extra_args)', |
+ '--arch', 'x86-64', |
+ '--build', 'glibc_nexe', |
+ '--root', '<(DEPTH)', |
+ '--name', '>(out64)', |
+ '--objdir', '>(objdir)', |
+ '--include-dirs', '>(inst_dir)/include >(include_dirs) >(include_dirs)', |
+ '--lib-dirs', '>(lib_dirs) ', |
+ '--compile_flags', '-m64 >@(compile_flags) ', |
+ '>@(defines)', '-DNACL_BUILD_SUBARCH=64', |
+ '--link_flags', '-B<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64 >(link_flags) ', |
+ '>@(sources)', |
+ ], |
+ }, |
+ ], |
+ }], |
+ ], |
+ }, |
+ }], |
+ ['target_arch=="x64" or OS=="win"', { |
+ 'target_defaults': { |
+ 'target_conditions': [ |
['nlib_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', { |
'variables': { |
'tool_name': 'glibc', |