Community
cancel
Showing results for 
Search instead for 
Did you mean: 
PSuta
Beginner
1,055 Views

How to use cross tool created by Edison yocto ? In yocto tree, where (directory) it is stored ?

Jump to solution

Yocto for Edison is built successfully on Ubuntu 18.10.

 

I am unable to use /find cross-tool for the board.

Tags (2)
0 Kudos
1 Solution
FerryT
Valued Contributor I
276 Views

Almost there. After you source the script CC is defined, as well as CFLAGS. So in my make file I have:

%.o: %.c $(CC) $(CFLAGS) -o $@ -c $<

 (hint: I currently have CC = i686-poky-linux-gcc -m32 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -mstackrealign --sysroot=/opt/poky-edison/2.6.1/sysroots/corei7-32-poky-linux, the crucial one is the sysroot I guess)

View solution in original post

5 Replies
FerryT
Valued Contributor I
276 Views

I'm trying to understand your question. Do you mean you built the sdk and want to know how to use that?

 

If so:

Make sdk builds an installer, that you can then install to another directory or computer. I'm too lazy for that, and don't want to waste that space on my machine twice. Instead I put a few links and it appears to work fine without further installation.

 

My instructions (for completely updated Yocto Sumo based image builder, but should work for the original layer as well) are here: https://edison-fw.github.io/meta-intel-edison/3-Building-the-SDK.html

PSuta
Beginner
276 Views

Yes I had already followed this link, and installed all bins and libs in /opt.

1 . Then I added /opt path in .bashrc file. In this case, I was able to see cross tool bins (be like x86*poky*gcc, etc). But when I try to use them, it said not found.

2 . Then for compilation, if I gave absolute path to cross tool bin in simple hello world program, it was not able to find <stdio.h>

FerryT
Valued Contributor I
276 Views

If you follow the instructions in the above link, you don't need to install things into /opt or .bashrc. Just create a link to where the sdk is. Example:

cd /opt sudo ln -s <your top dir>/out/linux64/build/tmp/work/edison-poky-linux/edison-image/1.0-r0/sdk/image/opt/poky-edison poky-edison

Then to make the script work, go to your work directory:

cd <your work dir> ln /opt/poky-edison/2.4.2 ./2.4.2

(2.4.2 is the Yocto version, so you need to figure out the correct one for you).

Now it appears as if the sdk is installed in ./2.4.2

 

To start using the sdk:

source ./2.4.2/environment-setup-core2-32-poky-linux

This sets paths and environment vars to use the sdk. You probably don't want that permanent, so don't put that in bashrc.

PSuta
Beginner
276 Views

I have followed

1 . cd /opt/

2 . sudo ln -s /home/prityaa/documents/workspace/boards/intel/edison/tools/yocto/my_Edison_Workspace/out/linux64/build/tmp/work/edison-poky-linux/edison-image/1.0-r0/sdk/image/opt/poky-edison poky-edison

3 . ~/documents/workspace/code_base/c (contains hello world program)

4 . ln -s /opt/poky-edison/2.6.1/ ./2.6.1 (hard link is not possible so -s)

5 . source 2.6.1/environment-setup-corei7-64-poky-linux

6 . 2.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc test.c

 

=>

test.c:1:11: fatal error: stdio.h: No such file or directory

 # include <stdio.h>

          ^~~~~~~~~

compilation terminated.

 

NOTE : hello world program .

 

I would like to compile some packages and sone c codes.

FerryT
Valued Contributor I
277 Views

Almost there. After you source the script CC is defined, as well as CFLAGS. So in my make file I have:

%.o: %.c $(CC) $(CFLAGS) -o $@ -c $<

 (hint: I currently have CC = i686-poky-linux-gcc -m32 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -mstackrealign --sysroot=/opt/poky-edison/2.6.1/sysroots/corei7-32-poky-linux, the crucial one is the sysroot I guess)

View solution in original post

Reply