Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build Arduino_101 on Mac following instructions #5807

Closed
jimmy-huang opened this issue Jan 24, 2018 · 4 comments
Closed

Can't build Arduino_101 on Mac following instructions #5807

jimmy-huang opened this issue Jan 24, 2018 · 4 comments
Assignees
Labels
area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Milestone

Comments

@jimmy-huang
Copy link
Contributor

Using the 1.10.0 release, after I build crosstool-ng, I am unable to build the arduino_101 target on MacOS Sierra:

It first said that it can't find the toolchain:
-- Generating zephyr/include/generated/autoconf.h
CMake Error at /Users/zhuang1/projects/zephyrjs/zephyr.js/deps/zephyr/cmake/extensions.cmake:811 (message):
No such file or directory: CMAKE_READELF:
'/Volumes/CrossToolNG/x-tools/i586-zephyr-elfiamcu/bin/i586-zephyr-elfiamcu-readelf'

So it turns out that after building crosstool-ng, the tool chain is located under
/Volumes/CrossToolNG/x-tools/i586-zephyr-elf/i586-zephyr-elf

So I commented out this line at cmake/toolchain-xtools.cmake:
#set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)

then I I pass in the actual path:
cmake -DBOARD=arduino_101 -DCROSS_COMPILE=/Volumes/CrossToolNG/x-tools/i586-zephyr-elf/bin/i586-zephyr-elf- ..

then it fails to build with make:

[ 92%] Linking C executable zephyr_prebuilt.elf
/Volumes/CrossToolNG/x-tools/i586-zephyr-elf/lib/gcc/i586-zephyr-elf/6.3.0/../../../../i586-zephyr-elf/bin/ld: Warning: size of symbol `main' changed from 22 in ../libapp.a(main.c.obj) to 5 in kernel/libkernel.a(init.c.obj)
/Volumes/CrossToolNG/x-tools/i586-zephyr-elf/lib/gcc/i586-zephyr-elf/6.3.0/../../../../i586-zephyr-elf/bin/ld: skipping incompatible /Volumes/CrossToolNG/x-tools/i586-zephyr-elf/lib/gcc/i586-zephyr-elf/6.3.0/libgcc.a when searching for -lgcc
/Volumes/CrossToolNG/x-tools/i586-zephyr-elf/lib/gcc/i586-zephyr-elf/6.3.0/../../../../i586-zephyr-elf/bin/ld: skipping incompatible /Volumes/CrossToolNG/x-tools/i586-zephyr-elf/lib/gcc/i586-zephyr-elf/6.3.0/libgcc.a when searching for -lgcc
/Volumes/CrossToolNG/x-tools/i586-zephyr-elf/lib/gcc/i586-zephyr-elf/6.3.0/../../../../i586-zephyr-elf/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
make: *** [all] Error 2

@SebastianBoe
Copy link
Collaborator

Hi,

I think that when following the instructions a toolchain for i586 was built. But arduino_101 requires an iamcu toolchain.

At this step:

cp ${ZEPHYR_BASE}/scripts/cross_compiler/i586.config .config

try copying iamcu.config instead. See http://docs.zephyrproject.org/getting_started/installation_mac.html#setting-the-toolchain-options

@SebastianBoe
Copy link
Collaborator

@dbkinder : Documentation might be ambiguous, example instructions were read as actual instructions:

http://docs.zephyrproject.org/getting_started/installation_mac.html#setting-the-toolchain-options

Currently the following configurations are provided:

i586.config: for standard ABI, for example for Galileo and qemu_x86
iamcu.config: for IAMCU ABI, for example for the Arduino 101
nios2.config: for Nios II boards
cp ${ZEPHYR_BASE}/scripts/cross_compiler/i586.config .config

@jimmy-huang
Copy link
Contributor Author

Yes, I did copy the iamcu.config and built that instead. I use the i586.config to build QEMU, and I had similar issues, and I had to modify the cmake as well, to get that working. I was going to file a bug for that as well, but eventually I figured out how to get that to build at least. You can see the instructions including work-arounds we have to do to get QEMU working here, but A101 we are still not sure.

intel/zephyr.js#1780

@nashif nashif added the bug The issue is a bug, or the PR is fixing a bug label Feb 6, 2018
@nashif nashif self-assigned this Feb 6, 2018
@nashif nashif added the priority: low Low impact/importance bug label Feb 6, 2018
@nashif nashif added this to the v1.11.0 milestone Feb 6, 2018
@carlescufi carlescufi modified the milestones: v1.11.0, v1.12.0 Mar 9, 2018
@nashif
Copy link
Member

nashif commented Apr 30, 2018

duplicated by #6912

@nashif nashif closed this as completed Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants