This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build cross gdb with crosstool-NG doesn't work


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]