Patchwork Is target toolchain supposed to be working?

login
register
mail settings
Submitter Marcin Juszkiewicz
Date June 19, 2012, 12:32 p.m.
Message ID <4FE0714A.1060603@linaro.org>
Download mbox | patch
Permalink /patch/30117/
State New
Headers show

Comments

Marcin Juszkiewicz - June 19, 2012, 12:32 p.m.
W dniu 19.06.2012 13:53, Marcin Juszkiewicz pisze:
> ignoring nonexistent directory "usr/include/c++/"
> ignoring nonexistent directory "usr/include/c++//i586-oe-linux"
> ignoring nonexistent directory "usr/include/c++//backward"
> ignoring nonexistent directory "/usr/local/include"
> ignoring nonexistent directory
> "/usr/lib/gcc/i586-oe-linux/4.7.1/../../../../i586-oe-linux/include"
> #include "..." search starts here:
>  .
> #include <...> search starts here:
>  ..
>  ../lib
>  /usr/lib/gcc/i586-oe-linux/4.7.1/include
>  /usr/lib/gcc/i586-oe-linux/4.7.1/include-fixed
>  /usr/include
>  ../lib/compat
> End of search list.

Attached patch fixed problem for me.
Khem Raj - June 19, 2012, 4:19 p.m.
On Tue, Jun 19, 2012 at 5:32 AM, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
> W dniu 19.06.2012 13:53, Marcin Juszkiewicz pisze:
>> ignoring nonexistent directory "usr/include/c++/"
>> ignoring nonexistent directory "usr/include/c++//i586-oe-linux"
>> ignoring nonexistent directory "usr/include/c++//backward"
>> ignoring nonexistent directory "/usr/local/include"
>> ignoring nonexistent directory
>> "/usr/lib/gcc/i586-oe-linux/4.7.1/../../../../i586-oe-linux/include"
>> #include "..." search starts here:
>>  .
>> #include <...> search starts here:
>>  ..
>>  ../lib
>>  /usr/lib/gcc/i586-oe-linux/4.7.1/include
>>  /usr/lib/gcc/i586-oe-linux/4.7.1/include-fixed
>>  /usr/include
>>  ../lib/compat
>> End of search list.
>
> Attached patch fixed problem for me.
>


includedir already has leading slash so I wonder if you changed
includedir in your setup somehow ?

> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Marcin Juszkiewicz - June 19, 2012, 4:25 p.m.
W dniu 19.06.2012 18:19, Khem Raj pisze:

> includedir already has leading slash so I wonder if you changed 
> includedir in your setup somehow ?

bitbake gcc -e|grep ^includedir shown "/usr/include" value. G++ started
on target as "g++ -v" shown "--with-c++-includes=/usr/include/c++" so I
was surprised when it was not working.

Added extra slash and it works. But please check in your configuration.
Khem Raj - June 20, 2012, 7:55 a.m.
On Tue, Jun 19, 2012 at 9:25 AM, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
> W dniu 19.06.2012 18:19, Khem Raj pisze:
>
>> includedir already has leading slash so I wonder if you changed
>> includedir in your setup somehow ?
>
> bitbake gcc -e|grep ^includedir shown "/usr/include" value. G++ started
> on target as "g++ -v" shown "--with-c++-includes=/usr/include/c++" so I
> was surprised when it was not working.
>
> Added extra slash and it works. But please check in your configuration.
>

can you try the fixes from my branch

http://git.openembedded.org/openembedded-core-contrib/log/?h=kraj/misc-updates

this should fix both gcc and binutils on target
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Marcin Juszkiewicz - June 20, 2012, 12:12 p.m.
W dniu 20.06.2012 09:55, Khem Raj pisze:
> On Tue, Jun 19, 2012 at 9:25 AM, Marcin Juszkiewicz 
> <marcin.juszkiewicz@linaro.org> wrote:
>> W dniu 19.06.2012 18:19, Khem Raj pisze:
>> 
>>> includedir already has leading slash so I wonder if you changed 
>>> includedir in your setup somehow ?
>> 
>> bitbake gcc -e|grep ^includedir shown "/usr/include" value. G++
>> started on target as "g++ -v" shown
>> "--with-c++-includes=/usr/include/c++" so I was surprised when it
>> was not working.
>> 
>> Added extra slash and it works. But please check in your
>> configuration.
>> 
> 
> can you try the fixes from my branch
> 
> http://git.openembedded.org/openembedded-core-contrib/log/?h=kraj/misc-updates
>
>  this should fix both gcc and binutils on target

