public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Build cross gdb with crosstool-NG doesn't work
@ 2009-12-08 10:45 Andreas Erler
  2009-12-16 21:41 ` Khem Raj
  2009-12-16 21:52 ` Yann E. MORIN
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Erler @ 2009-12-08 10:45 UTC (permalink / raw)
  To: crossgcc

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

Hi All,

I've now successfully built a canadian cross compiler toolchain for an 
arm-linux-uclibc target on an ubuntu 9.10 build machine for a mingw32 host 
with crosstool-NG 1.5.2.
Many thanks to Yann for doing a great job and saving much time for many 
frustrated developer :-)
After that success I tried to build a cross gdb for the mingw32 host also, 
but unfortunately the build system stopped with some error messages.
I've tried several configurations (gdb 6.8, 6.6, ...) but I've got never a 
successful completion.

Here is the output (gdb 6.6) where it breaks:

[INFO ]  Installing cross-gdb
[ERROR]    Build failed in step 'Installing cross-gdb'
[ERROR]    Error happened in 
'/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/functions' in function 
'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from 
'/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/build/debug/300-gdb.sh' at 
line # 116 in function 'do_debug_gdb_build'
[ERROR]          called from 
'/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/build/debug.sh' at line # 35 
in function 'do_debug'
[ERROR]          called from 
'/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/crosstool-NG.sh' at line # 
544 in function 'main'
[ERROR]    Look at 
'/home/erlera/x-tools/arm-unknown-linux-uclibcgnueabi/build.log' for more 
info on this error.
[ERROR]  (elapsed: 36:16.82)
[36:18] / make: *** [build] Error 1

Can anyone please give me a hint what is going wrong here?

Cheers
Andy 

