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

xtools build hard-coded to use IAMCU compiler for all x86 targets #6911

Closed
andrewboie opened this issue Apr 3, 2018 · 4 comments
Closed
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@andrewboie
Copy link
Contributor

I have brew binutils 2.30 installed, but it installs it as "greadelf" and not "readelf" and CMake can't find it. Creating a symlink did not help.

CMake Error at /Users/andrew/zephyr/cmake/extensions.cmake:984 (message): No such file or directory: CMAKE_READELF: 'CMAKE_READELF-NOTFOUND' Call Stack (most recent call first): /Users/andrew/zephyr/cmake/compiler/gcc.cmake:14 (assert_exists) /Users/andrew/zephyr/cmake/toolchain.cmake:38 (include) /Users/andrew/zephyr/cmake/app/boilerplate.cmake:242 (include) CMakeLists.txt:1 (include)

@nashif nashif added the bug The issue is a bug, or the PR is fixing a bug label Apr 4, 2018
@andrewboie
Copy link
Contributor Author

Looking at CMakeCache.txt, it can't find any of the toolchain executables.

$ cat CMakeCache.txt | grep NOTFOUND
CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND
CMAKE_C_COMPILER:FILEPATH=CMAKE_C_COMPILER-NOTFOUND
CMAKE_GDB:FILEPATH=CMAKE_GDB-NOTFOUND
CMAKE_NM:FILEPATH=CMAKE_NM-NOTFOUND
CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND
CMAKE_OBJDUMP:FILEPATH=CMAKE_OBJDUMP-NOTFOUND
CMAKE_RANLIB:FILEPATH=CMAKE_RANLIB-NOTFOUND
CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND
OPENOCD:FILEPATH=OPENOCD-NOTFOUND

Is $CROSS_COMPILE not being set properly with xtools?

I have

$ env | grep TOOLCHAIN
XTOOLS_TOOLCHAIN_PATH=/Volumes/CrossToolNG/x-tools
ZEPHYR_TOOLCHAIN_VARIANT=xtools

Contents of my toolchain installation

https://pastebin.com/7mtiBAN9

@andrewboie
Copy link
Contributor Author

Our xtools.cmake is broken, it's hard-coded to use the IAMCU compiler for some reason for ALL x86 targets not just the ones that actually do use IAMCU (arduino_101, qemu_x86_iamcu). I had to change it:

diff --git a/cmake/toolchain/xtools.cmake b/cmake/toolchain/xtools.cmake
index 83107bae0..e6ed38605 100644
--- a/cmake/toolchain/xtools.cmake
+++ b/cmake/toolchain/xtools.cmake
@@ -7,7 +7,7 @@ set(TOOLCHAIN_HOME ${XTOOLS_TOOLCHAIN_PATH})
 set(COMPILER gcc)

 set(CROSS_COMPILE_TARGET_arm arm-none-eabi)
-set(CROSS_COMPILE_TARGET_x86 i586-zephyr-elfiamcu)
+set(CROSS_COMPILE_TARGET_x86 i586-zephyr-elf)

 set(CROSS_COMPILE_TARGET     ${CROSS_COMPILE_TARGET_${ARCH}})
 set(SYSROOT_TARGET           ${CROSS_COMPILE_TARGET})

@carlescufi carlescufi removed their assignment Apr 5, 2018
@andrewboie andrewboie changed the title OS X: CMAKE_READELF-NOTFOUND xtools build hard-coded to use IAMCU compiler for all x86 targers Apr 5, 2018
@andrewboie andrewboie changed the title xtools build hard-coded to use IAMCU compiler for all x86 targers xtools build hard-coded to use IAMCU compiler for all x86 targets Apr 5, 2018
@andrewboie
Copy link
Contributor Author

We could improve the error message too.

"CMake Error at /Users/andrew/zephyr/cmake/extensions.cmake:984 (message): No such file or directory: CMAKE_READELF: 'CMAKE_READELF-NOTFOUND'"

Actually means that the build can't find the toolchain.

@andrewboie
Copy link
Contributor Author

The error message is now a lot more useful.
I think it still shouldn't default to IAMCU for all x86 targets though.

nashif added a commit to nashif/zephyr that referenced this issue Apr 30, 2018
Add placeholders for all possible xtools toolchains.

Fixes zephyrproject-rtos#6911

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
nashif added a commit that referenced this issue Apr 30, 2018
Add placeholders for all possible xtools toolchains.

Fixes #6911

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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