Building all packages using the released toolchain


Rick De Laet <rdelaet@...>
 

I am new to yocto, I have installed yacto on Fedora 12.

I was trying to follow the steps in the getting started guide and was
trying a build with "bitbake make-native" and got some build errors in
"elfutils", but it was using the compiler in my Fedora distribution. I
have also downloaded the toolchain in /opt/poky, and manually reran
configure in the elfutils to use the compilers in /opt/poky and it built
fine.

What config changes do I have to make so that bitbake builds everything
using the toolchain compilers rather than the default gcc? (i.e have it
run each configure script so that it specifies the toolchain compiler
rather than use the default compiler)

I did run the environment script

/opt/poky/environment-setup-i586-poky-linux

but apparently more is required

Thanks in advance,

Rick.


Tian, Kevin <kevin.tian@...>
 

From: Rick De Laet
Sent: Thursday, January 13, 2011 9:22 AM

I am new to yocto, I have installed yacto on Fedora 12.

I was trying to follow the steps in the getting started guide and was
trying a build with "bitbake make-native" and got some build errors in
"elfutils", but it was using the compiler in my Fedora distribution. I
The make-native is required on Fedora14. So you don't need that step and
Instead you could directly:
Bitbake poky-image-sato

Btw, could you post your errors?

For native packages, yes the host compiler from your distribution is expected btw.

have also downloaded the toolchain in /opt/poky, and manually reran
configure in the elfutils to use the compilers in /opt/poky and it built
fine.

What config changes do I have to make so that bitbake builds everything
using the toolchain compilers rather than the default gcc? (i.e have it
run each configure script so that it specifies the toolchain compiler
rather than use the default compiler)

I did run the environment script

/opt/poky/environment-setup-i586-poky-linux

but apparently more is required
This makes me a bit confused what you're tempting to do. Did you try to build
a complete sato image, or want to use pre-built image and downloard toolchain
to develop application? For the former you don't need the later /opt/poky
stuff. For the latter you don't need build any native packages since all the toolchains
are already there.

Thanks
Kevin s


Rick De Laet <rdelaet@...>
 

On Thu, 2011-01-13 at 10:32 +0800, Tian, Kevin wrote:
From: Rick De Laet
Sent: Thursday, January 13, 2011 9:22 AM

I am new to yocto, I have installed yacto on Fedora 12.

I was trying to follow the steps in the getting started guide and was
trying a build with "bitbake make-native" and got some build errors in
"elfutils", but it was using the compiler in my Fedora distribution. I
The make-native is required on Fedora14. So you don't need that step and
Instead you could directly:
Bitbake poky-image-sato
Ok. I was not sure if it was specific to Fedora 14 or not. The Quick
Start mentions Fedora 14 "or another distribution with GNU make 3.82"
which is what I have on Fedora 12, so I thought this step would be
required.


Why is this only required on Fedora 14?

BTW, I did run Bitbake poky-image-sato, and I got a similar error to
below, but in a different directory


Btw, could you post your errors?
My gcc version is 4.4.4, the latest available from yum update for Fedora
12. My poky-4.0-build/conf/local.conf is attached.

My error building the elfutils directory is shown below:

