OSError: [Errno 12] Cannot allocate memory when cross-compiling for ARM on Trusty64 (14.04)

730 views
Skip to first unread message

joël maranhão

unread,
Jan 11, 2015, 6:18:24 AM1/11/15
to chromi...@chromium.org

Since I am failing to cross-compile on Precise64 (Ubuntu 12.04) here, I am trying to cross-compile on a Trustry64 (14.04) Vagrant box (provider VirtualBox)

My target FriendyARM mini210s with Linux 3.0.8 armv7l

Here are the steps suggested on stackexchange I went through several times which lead me to the same error:

1. mkdir -pv ~/chromium
2. cd ~/chromium
3. git config --global user.name “My Name”
4. git config --global user.email “your...@example.com
5. git config --global core.autocrlf false
6. git config --global core.filemode false
7. git config --global color.ui true
9. export PATH=$PATH:~/chromium/depot_tools See Update Notes 1
10. mkdir -v ~/chromium/buildhost 
11. cd ../buildhost 
12. fetch --nohooks chromium
13. cd src && ./build/install-build-deps.sh 
14. sudo apt-get install gcc-arm-linux-gnueabihf
15. sudo apt-get install g++-4.8-multilib-arm-linux-gnueabihf   (4.8 for Ubuntu 14.04)
16. ./build/install-build-deps.sh --arm 
17. export GYP_CROSSCOMPILE=1
18. export GYP_DEFINES="target_arch=arm arm_float_abi=hard component=shared_library linux_use_gold_flags=1"
19. gclient sync
20. gclient runhooks
21. ninja -C out/Debug chrome 

On step 19,  gclient sync gets stalled and goes on with the following error:

vagrant@vagrant-ubuntu-trusty-64:~/chromium/buildhost/src$ gclient sync
Syncing projects: 100% (82/82), done.                                            
________ running
'/usr/bin/python src/build/landmines.py' in '/vagrant_data/buildhost'
INFO
: Environment value for "GYP_DEFINES" overrides value in /vagrant_data/buildhost/chromium.gyp_env.
INFO
: Environment value for "GYP_CROSSCOMPILE" overrides value in /vagrant_data/buildhost/chromium.gyp_env.
________ running
'/usr/bin/python src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/build/download_sdk_extras.py' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py --linux-only' in '/vagrant_data/buildhost'
Debian Wheezy arm root image already up-to-date: /vagrant_data/buildhost/src/chrome/installer/linux/debian_wheezy_arm-sysroot
________ running
'/usr/bin/python src/build/vs_toolchain.py update' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/tools/clang/scripts/update.py --if-needed' in '/vagrant_data/buildhost'
Clang already at 223108-14
________ running
'/usr/bin/python src/build/util/lastchange.py -o src/build/util/LASTCHANGE' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/build/util/lastchange.py -s src/third_party/WebKit -o src/build/util/LASTCHANGE.blink' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-gn -s src/buildtools/win/gn.exe.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-gn -s src/buildtools/mac/gn.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-gn -s src/buildtools/linux32/gn.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-gn -s src/buildtools/linux64/gn.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-clang-format -s src/buildtools/linux64/clang-format.sha1' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/third_party/binutils/download.py' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-eu-strip -s src/build/linux/bin/eu-strip.sha1' in '/vagrant_data/buildhost'
________ running
'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-drmemory -s src/third_party/drmemory/drmemory-windows-sfx.exe.sha1' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/build/get_syzygy_binaries.py --output-dir=src/third_party/syzygy/binaries --revision=b92d590a9670f92b1223bcc9a334771ce95611cd --overwrite' in '/vagrant_data/buildhost'
INFO
:get_syzygy_binaries.py:Output directory does not exist, skipping cleanup.
________ running
'download_from_google_storage --no_resume --platform=win32 --directory --recursive --no_auth --num_threads=16 --bucket chromium-apache-win32 src/third_party/apache-win32' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/mojo/public/tools/download_shell_binary.py' in '/vagrant_data/buildhost'
________ running
'/usr/bin/python src/build/gyp_chromium' in '/vagrant_data/buildhost'
INFO
: Environment value for "GYP_DEFINES" overrides value in /vagrant_data/buildhost/chromium.gyp_env.
INFO
: Environment value for "GYP_CROSSCOMPILE" overrides value in /vagrant_data/buildhost/chromium.gyp_env.
Updating projects from gyp files...
Exception in thread Thread-4:

Traceback (most recent call last):
 
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
   
self.run()
 
File "/usr/lib/python2.7/threading.py", line 763, in run
   
self.__target(*self.__args, **self.__kwargs)
 
File "/usr/lib/python2.7/multiprocessing/pool.py", line 326, in _handle_workers
    pool
._maintain_pool()
 
File "/usr/lib/python2.7/multiprocessing/pool.py", line 230, in _maintain_pool
   
self._repopulate_pool()
 
File "/usr/lib/python2.7/multiprocessing/pool.py", line 223, in _repopulate_pool
    w
.start()
 
File "/usr/lib/python2.7/multiprocessing/process.py", line 130, in start
   
self._popen = Popen(self)
 
File "/usr/lib/python2.7/multiprocessing/forking.py", line 121, in __init__
   
self.pid = os.fork()

OSError: [Errno 12] Cannot allocate memory


Note that the process doesn't die, it's still going, but doesn't give any pointers at whether it is actually doing anything.


Jakob Kummerow