I am still building one image from scratch but my build with gcc-linaro
and your fix-g++-sysroot.patch applied works perfectly:

root@qemux86:~# g++ -v hello.cc -o hello
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-oe-linux/4.7.1/lto-wrapper
Target: i586-oe-linux
Configured with:
/home/hrw/HDD/devel/canonical/ci-linaro/oecore/build/tmp-eglibc/work-shared/gcc-linaro-4.7-r4/gcc-linaro-4.7-2012.06/configure
--build=x86_64-linux --host=i586-oe-linux --target=i586-oe-linux
--prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc
--sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib
--includedir=/usr/include --oldincludedir=/usr/include
--infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules
--disable-dependency-tracking
--with-libtool-sysroot=/home/hrw/HDD/devel/canonical/ci-linaro/oecore/build/tmp-eglibc/sysroots/qemux86
--with-gnu-ld --enable-shared --enable-languages=c,c++
--enable-threads=posix --disable-multilib --enable-c99
--enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch
--program-prefix=i586-oe-linux- --without-local-prefix
--enable-target-optspace --enable-lto --enable-libssp
--disable-bootstrap --disable-libgomp --disable-libmudflap
--with-system-zlib --with-linker-hash-style=gnu --with-ppl=no
--with-cloog=no --enable-checking=release --enable-cheaders=c_global
--with-sysroot=/
--with-build-sysroot=/home/hrw/HDD/devel/canonical/ci-linaro/oecore/build/tmp-eglibc/sysroots/qemux86
--with-gxx-include-dir=/usr/include/c++/ --enable-nls --enable-__cxa_atexit
Thread model: posix
gcc version 4.7.1 20120531 (prerelease) (Linaro GCC 4.7-2012.06)
COLLECT_GCC_OPTIONS='-v' '-o' 'hello' '-shared-libgcc' '-mtune=pentium'
'-march=pentium'
 /usr/libexec/gcc/i586-oe-linux/4.7.1/cc1plus -quiet -v -D_GNU_SOURCE
hello.cc -quiet -dumpbase hello.cc -mtune=pentium -march=pentium
-auxbase hello -version -o /tmp/ccDHhaba.s
GNU C++ (Linaro GCC 4.7-2012.06) version 4.7.1 20120531 (prerelease)
(i586-oe-linux)
        compiled by GNU C version 4.7.1 20120531 (prerelease), GMP
version 5.0.4, MPFR version 3.1.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63580
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i586-oe-linux/4.7.1/../../../../i586-oe-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/
 /usr/include/c++//i586-oe-linux
 /usr/include/c++//backward
 /usr/lib/gcc/i586-oe-linux/4.7.1/include
 /usr/lib/gcc/i586-oe-linux/4.7.1/include-fixed
 /usr/include
End of search list.
GNU C++ (Linaro GCC 4.7-2012.06) version 4.7.1 20120531 (prerelease)
(i586-oe-linux)
        compiled by GNU C version 4.7.1 20120531 (prerelease), GMP
version 5.0.4, MPFR version 3.1.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63580
Compiler executable checksum: 585670605c6fcd60b0d620e1dbed0fa5
COLLECT_GCC_OPTIONS='-v' '-o' 'hello' '-shared-libgcc' '-mtune=pentium'
'-march=pentium'
 /usr/lib/gcc/i586-oe-linux/4.7.1/../../../../i586-oe-linux/bin/as -v