| ccache gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-fgnu89-inline -Wformat=2
-isystem/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/include -O2
-rdynamic -L/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-O1 -o ld ld.o ldgeneric.o ldlex.o ldscript.o symbolhash.o
sectionhash.o
versionhash.o ../libebl/libebl.a ../libelf/libelf.so ../lib/libeu.a
-ldl
| ccache gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-fgnu89-inline -Wformat=2
-isystem/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/include -O2
-Wl,-rpath-link,../libelf:../libdw
-L/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-O1 -o elflint
elflint.o ../libebl/libebl.a ../libelf/libelf.so ../lib/libeu.a -ldl
| ldgeneric.o: In function `ld_generic_open_outfile':
| ldgeneric.c:(.text+0x8f62): warning: the use of `mktemp' is dangerous,
better use `mkstemp'
| ./ld: invalid option -- 'p'
| Try `ld --help' or `ld --usage' for more information.
| collect2: ld returned 64 exit status
| make[2]: *** [elflint] Error 1
| ccache gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-fgnu89-inline -Wformat=2
-isystem/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/include -O2
-Wl,-rpath-link,../libelf:../libdw
-L/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-O1 -o findtextrel
findtextrel.o ../libdw/libdw.so ../libelf/libelf.so
| ./ld: invalid option -- 'p'
| Try `ld --help' or `ld --usage' for more information.
| collect2: ld returned 64 exit status
| make[2]: *** [findtextrel] Error 1
| rm i386_ld.o
| make[2]: Leaving directory
`/lfs/poky/poky-4.0-build/tmp/work/i686-linux/elfutils-native-0.148-r1/elfutils-0.148/src'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory
`/lfs/poky/poky-4.0-build/tmp/work/i686-linux/elfutils-native-0.148-r1/elfutils-0.148'
| make: *** [all] Error 2
| FATAL: oe_runmake failed
| ERROR: Task failed: ('function do_compile failed',
'/lfs/poky/poky-4.0-build/tmp/work/i686-linux/elfutils-native-0.148-r1/temp/log.do_compile.26312')
NOTE: package elfutils-native-0.148-r1: task do_compile: Failed
ERROR: Task 283
(virtual:native:/lfs/poky/poky-laverne-4.0/meta/recipes-devtools/elfutils/elfutils_0.148.bb, do_compile) failed with 1



For native packages, yes the host compiler from your distribution is expected btw.

have also downloaded the toolchain in /opt/poky, and manually reran
configure in the elfutils to use the compilers in /opt/poky and it built
fine.

What config changes do I have to make so that bitbake builds everything
using the toolchain compilers rather than the default gcc? (i.e have it
run each configure script so that it specifies the toolchain compiler
rather than use the default compiler)

I did run the environment script

/opt/poky/environment-setup-i586-poky-linux

but apparently more is required
This makes me a bit confused what you're tempting to do. Did you try to build
a complete sato image, or want to use pre-built image and downloard toolchain
to develop application? For the former you don't need the later /opt/poky
stuff. For the latter you don't need build any native packages since all the toolchains
are already there.
Long term what I want to do is build an embedded linux system from
scratch to run on our own hardware.

I only found out about yacto today through searching around the Intel
EDC web site. We have the Intel Atom based eval board (EG20T) with
Tunnel Creek and saw today that this is a newly supported platform in
yocto so I was very anxious to try it out. I thought it would be best
to first try and build a standard configuration first just to learn the
tool, so short term, yes, I want to build the complete sato image. We
are building our own Intal Atom/ Tunnel Creek embedded platform and on
the surface it looks like yacto is a perfect fit. Trying to decide now
if commercial linux is required or if something like yocto will work.

For developing embedded products I like the idea of having an "isolated"
toolchain so I can built a consistent product, regardless of what
updates I do to my laptop distribution. So is there a way to configure
yocto to use the /opt/poky toolchain rather than the fedora tools?


Thanks
Kevin s


Tian, Kevin <kevin.tian@...>
 

From: Rick De Laet [mailto:rdelaet@...]
Sent: Thursday, January 13, 2011 12:12 PM

On Thu, 2011-01-13 at 10:32 +0800, Tian, Kevin wrote:
From: Rick De Laet
Sent: Thursday, January 13, 2011 9:22 AM

I am new to yocto, I have installed yacto on Fedora 12.

I was trying to follow the steps in the getting started guide and
was trying a build with "bitbake make-native" and got some build
errors in "elfutils", but it was using the compiler in my Fedora
distribution. I
The make-native is required on Fedora14. So you don't need that step
and Instead you could directly:
Bitbake poky-image-sato
Ok. I was not sure if it was specific to Fedora 14 or not. The Quick Start
mentions Fedora 14 "or another distribution with GNU make 3.82"
which is what I have on Fedora 12, so I thought this step would be required.


Why is this only required on Fedora 14?
Yes, it's make 3.82 related. My gut-feeling is that FC12 should have an older version
which ends up wrong here. :-)


