0

We want to build cobalt with arm toolchain for arm chip.

First, we reference this link "How to build for Raspberry Pi2"

Then, we set RASPI_HOME="./",create a folder "./sysroot", replace "raspi-1_" with "raspi-2_" in 1gyp_configuration.gypi1 and setup our arm toolchain in gyp_configuration.py.

but we got some error message as below,

Traceback (most recent call last):
  File "./gyp_cobalt", line 271, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./gyp_cobalt", line 261, in main
    gyp_return = gyp_runner.BuildConfig(config_name)
  File "./gyp_cobalt", line 175, in BuildConfig
    return gyp.main(args)
  File "/cobalt/cobalt-git/src/tools/gyp/pylib/gyp/__init__.py", line 541, in main
    return gyp_main(args)
  File "/cobalt/cobalt-git/src/tools/gyp/pylib/gyp/__init__.py", line 526, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/cobalt/cobalt-git/src/tools/gyp/pylib/gyp/generator/ninja.py", line 2277, in GenerateOutput
    user_config)
  File "/cobalt/cobalt-git/src/tools/gyp/pylib/gyp/generator/ninja.py", line 2223, in GenerateOutputForConfig
    spec, config_name, generator_flags)
  File "/cobalt/cobalt-git/src/tools/gyp/pylib/gyp/generator/ninja.py", line 405, in WriteSpec
    config = spec['configurations'][config_name]
KeyError: 'raspi-2_debug'

did we have to set other configuration correctly?

Community
  • 1
  • 1

1 Answers1

0

You must make sure that gyp_configuration.py and gyp_configuration.gypi contain the new platform configuration name ('raspi-2').

David Ghandehari
  • 534
  • 3
  • 12
  • thanks, it work. it still have other problem. ../../third_party/mozjs/js/src/assembler/wtf/Platform.h:354:6: error: #error "Not supported ARM architecture" # error "Not supported ARM architecture". did we lost some configuration ? – user7160805 Nov 15 '16 at 11:07
  • @user7160805 - It looks like it is trying to autodetect which ARM instruction set to use for JIT. You may have to set `-mcpu=cortex-a7` in your compiler flags so that `__ARM_ARCH_7A__` is defined by the compiler. This isn't something I've personally done before, so I don't know if that is sufficient, or if there further modifications required to make this work. – David Ghandehari Nov 15 '16 at 18:53