unread,
Jan 11, 2015, 8:08:01 AM1/11/15
to joel.m...@gmail.com, chromium-dev
"OSError: [Errno 12] Cannot allocate memory" sounds like your Vagrant VM doesn't have enough memory.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

joël maranhão

unread,
Jan 11, 2015, 8:28:14 AM1/11/15
to chromi...@chromium.org, joel.m...@gmail.com
I monitored the memory and it didn't look like it was the problem.

Ok I will double the memory size

 config.vm.provider "virtualbox" do |vb|

    vb
.customize ["modifyvm", :id, "--memory", "1024"]

 
end


and it worked!!! thanks

joël maranhão

unread,
Jan 11, 2015, 12:56:06 PM1/11/15
to chromi...@chromium.org, joel.m...@gmail.com
Yes increasing the memory worked out but then the compilation failed later with this error message

vagrant@vagrant-ubuntu-trusty-64:/vagrant_data/buildhost/src$ ninja -C out/Debug chrome

 

ninja
: Entering directory `out/Debug'

[66/18785] CXX obj/mojo/public/cpp/bindings/lib/mojo_cpp_bindings.array_internal.o

FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/mojo/public/cpp/bindings/lib/mojo_cpp_bindings.array_internal.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=223108 -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -D_GLIBCXX_DEBUG=1 -Igen -I../.. -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /vagrant_data/buildhost/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang strict-virtual-specifiers -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -target arm-linux-gnueabihf -march=armv7-a -no-integrated-as -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb --sysroot=/vagrant_data/buildhost/src/chrome/installer/linux/debian_wheezy_arm-sysroot -O0 -g -gdwarf-4 -funwind-tables -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -std=gnu++11  -c ../../mojo/public/cpp/bindings/lib/array_internal.cc -o obj/mojo/public/cpp/bindings/lib/mojo_cpp_bindings.array_internal.o

/tmp/array_internal-227b6c.s: Assembler messages:

/tmp/array_internal-227b6c.s:1180: Internal error!

Assertion failure in get_line_subseg at ../../gas/dwarf2dbg.c line 271.

Please report this bug.

clang: error: assembler command failed with exit code 1 (use -v to see invocation)

[66/18785] CXX obj/mojo/public/cpp/bindings/lib/mojo_cpp_bindings.message_queue.o

ninja: build stopped: subcommand failed.





Le dimanche 11 janvier 2015 14:08:01 UTC+1, Jakob Kummerow a écrit :

Jakob Kummerow

unread,
Jan 12, 2015, 4:46:09 AM1/12/15
to joël maranhão, chromium-dev
If you enter terms like "internal error" "get_line_subseg" "dwarf2dbg.c" into your favorite search engine, it will find e.g. http://comments.gmane.org/gmane.comp.compilers.clang.scm/109551, which appears to suggest that you have two options:
(1) compile with GCC instead of clang (add "clang=0" to GYP_DEFINES)
(2) build in Release mode

I would also expect that you'll need at least 4GB of memory to build successfully.

joël maranhão

unread,
Jan 12, 2015, 5:39:29 AM1/12/15
to chromi...@chromium.org, joel.m...@gmail.com
Saisissez le code ici...

Thanks for pointing out the article. Appreciated.

- Increase the memory of my VM to 4096
- Added  "clang=0" to GYP_DEFINES"
- Built in Release mode after gclient synch

and I still getting errors ... it never ends.

I tried both in Debug and Release mode:

vagrant@vagrant:/vagrant_data/buildhost/src$ ninja -C out/Release chrome


ninja
: Entering directory `out/Release'

[110/18785] ACTION Munging ELF program header

FAILED: cd ../../native_client/src/trusted/service_runtime/linux; python nacl_bootstrap_munge_phdr.py ../../../../../out/Release/nacl_bootstrap_raw ../../../../../out/Release/nacl_helper_bootstrap


Traceback (most recent call last):

  File "nacl_bootstrap_munge_phdr.py", line 241, in <module>

    sys.exit(main(sys.argv[1:]))

  File "nacl_bootstrap_munge_phdr.py", line 234, in main

    return RunMain(args)

  File "nacl_bootstrap_munge_phdr.py", line 217, in RunMain

    elf_map = mmap.mmap(fd.fileno(), 0)

mmap.error: [Errno 22] Invalid argument

[110/18785] AR obj/third_party/libsrtp/libsrtp.a


ninja: build stopped: subcommand failed.

vagrant@vagrant:/vagrant_data/buildhost/src$ ninja -C out/Debug chrome

ninja: Entering directory `
out/Debug'

[110/18785] ACTION Munging ELF program header

FAILED: cd ../../native_client/src/trusted/service_runtime/linux; python nacl_bootstrap_munge_phdr.py ../../../../../out/Debug/nacl_bootstrap_raw ../../../../../out/Debug/nacl_helper_bootstrap


Traceback (most recent call last):

  File "nacl_bootstrap_munge_phdr.py", line 241, in <module>

    sys.exit(main(sys.argv[1:]))

  File "nacl_bootstrap_munge_phdr.py", line 234, in main

    return RunMain(args)

  File "nacl_bootstrap_munge_phdr.py", line 217, in RunMain

    elf_map = mmap.mmap(fd.fileno(), 0)

mmap.error: [Errno 22] Invalid argument

[110/18785] AR obj/third_party/libsrtp/libsrtp.a


ninja: build stopped: subcommand failed.
Reply all
Reply to author
Forward
0 new messages