BTW, I did run Bitbake poky-image-sato, and I got a similar error to below, but
in a different directory


Btw, could you post your errors?
My gcc version is 4.4.4, the latest available from yum update for Fedora 12.
My poky-4.0-build/conf/local.conf is attached.
OK, I remembered that there're a series of patches to make FC14 happy after Laverne
release:
https://lists.yoctoproject.org/pipermail/poky/2010-December/001023.html

So it's better you can try the poky master for your experiment here:
git://git.pokylinux.org/poky.git

Thanks
Kevin


My error building the elfutils directory is shown below:

| ccache gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-fgnu89-inline -Wformat=2
-isystem/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/include -O2
-rdynamic -L/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-O1 -o ld ld.o ldgeneric.o ldlex.o ldscript.o symbolhash.o sectionhash.o
versionhash.o ../libebl/libebl.a ../libelf/libelf.so ../lib/libeu.a -ldl
| ccache gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-fgnu89-inline -Wformat=2
-isystem/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/include -O2
-Wl,-rpath-link,../libelf:../libdw
-L/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-O1 -o elflint
elflint.o ../libebl/libebl.a ../libelf/libelf.so ../lib/libeu.a -ldl
| ldgeneric.o: In function `ld_generic_open_outfile':
| ldgeneric.c:(.text+0x8f62): warning: the use of `mktemp' is dangerous,
better use `mkstemp'
| ./ld: invalid option -- 'p'
| Try `ld --help' or `ld --usage' for more information.
| collect2: ld returned 64 exit status
| make[2]: *** [elflint] Error 1
| ccache gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-fgnu89-inline -Wformat=2
-isystem/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/include -O2
-Wl,-rpath-link,../libelf:../libdw
-L/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-rpath,/lfs/poky/poky-4.0-build/tmp/sysroots/i686-linux/usr/lib
-Wl,-O1 -o findtextrel
findtextrel.o ../libdw/libdw.so ../libelf/libelf.so
| ./ld: invalid option -- 'p'
| Try `ld --help' or `ld --usage' for more information.
| collect2: ld returned 64 exit status
| make[2]: *** [findtextrel] Error 1
| rm i386_ld.o
| make[2]: Leaving directory
`/lfs/poky/poky-4.0-build/tmp/work/i686-linux/elfutils-native-0.148-r1/elfutils-0.
148/src'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory
`/lfs/poky/poky-4.0-build/tmp/work/i686-linux/elfutils-native-0.148-r1/elfutils-0.
148'
| make: *** [all] Error 2
| FATAL: oe_runmake failed
| ERROR: Task failed: ('function do_compile failed',
'/lfs/poky/poky-4.0-build/tmp/work/i686-linux/elfutils-native-0.148-r1/temp/log
.do_compile.26312')
NOTE: package elfutils-native-0.148-r1: task do_compile: Failed
ERROR: Task 283
(virtual:native:/lfs/poky/poky-laverne-4.0/meta/recipes-devtools/elfutils/elfutil
s_0.148.bb, do_compile) failed with 1



For native packages, yes the host compiler from your distribution is expected
btw.

have also downloaded the toolchain in /opt/poky, and manually reran
configure in the elfutils to use the compilers in /opt/poky and it
built fine.

What config changes do I have to make so that bitbake builds
everything using the toolchain compilers rather than the default
gcc? (i.e have it run each configure script so that it specifies
the toolchain compiler rather than use the default compiler)

I did run the environment script

/opt/poky/environment-setup-i586-poky-linux

but apparently more is required
This makes me a bit confused what you're tempting to do. Did you try
to build a complete sato image, or want to use pre-built image and
downloard toolchain to develop application? For the former you don't
need the later /opt/poky stuff. For the latter you don't need build
any native packages since all the toolchains are already there.
Long term what I want to do is build an embedded linux system from scratch to
run on our own hardware.

I only found out about yacto today through searching around the Intel EDC web
site. We have the Intel Atom based eval board (EG20T) with Tunnel Creek and
saw today that this is a newly supported platform in yocto so I was very anxious
to try it out. I thought it would be best to first try and build a standard
configuration first just to learn the
tool, so short term, yes, I want to build the complete sato image. We
are building our own Intal Atom/ Tunnel Creek embedded platform and on the
surface it looks like yacto is a perfect fit. Trying to decide now if commercial
linux is required or if something like yocto will work.

For developing embedded products I like the idea of having an "isolated"
toolchain so I can built a consistent product, regardless of what updates I do to
my laptop distribution. So is there a way to configure yocto to use the
/opt/poky toolchain rather than the fedora tools?


Thanks
Kevin s


Tian, Kevin <kevin.tian@...>
 

From: Rick De Laet [mailto:rdelaet@...]
Sent: Thursday, January 13, 2011 11:37 PM

Btw, could you post your errors?
My gcc version is 4.4.4, the latest available from yum update for Fedora 12.
My poky-4.0-build/conf/local.conf is attached.
OK, I remembered that there're a series of patches to make FC14 happy after
Laverne
release:
https://lists.yoctoproject.org/pipermail/poky/2010-December/001023.ht
ml

So it's better you can try the poky master for your experiment here:
git://git.pokylinux.org/poky.git

Thanks
Kevin
I assume that the way I get the master is with the following command:

git clone git://git.pokylinux.org/poky.git
Yes.


or is there an additional option to get the "master" branch? I tried
the above and have the same build error
Poky.git is a repo which contains a bunch of branches. One simple way you can verify
is to use "git branch", and if "*master" is shown then you're using the master branch.

If it still doesn't work for you, it ends up to other issues. I did another round of read on
original fedora 14 mail thread. It looks that your error is a little bit different to that
one:
(yours) ./ld: invalid option -- 'p'
(original) ./ld: unrecognized option '--no-add-needed'

The common point is that elfutils's own ./ld is used which supports less options and thus
Triggers the error. You can look at the bugzilla here:
http://bugzilla.pokylinux.org/show_bug.cgi?id=572

Wolfgang has "." included in his PATH which is before /bin and /usr/bin. Ideally this
has been fixed by commit 68030f4 (I had a quick test that "." does be warned out in
master branch). Yours looks similar and I'm not sure how local ".ld" is referenced here.
Could you post your PATH variable from your build directory?

BTW, I missed the latter part in your last post, and thus reply here:

Long term what I want to do is build an embedded linux system from scratch
to
run on our own hardware.

I only found out about yacto today through searching around the Intel EDC
web
http://yoctoproject.org/ is the project homepage.

site. We have the Intel Atom based eval board (EG20T) with Tunnel Creek
and
saw today that this is a newly supported platform in yocto so I was very
anxious
Good to know that. :-)