[-- Attachment #2: build.log.gz --]
[-- Type: application/x-gzip, Size: 194303 bytes --]

[-- Attachment #3: .config --]
[-- Type: application/xml, Size: 9187 bytes --]

[-- Attachment #4: Type: text/plain, Size: 71 bytes --]

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: Build cross gdb with crosstool-NG doesn't work
  2009-12-08 10:45 Build cross gdb with crosstool-NG doesn't work Andreas Erler
@ 2009-12-16 21:41 ` Khem Raj
  2009-12-16 21:52 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2009-12-16 21:41 UTC (permalink / raw)
  To: Andreas Erler; +Cc: crossgcc

On Tue, Dec 8, 2009 at 2:44 AM, Andreas Erler <a.elch@gmx.at> wrote:
> Hi All,
>
> I've now successfully built a canadian cross compiler toolchain for an
> arm-linux-uclibc target on an ubuntu 9.10 build machine for a mingw32 host
> with crosstool-NG 1.5.2.
> Many thanks to Yann for doing a great job and saving much time for many
> frustrated developer :-)
> After that success I tried to build a cross gdb for the mingw32 host also,
> but unfortunately the build system stopped with some error messages.
> I've tried several configurations (gdb 6.8, 6.6, ...) but I've got never a
> successful completion.
>
> Here is the output (gdb 6.6) where it breaks:
>
> [INFO ]  Installing cross-gdb
> [ERROR]    Build failed in step 'Installing cross-gdb'
> [ERROR]    Error happened in
> '/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/functions' in function
> 'CT_DoExecLog' (line unknown, sorry)
> [ERROR]          called from
> '/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/build/debug/300-gdb.sh' at
> line # 116 in function 'do_debug_gdb_build'
> [ERROR]          called from
> '/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/build/debug.sh' at line # 35
> in function 'do_debug'
> [ERROR]          called from
> '/home/erlera/src/ct-ng/lib/ct-ng-1.5.2/scripts/crosstool-NG.sh' at line #
> 544 in function 'main'
> [ERROR]    Look at
> '/home/erlera/x-tools/arm-unknown-linux-uclibcgnueabi/build.log' for more
> info on this error.
> [ERROR]  (elapsed: 36:16.82)
> [36:18] / make: *** [build] Error 1
>
> Can anyone please give me a hint what is going wrong here?

your build configuration seems to be that build != host != target
which is not a typical cross build scenario
there could be issue with gdb 6.6 configure for such a combination. I
would suggest to use either gdb 6.8 or newer

Thanks

-Khem

>
> Cheers
> Andy
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: Build cross gdb with crosstool-NG doesn't work
  2009-12-08 10:45 Build cross gdb with crosstool-NG doesn't work Andreas Erler
  2009-12-16 21:41 ` Khem Raj
@ 2009-12-16 21:52 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2009-12-16 21:52 UTC (permalink / raw)
  To: crossgcc; +Cc: Andreas Erler

Hello Andreas!

Sorry for the delay...

On Tuesday 08 December 2009 11:44:45 Andreas Erler wrote:
> I've now successfully built a canadian cross compiler toolchain for an 
> arm-linux-uclibc target on an ubuntu 9.10 build machine for a mingw32 host 
> with crosstool-NG 1.5.2.
> Many thanks to Yann for doing a great job and saving much time for many 
> frustrated developer :-)

Cheers! :-)

> After that success I tried to build a cross gdb for the mingw32 host also, 
> but unfortunately the build system stopped with some error messages.
> I've tried several configurations (gdb 6.8, 6.6, ...) but I've got never a 
> successful completion.

> Here is the output (gdb 6.6) where it breaks:
[--SNIP--]
> [ERROR]    Look at 
> '/home/erlera/x-tools/arm-unknown-linux-uclibcgnueabi/build.log' for more 
> info on this error.

Well, the error is not so obvious to track down. Reading your mail again
made the error obvious: you are trying to build a canadian-cross, and the
following snippet from the build log rang a bell:

[ALL  ]    /home/erlera/src/crosstool-ng-1.5.2/targets/src/gdb-6.6/configure: 2948: -o: not found
[ALL  ]    *** The command ' -o conftest -g -O2   conftest.c' failed.
[ALL  ]    *** You must set the environment variable CC to a working compiler.
[ERROR]    Build failed in step 'Installing cross-gdb'

OK, what does it means? Just that ./configure for gdb can not find a proper
compiler: ' -o conftest -g -O2   conftest.c' looks terribly like an
incantation to the compiler, using a variable that is not set.

The error is a bit bizarre, but the following code snippet from the gdb build
makes it obvious that it will *not* work for the canadian case (from line 104
in scripts/build/debug/300-gdb.sh):

--8<--
CC_for_gdb=
LD_for_gdb=
if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
    CC_for_gdb="gcc -static"
    LD_for_gdb="ld -static"
fi

gdb_cross_configure="${gdb_src_dir}/configure"
[ "${CT_GDB_CROSS_INSIGHT}" = "y" ] && gdb_cross_configure="${insight_src_dir}/configure"

CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'"

CC="${CC_for_gdb}"                              \
LD="${LD_for_gdb}"                              \
CT_DoExecLog ALL                                \
"${gdb_cross_configure}"                        \
    --build=${CT_BUILD}                         \
    --host=${CT_HOST}                           \
    --target=${CT_TARGET}                       \
--8<--

CC is either:
- empty if you're not building static, or
- set to the native gcc if building static

At least the static build is wrong, it should be set to the cross-gcc (in
your case, the mingw32-gcc). But for the non-static build, CC being empty,
./configure should search for the cross-gcc (mingw32-gcc), which it does not.

Well, it means that gdb is not ready for prime-time canadian-cross! :-/

On the two lines just before "CT_DoExecLog ALL", could you try forcing:
  CC=(whatever your compiler is named)
  LD=(whatever your linker is named)

and report back wether it works for gdb 6.6 and 6.8 ?
If it fixes it for you, can you try to come up with a proper patch, please?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

end of thread, other threads:[~2009-12-16 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-08 10:45 Build cross gdb with crosstool-NG doesn't work Andreas Erler
2009-12-16 21:41 ` Khem Raj
2009-12-16 21:52 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).