Bug 7462 - SDKTARGETSYSROOT is trimmed to DKTARGETSYSROOT
Summary: SDKTARGETSYSROOT is trimmed to DKTARGETSYSROOT
Status: RESOLVED FIXED
Alias: None
Product: Eclipse Plugin
Classification: Yocto Project Subprojects
Component: eclipse-plugin (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Undecided major
Target Milestone: ---
Assignee: Todor Minchev
QA Contact: Mihail Stanciu
URL: https://lists.yoctoproject.org/piperm...
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-03-16 13:48 UTC by Todor Minchev
Modified: 2015-03-17 10:35 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Todor Minchev 2015-03-16 13:48:53 UTC
I am using version 1.6.2 of the Yocto Eclipse plug-in (from http://downloads.yoctoproject.org/releases/eclipse-plugin/1.6.2/kepler/) under Fedora 21.  After some recent issues with getting the plug-in to compile my application, I noticed that I am having a variable expansion problem with CC.

I followed the instructions for building an SDK for my image and I am using the pre-built toolchain.  In the environment script for the SDK, CC is defined as follows:

        export CC="arm-poky-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=$SDKTARGETSYSROOT"

I then generate new a simple Yocto Hello World C project and build the application.  It builds just fine, but I see the following in the console output:

        arm-poky-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=DKTARGETSYSROOT 

However, if I go to Project->Properties->C/C++ Build->Environment and change the CC environment variable to the following:

        arm-poky-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=${SDKTARGETSYSROOT}

then the SDKTARGETSYSROOT is properly expanded to the correct value.  Is anyone else seeing this problem, or is this due to the version of tools that exist on Fedora 21?
Comment 1 Bevenson 2015-03-16 14:29:39 UTC
I took a further look at this issue on my system, and I'm wondering if the issue is not limited to the Eclipse plugin but may be affected by anything using the environment setup script.  In my script (environment-setup-arm926ejste-poky-linux-gnueabi) I see the following references to SDKTARGETSYSROOT:

export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig
export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
export CC="arm-poky-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=$SDKTARGETSYSROOT"
export CXX="arm-poky-linux-gnueabi-g++  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=$SDKTARGETSYSROOT"
export CPP="arm-poky-linux-gnueabi-gcc -E  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=$SDKTARGETSYSROOT"
export LD="arm-poky-linux-gnueabi-ld  --sysroot=$SDKTARGETSYSROOT"
export CONFIGURE_FLAGS="--target=arm-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"

Note that some are in double quotes and some are not.  I don't which is correct, but I believe they should be consistent.
Comment 2 Todor Minchev 2015-03-16 17:01:41 UTC
The actual problem is that variables will only be expanded in a Makefile if they are in parentheses or braces as in $(var_name) or ${var_name}.

The autotools plugin uses the literal(unexpanded) values of the environment variables when it generates the Makefiles. 

This only works in its current form, because we have overlapping "--sysroot=" entries. I have a fix for this and will apply it to all versions of the plugin.  

Thanks again for reporting this bug.
Comment 3 Todor Minchev 2015-03-17 10:35:37 UTC
Fixed in luna with: d97b40d43

Fixed in kepler with: 02aa20e1
Comment 4 Todor Minchev 2015-03-17 10:35:59 UTC
Fixed in luna with: d97b40d43

Fixed in kepler with: 02aa20e1