Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vincent Fortier via Gdb <gdb@sourceware.org>
To: Andreas Schwab <schwab@suse.de>
Cc: Vincent Fortier via Gdb <gdb@sourceware.org>
Subject: Re: Bug when cross-compiling for ppc
Date: Thu, 14 Sep 2023 16:34:32 -0400	[thread overview]
Message-ID: <CALAySu+XKVTr1XSbiwXRJ5OLaDJ=G1tKtZ9MBThc-OFZyRwwCg@mail.gmail.com> (raw)
In-Reply-To: <mvm4jjxxof7.fsf@suse.de>

Le jeu. 14 sept. 2023, à 02 h 24, Andreas Schwab <schwab@suse.de> a écrit :
>
> On Sep 12 2023, Vincent Fortier via Gdb wrote:
>
> > Now the question is, how to fix that?  Help would be much welcomed :)
>
> You need to set CFLAGS_FOR_BUILD (to something non-empty), so it does
> not default to $CFLAGS (which is questionable in the first place).
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

For a start, I ended-up disabling sim entirely for PPC and now it's
building just fine.  I had found a ticket from openwrt having a
somewhat similar issue that was disabling it as well.  So I used that
option too.

I've tried that by setting CFLAGS_FOR_BUILD='-O2' just for the sake of
it not being empty but I'm still getting errors:
compilation terminated.
make[7]: *** [Makefile:660: table.o] Error 1
In file included from ./gen-icache.c:22:
./misc.h:23:10: fatal error: build-config.h: No such file or directory
   23 | #include "build-config.h"
      |          ^~~~~~~~~~~~~~~~

Further looking into the logs there's this hidden in a temporary
directory (once rm of it is commented out)
configure:2482: checking whether the C compiler works
configure:2504: gcc -O2
-I/home/spksrc/qoriq-debug/spksrc/toolchain/syno-qoriq-6.2.4/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include
-mcpu=8548 -mhard-float -mfloat-gprs=double
-I/home/spksrc/qoriq-debug/spksrc/cross/gdb-latest/work-qoriq-6.2.4/install/usr/local/gdb/include
  conftest.c  >&5
gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc: error: unrecognized command-line option '-mfloat-gprs=double'
configure:2508: $? = 1
configure:2546: result: no

The exec string from sim/ppc is
$ .././configure --enable-languages=all
--target=powerpc-e500v2-linux-gnuspe --host=i686-pc-linux
--build=i686-pc-linux

But as you can see I believe it refers to the "build" C compiler
instead of the"target" compiler OR uses the "target" flags instead of
the "build" flags (wonder why it would?).

Anyhow, disabling sim/ppc fixed things for now.

Migrating gdb to cmake using toolchain files or meson would
potentially remove these issues and simplify cross-compiling while
reducing build time.  But that's unrelated...

      reply	other threads:[~2023-09-14 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 16:42 Vincent Fortier via Gdb
2023-09-14  2:25 ` Simon Marchi via Gdb
2023-09-14  2:30   ` Simon Marchi via Gdb
2023-09-14  6:24 ` Andreas Schwab via Gdb
2023-09-14 20:34   ` Vincent Fortier via Gdb [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALAySu+XKVTr1XSbiwXRJ5OLaDJ=G1tKtZ9MBThc-OFZyRwwCg@mail.gmail.com' \
    --to=gdb@sourceware.org \
    --cc=schwab@suse.de \
    --cc=th0ma7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox