Cross compiling error with gcc-arm-none-eabi

username: Shawn_Cui
cooked: <p>– /Users/shawn/dev/gcc-arm-none-eabi/bin/arm-none-eabi-g++ /Users/shawn/dev/pytorch/torch/abi-check.cpp -o /Users/shawn/dev/pytorch/build_arm/abi-check</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libstdc++.a(cxx11-ios_failure.o): in function `(anonymous namespace)::__io_category_instance()’:</p>
<p>cxx11-ios_failure.cc:(.text._ZN12_GLOBAL__N_122__io_category_instanceEv+0xc): undefined reference to `__sync_synchronize’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libstdc++.a(cxx11-ios_failure.o): in function `std::iostream_category()’:</p>
<p>cxx11-ios_failure.cc:(.text._ZSt17iostream_categoryv+0xc): undefined reference to `__sync_synchronize’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit’:</p>
<p>exit.c:(.text.exit+0x2c): undefined reference to `_exit’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libstdc++.a(locale.o): in function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned int)’:</p>
<p>locale.cc:(.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEj+0x18): undefined reference to `__sync_synchronize’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libstdc++.a(locale_init.o): in function `std::locale::locale()’:</p>
<p>locale_init.cc:(.text._ZNSt6localeC2Ev+0x3c): undefined reference to `__sync_synchronize’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libstdc++.a(locale_init.o): in function `std::locale::global(std::locale const&amp;)’:</p>
<p>locale_init.cc:(.text.<em>ZNSt6locale6globalERKS</em>+0x2c): undefined reference to `__sync_synchronize’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-abort.o): in function `abort’:</p>
<p>abort.c:(.text.abort+0x10): undefined reference to `_exit’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-fstatr.o): in function `_fstat_r’:</p>
<p>fstatr.c:(.text._fstat_r+0x1c): undefined reference to `_fstat’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-openr.o): in function `_open_r’:</p>
<p>openr.c:(.text._open_r+0x24): undefined reference to `_open’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): in function `_sbrk_r’:</p>
<p>sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-signalr.o): in function `_kill_r’:</p>
<p>signalr.c:(.text._kill_r+0x1c): undefined reference to `_kill’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-signalr.o): in function `_getpid_r’:</p>
<p>signalr.c:(.text._getpid_r+0x4): undefined reference to `_getpid’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-writer.o): in function `_write_r’:</p>
<p>writer.c:(.text._write_r+0x24): undefined reference to `_write’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-closer.o): in function `_close_r’:</p>
<p>closer.c:(.text._close_r+0x18): undefined reference to `_close’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-isattyr.o): in function `_isatty_r’:</p>
<p>isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-lseekr.o): in function `_lseek_r’:</p>
<p>lseekr.c:(.text._lseek_r+0x24): undefined reference to `_lseek’</p>
<p>/Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: /Users/shawn/dev/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/libc.a(lib_a-readr.o): in function `_read_r’:</p>
<p>readr.c:(.text._read_r+0x24): undefined reference to `_read’</p>
<p>collect2: error: ld returned 1 exit status</p>
<p>CMake Error at caffe2/CMakeLists.txt:1151 (message):</p>
<p>Could not compile ABI Check: 1</p>