--32 -o /tmp/ccqQP9HY.o /tmp/ccDHhaba.s
GNU assembler version 2.22 (i586-oe-linux) using BFD version (GNU
Binutils) 2.22
COMPILER_PATH=/usr/libexec/gcc/i586-oe-linux/4.7.1/:/usr/libexec/gcc/i586-oe-linux/4.7.1/:/usr/libexec/gcc/i586-oe-linux/:/usr/lib/gcc/i586-oe-linux/4.7.1/:/usr/lib/gcc/i586-oe-linux/:/usr/lib/gcc/i586-oe-linux/4.7.1/../../../../i586-oe-linux/bin/
LIBRARY_PATH=/usr/lib/gcc/i586-oe-linux/4.7.1/:/usr/lib/gcc/i586-oe-linux/4.7.1/../../../i586-oe-linux/4.7.1/:/usr/lib/gcc/i586-oe-linux/4.7.1/../../../:/lib/:/usr/lib/i586-oe-linux/4.7.1/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'hello' '-shared-libgcc' '-mtune=pentium'
'-march=pentium'
 /usr/libexec/gcc/i586-oe-linux/4.7.1/collect2 --sysroot=/
--eh-frame-hdr --hash-style=gnu -m elf_i386 -dynamic-linker
/lib/ld-linux.so.2 -o hello
/usr/lib/gcc/i586-oe-linux/4.7.1/../../../crt1.o
/usr/lib/gcc/i586-oe-linux/4.7.1/../../../crti.o
/usr/lib/gcc/i586-oe-linux/4.7.1/../../../i586-oe-linux/4.7.1/crtbegin.o
-L/usr/lib/gcc/i586-oe-linux/4.7.1
-L/usr/lib/gcc/i586-oe-linux/4.7.1/../../../i586-oe-linux/4.7.1
-L/usr/lib/gcc/i586-oe-linux/4.7.1/../../..
-L/usr/lib/i586-oe-linux/4.7.1 /tmp/ccqQP9HY.o -lstdc++ -lm -lgcc_s
-lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/i586-oe-linux/4.7.1/../../../i586-oe-linux/4.7.1/crtend.o
/usr/lib/gcc/i586-oe-linux/4.7.1/../../../crtn.o
root@qemux86:~#
Khem Raj - June 20, 2012, 3:06 p.m.
On Wed, Jun 20, 2012 at 5:12 AM, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
>>
>> can you try the fixes from my branch
>>
>> http://git.openembedded.org/openembedded-core-contrib/log/?h=kraj/misc-updates
>>
>>  this should fix both gcc and binutils on target
>
> I am still building one image from scratch but my build with gcc-linaro
> and your fix-g++-sysroot.patch applied works perfectly:

thx

Patch

From 56382cac2c337f9e620d538f8697737b2ca777cf Mon Sep 17 00:00:00 2001
From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Date: Tue, 19 Jun 2012 14:30:06 +0200
Subject: [PATCH] gcc: make sure that c++ includes will be found

Without this patch g++ was not able to find headers:

ignoring nonexistent directory "usr/include/c++/"
ignoring nonexistent directory "usr/include/c++//i586-oe-linux"
ignoring nonexistent directory "usr/include/c++//backward"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i586-oe-linux/4.7.1/../../../../i586-oe-linux/include"
 .
 ..
 ../lib
 /usr/lib/gcc/i586-oe-linux/4.7.1/include
 /usr/lib/gcc/i586-oe-linux/4.7.1/include-fixed
 /usr/include
 ../lib/compat
End of search list.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 meta/recipes-devtools/gcc/gcc-4.7.inc              |    2 +-
 meta/recipes-devtools/gcc/gcc-configure-target.inc |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-4.7.inc b/meta/recipes-devtools/gcc/gcc-4.7.inc
index 34a73b1..077419c 100644
--- a/meta/recipes-devtools/gcc/gcc-4.7.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.7.inc
@@ -1,6 +1,6 @@ 
 require gcc-common.inc
 
-PR = "r2"
+PR = "r3"
 
 # Third digit in PV should be incremented after a minor release
 # happens from this branch on gcc e.g. currently its 4.7.0
diff --git a/meta/recipes-devtools/gcc/gcc-configure-target.inc b/meta/recipes-devtools/gcc/gcc-configure-target.inc
index b2f91b7..25fceb5 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-target.inc
@@ -3,4 +3,4 @@  require gcc-configure-common.inc
 EXTRA_OECONF_PATHS = " \
     --with-sysroot=/ \
     --with-build-sysroot=${STAGING_DIR_TARGET} \
-    --with-gxx-include-dir=${includedir}/c++/"
+    --with-gxx-include-dir=/${includedir}/c++/"
-- 
1.7.10.4