public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Problems with cross-compiling
@ 2016-03-25 12:35 Dan Johansson
  2016-03-25 13:00 ` Dan Johansson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Johansson @ 2016-03-25 12:35 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

I have setup one of my VM's to do cross-compiling for my Raspberry PI 2.
Now some packages (e.g. app-editors/vim and its dependencies) emerges
fine while other (e.g. net-misc/wget or rather one of its dependencies
dev-libs/libpcre-8.38:3) does not.

What I have done  is this:
# emerge sys-devel/crossdev
(installed sys-devel/crossdev-20150716)

# crossdev -S -P -v -t armv7a-hardfloat-linux-gnueabi
(which "installed" fine without any errors)

# armv7a-hardfloat-linux-gnueabi-emerge --verbose --oneshot
=net-misc/wget-1.16.3-r1

Which pulls in dev-libs/libpcre-8.38:3::gentoo which then fails with this:

ln -sf pcre_compile2.3
/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-libs/libpcre-8.38/image//usr/share/man/man3/pcre16_compile2.3
/usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping
incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping
incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/libc.a: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status


Have I missed something in setting up crossdev or is something else
wrong (if yes - then what is wrong)?

-- 
Dan Johansson, <http://www.dmj.nu>
***************************************************
This message is printed on 100% recycled electrons!
***************************************************


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4153 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Problems with cross-compiling
  2016-03-25 12:35 [gentoo-user] Problems with cross-compiling Dan Johansson
@ 2016-03-25 13:00 ` Dan Johansson
  2016-03-27  9:00   ` Andrew Savchenko
  2016-03-27  8:41 ` Andrew Savchenko
  2016-03-27 15:34 ` [gentoo-user] " James
  2 siblings, 1 reply; 6+ messages in thread
From: Dan Johansson @ 2016-03-25 13:00 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 3308 bytes --]

On 25.03.2016 13:35, Dan Johansson wrote:
> I have setup one of my VM's to do cross-compiling for my Raspberry PI 2.
> Now some packages (e.g. app-editors/vim and its dependencies) emerges
> fine while other (e.g. net-misc/wget or rather one of its dependencies
> dev-libs/libpcre-8.38:3) does not.
> 
> What I have done  is this:
> # emerge sys-devel/crossdev
> (installed sys-devel/crossdev-20150716)
> 
> # crossdev -S -P -v -t armv7a-hardfloat-linux-gnueabi
> (which "installed" fine without any errors)
> 
> # armv7a-hardfloat-linux-gnueabi-emerge --verbose --oneshot
> =net-misc/wget-1.16.3-r1
> 
> Which pulls in dev-libs/libpcre-8.38:3::gentoo which then fails with this:
> 
> ln -sf pcre_compile2.3
> /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-libs/libpcre-8.38/image//usr/share/man/man3/pcre16_compile2.3
> /usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping
> incompatible /usr/lib/libpthread.so when searching for -lpthread
> /usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping
> incompatible /usr/lib/libc.so when searching for -lc
> /usr/lib/libc.a: error adding symbols: File format not recognized
> collect2: error: ld returned 1 exit status
> 

Another one that is also failing (and is a dependency of many packages)
is sys-libs/ncurses-6.0-r1.
ncurses fails with another error than libpcre.

cd c++ && make DESTDIR="" RPATH_LIST="/usr/lib" all
make[1]: Entering directory
'/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0-.arm/ncurses/c++'
cd ../obj_s;   -DHAVE_CONFIG_H -I.
-I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++
-I../include
-I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++/../include
 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -DXTSTRINGDEFINES -DNDEBUG -O2
-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard  -fPIC -c
/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++/cursesf.cc
cd ../obj_s;   -DHAVE_CONFIG_H -I.
-I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++
-I../include
-I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++/../include
 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -DXTSTRINGDEFINES -DNDEBUG -O2
-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard  -fPIC -c
/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++/cursesm.cc
/bin/bash: -DHAVE_CONFIG_H: command not found
Makefile:366: recipe for target '../obj_s/cursesf.o' failed
make[1]: *** [../obj_s/cursesf.o] Error 127
make[1]: *** Waiting for unfinished jobs....
/bin/bash: -DHAVE_CONFIG_H: command not found
Makefile:372: recipe for target '../obj_s/cursesm.o' failed
make[1]: *** [../obj_s/cursesm.o] Error 127
make[1]: Leaving directory
'/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0-.arm/ncurses/c++'
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2




-- 
Dan Johansson, <http://www.dmj.nu>
***************************************************
This message is printed on 100% recycled electrons!
***************************************************


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4153 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Problems with cross-compiling
  2016-03-25 12:35 [gentoo-user] Problems with cross-compiling Dan Johansson
  2016-03-25 13:00 ` Dan Johansson
@ 2016-03-27  8:41 ` Andrew Savchenko
  2016-03-27 15:34 ` [gentoo-user] " James
  2 siblings, 0 replies; 6+ messages in thread
From: Andrew Savchenko @ 2016-03-27  8:41 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

Опц

On Fri, 25 Mar 2016 13:35:47 +0100 Dan Johansson wrote:
> I have setup one of my VM's to do cross-compiling for my Raspberry PI 2.
> Now some packages (e.g. app-editors/vim and its dependencies) emerges
> fine while other (e.g. net-misc/wget or rather one of its dependencies
> dev-libs/libpcre-8.38:3) does not.