to try it out. I thought it would be best to first try and build a standard
configuration first just to learn the
tool, so short term, yes, I want to build the complete sato image. We
are building our own Intal Atom/ Tunnel Creek embedded platform and on the
surface it looks like yacto is a perfect fit. Trying to decide now if commercial
linux is required or if something like yocto will work.
Yes, Yocto is a perfect choice for your prototype purpose here.


For developing embedded products I like the idea of having an "isolated"
toolchain so I can built a consistent product, regardless of what updates I do
to
my laptop distribution. So is there a way to configure yocto to use the
/opt/poky toolchain rather than the fedora tools?
For this you can refer to Yocto development manual:
http://www.yoctoproject.org/docs/poky-ref-manual/poky-ref-manual.html

CH5 provides guidance to use /opt/poky toolchain for application development.
However we don't have doc now about using an external toolchain to compile
the whole yocto yet, though it does be supported. The closest info you could
refer to now is the openembedded manual (CH5.5). Could you fill a bug for this
documentation requirement? We'll address that in coming release.

But there may be one confusion I'd like to clarify here. What /opt/poky contains
are a set of cross-toolchains which are used to compile binaries running on the
target machine. For them Fedora doesn't provide. On the other hand, for the
make-native/elfutils-native, which are running on the build host, they have to
be compiled with Fedora toolchains which is the starting point of the whole
yocto build process. :-)

Thanks,
Kevin