public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Wilson <jimw@sifive.com>
To: Harsh Rathod <hrathore50@ymail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: unrecognized command line option '-fself-test"
Date: Fri, 23 Oct 2020 13:00:48 -0700	[thread overview]
Message-ID: <CAFyWVaYctHScwSEqOn6H7+WCx2A0ZBJFCvTBDOAyfAy8P=QYrA@mail.gmail.com> (raw)
In-Reply-To: <1206693468.3550739.1603367701501@mail.yahoo.com>

On Thu, Oct 22, 2020 at 4:55 AM Harsh Rathod via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

> Hello there,
> I'm trying to build GCC 10.2 for host and target MinGW on my Fedora 23 OS.
> I've configured it like this:
> ../gcc-10.2.0/configure  --host=x86_64-w64-mingw32
> --target=x86_64-w64-mingw32 --prefix=/usr/local/gcc-mingw --enable-shared
> --enable-languages=c,c++ --disable-multilib
>
> But I get this weird error on make:
> x86_64-w64-mingw32-gcc -xc -nostdinc /dev/null -S -o /dev/null
> -fself-test=../../gcc-10.2.0/gcc/testsuite/selftestsx86_64-w64-mingw32-gcc:
> error: unrecognized command line option
> '-fself-test=../../gcc-10.2.0/gcc/testsuite/selftests'../../gcc-10.2.0/gcc/c/Make-lang.in:124:
> recipe for target 's-selftest-c' failedmake[2]: *** [s-selftest-c] Error
> 1rm gcc.podmake[2]: Leaving directory '/root/gcc-mingw/gcc'Makefile:4418:
> recipe for target 'all-gcc' failedmake[1]: *** [all-gcc] Error 2make[1]:
> Leaving directory '/root/gcc-mingw'Makefile:977: recipe for target 'all'
> failedmake: *** [all] Error 2
> What is it that I'm doing wrong here?
>

Normally the selftest uses ./xgcc, but since you are doing a canadian
cross, ./xgcc is a windows binary that won't run on the build machine, so
it uses the fedora-x-mingw cross compiler instead.  Except that it appears
that you are using the system cross compiler which is an old version that
doesn't support the -fselftest option.  The solution is to first build a
gcc-10 fedora-x-mingw cross compiler.  And then use that cross compiler to
build a fedoar-x-mingw-x-mingw cross compiler.

Taking a higher level view of this, maybe the selftest support should be
disabled when build != host, since it won't do anything meaningful in that
case.  That would allow cross builds with older gcc versions.

Ideally, the selftest should be run on the host machine after the compiler
is built and installed there.  We do create an install-tools dir in the gcc
install tree, with some scripts that are meant to be run on the host
machine, like a script to rerun fixincludes if the header files on the host
change.  We could maybe add a script that runs selftest, but selftest
requires the dejagnu testsuite support, plus the selftest testsuite
itself.  That is probably too much to easily copy into the install-tools
dir.

Jim

      reply	other threads:[~2020-10-23 20:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1206693468.3550739.1603367701501.ref@mail.yahoo.com>
2020-10-22 11:55 ` Harsh Rathod
2020-10-23 20:00   ` Jim Wilson [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='CAFyWVaYctHScwSEqOn6H7+WCx2A0ZBJFCvTBDOAyfAy8P=QYrA@mail.gmail.com' \
    --to=jimw@sifive.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=hrathore50@ymail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).