Cross-compilation is a pain, really. Probably it will be easier and
faster to emulate CPU using qemu. Of course, if you'll go on the
road of cross-compiling and will send patches, this will be a great
enhancement for others.

> What I have done  is this:
> # emerge sys-devel/crossdev
> (installed sys-devel/crossdev-20150716)
> 
> # crossdev -S -P -v -t armv7a-hardfloat-linux-gnueabi
> (which "installed" fine without any errors)
> 
> # armv7a-hardfloat-linux-gnueabi-emerge --verbose --oneshot
> =net-misc/wget-1.16.3-r1
> 
> Which pulls in dev-libs/libpcre-8.38:3::gentoo which then fails with this:
> 
> ln -sf pcre_compile2.3
> /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-libs/libpcre-8.38/image//usr/share/man/man3/pcre16_compile2.3
> /usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping
> incompatible /usr/lib/libpthread.so when searching for -lpthread
> /usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping
> incompatible /usr/lib/libc.so when searching for -lc
> /usr/lib/libc.a: error adding symbols: File format not recognized
> collect2: error: ld returned 1 exit status

The problem is that build system tries to utilize system libraries
(libc, libpthread) instead of cross-compiled versions. You should
modify it in order to provide correct path, e.g. by passing a proper
--sysroot=... to a linker.


Best regards,
Andrew Savchenko

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Problems with cross-compiling
  2016-03-25 13:00 ` Dan Johansson
@ 2016-03-27  9:00   ` Andrew Savchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Savchenko @ 2016-03-27  9:00 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

On Fri, 25 Mar 2016 14:00:58 +0100 Dan Johansson wrote:
> Another one that is also failing (and is a dependency of many packages)
> is sys-libs/ncurses-6.0-r1.
> ncurses fails with another error than libpcre.
> 
> cd c++ && make DESTDIR="" RPATH_LIST="/usr/lib" all
> make[1]: Entering directory
> '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0-.arm/ncurses/c++'
> cd ../obj_s;   -DHAVE_CONFIG_H -I.
> -I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++
> -I../include
> -I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++/../include
>  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -DXTSTRINGDEFINES -DNDEBUG -O2
> -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard  -fPIC -c
> /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/c++/cursesf.cc

It looks like it tries to run compile command with empty compiler
variable (e.g. $CC) that should be before "-DHAVE_CONFIG_H -I.".
You should investigate makefiles and set proper compiler value.

Best regards,
Andrew Savchenko

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Problems with cross-compiling
  2016-03-25 12:35 [gentoo-user] Problems with cross-compiling Dan Johansson
  2016-03-25 13:00 ` Dan Johansson
  2016-03-27  8:41 ` Andrew Savchenko
@ 2016-03-27 15:34 ` James
  2016-03-27 19:09   ` James
  2 siblings, 1 reply; 6+ messages in thread
From: James @ 2016-03-27 15:34 UTC (permalink / raw
  To: gentoo-user

Dan Johansson <Dan.Johansson <at> dmj.nu> writes:


> I have setup one of my VM's to do cross-compiling for my Raspberry PI 2.
> Now some packages (e.g. app-editors/vim and its dependencies) emerges
> fine while other (e.g. net-misc/wget or rather one of its dependencies
> dev-libs/libpcre-8.38:3) does not.

The best place to access arm/embedded/cross compiling expertise, gentoo
centric, is on the gentoo embedded irc channel.


hth,
James



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Problems with cross-compiling
  2016-03-27 15:34 ` [gentoo-user] " James
@ 2016-03-27 19:09   ` James
  0 siblings, 0 replies; 6+ messages in thread
From: James @ 2016-03-27 19:09 UTC (permalink / raw
  To: gentoo-user

James <wireless <at> tampabay.rr.com> writes:


> > I have setup one of my VM's to do cross-compiling for my Raspberry PI 2.
> > Now some packages (e.g. app-editors/vim and its dependencies) emerges
> > fine while other (e.g. net-misc/wget or rather one of its dependencies
> > dev-libs/libpcre-8.38:3) does not.

> The best place to access arm/embedded/cross compiling expertise, gentoo
> centric, is on the gentoo embedded irc channel.


There are a ton of cross compiling docs in the gentoo wiki. Do that before
posting questions to the gentoo-embedded irc channel, to get better results.
Also, if you learn new tidbits, file that information in a bug report 
on bugs.gentoo.org, so it can be included for the next person to benefit.

So Use something like this when you google

<gentoo wiki:: cross compiling :: Raspberry PI >
I get::

https://wiki.gentoo.org/wiki/Raspberry_Pi/Cross_building

https://wiki.gentoo.org/wiki/Banana_Pi_the_Gentoo_Way

https://wiki.gentoo.org/wiki/Category:Cross_building

https://wiki.gentoo.org/wiki/Distcc/Cross-Compiling


hth,
James



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-27 19:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 12:35 [gentoo-user] Problems with cross-compiling Dan Johansson
2016-03-25 13:00 ` Dan Johansson
2016-03-27  9:00   ` Andrew Savchenko
2016-03-27  8:41 ` Andrew Savchenko
2016-03-27 15:34 ` [gentoo-user] " James
2016-03-27 19:09   ` James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox