Bug 12431

Summary: eclipse-poky using host gcc/g++ for indexing
Product: [Yocto Project Subprojects] Eclipse Plugin Reporter: Chin Huat Ang <chin.huat.ang>
Component: eclipse-pluginAssignee: Chin Huat Ang <chin.huat.ang>
Status: CLOSED WONTFIX QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: normal    
Priority: Medium+ CC: ioanax.grigoropol, richard.purdie, yp.ep.watcher, yp.watcher
Version: 2.4.1   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Incorrect include paths listed in project explorer view, incorrect header files resolved in editor view. none

Description Chin Huat Ang 2017-12-19 09:19:11 UTC
Created attachment 4156 [details]
Incorrect include paths listed in project explorer view, incorrect header files resolved in editor view.

To reproduce:

1. Create Yocto Project SDK Autotools ANSI C or C++ project
2. Build the project and expand "Includes" to inspect include paths

Observations:

1. All include paths begins with /usr, e.g. /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include
2. Double-clicking include headers like <iostream> or <stdio.h> would resolve to host locations, e.g. /usr/include/c++/6.3.1/iostream
Comment 1 Chin Huat Ang 2018-02-01 07:07:44 UTC
Apparently eclipse-poky still uses the following to discover include paths:

gcc  -E -P -v -dD "/home/parallels/eclipse-workspace/eclipse-committers-oxygen-R-linux-gtk-x86_64/runtime-New_configuration/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.c"

The gcc command appears to be missing the target prefix.
Comment 2 Chin Huat Ang 2018-02-01 12:11:48 UTC
The command used by CDT to dump compiler spec is user configuration in project properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers -> CDT GCC Built-in Compiler Settings:

${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"

We might need a way to programmatically set this, presumably when YoctoSDKAutotoolsProjectNature is set to the project.
Comment 3 Armin Kuster 2019-05-23 15:00:13 UTC
eclipse has been dropped.
Comment 4 Armin Kuster 2019-05-23 15:06:55 UTC
closing