Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Help optimizing cross-build options?(CDT managed & containerized cross-build)
Help optimizing cross-build options? [message #1842780] Thu, 01 July 2021 10:17
Philip Keller is currently offline Philip KellerFriend
Messages: 5
Registered: April 2013
Junior Member
I'm a newbie for this particular setup, and I'd appreciate some pointers:

  • Eclipse 2021-03, CDT 10.2 running on macOS 11.4
  • Yocto project with cross-GCC toolchain in Docker container
  • CDT managed build

I managed to get my build running, but my setup looks like a hack:

  • C/C++ Build > Settings > Cross Settings: Had to include entire toolchain path in Prefix setting, else gcc is not found. Path setting doesn't seem to have any effect. Yocto's development environment setup file sets up the path, but I can't figure out how to source it - see below.
  • C/C++ Build > Settings > Cross GCC Compiler > Dialect: Unable to figure out how to source Yocto's development environment setup file, which does an export CC="x86_64-poky-linux-gcc -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 --sysroot=$SDKTARGETSYSROOT". Instead, I copied the gcc options to the dialect settings.
  • C/C++ Build > Settings > Cross GCC Linker: Similarly, the setup file does export LD="x86_64-poky-linux-ld --sysroot=$SDKTARGETSYSROOT", and I ended up copying the --sysroot parameter into the Linker Options.
  • C/C++ Build > Settings > Cross GCC Compiler > Includes: Had to explicitly prefix the include path with the sysroot for directories in the system tree (e.g. /usr/include/glib-2.0).
  • Indexer: Doesn't find standard directories like <stdio.h>. In C/C++ General > Preprocessor Include Paths, Macros, etc. > Providers, I had by default "CDT User Setting Entries", "Exported Entries from Referenced Projects", "CDT Managed Build Setting Entries", "CDT Cross GCC Built-in Compiler Settings", and I added "CDT GCC Build Output Parser". Apparently it's not finding the include files copied over from the container.

Any tips from the pros? Thanks in advance!

I managed to "fix" the Indexer issue by completely erasing C/C++ Build > Settings > Cross Settings > Prefix. The only providers that actually do anything useful are "CDT Managed Build Setting Entries" (the include directories I supplied) and "CDT Cross GCC Built-in Compiler Settings" (all the system stuff). But what does the Cross Prefix have to do with all that???

[Updated on: Thu, 01 July 2021 10:48]

Report message to a moderator

Previous Topic:Eclipse and ESP32
Next Topic:assign MCU model on a configuration basis
Goto Forum:

Current Time: Sun Jul 03 06:43:22 GMT 2022

Powered by FUDForum. Page generated in 0.02110 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top