public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* unrecognized command line option '-fself-test"
       [not found] <1206693468.3550739.1603367701501.ref@mail.yahoo.com>
@ 2020-10-22 11:55 ` Harsh Rathod
  2020-10-23 20:00   ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Harsh Rathod @ 2020-10-22 11:55 UTC (permalink / raw)
  To: gcc-help

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?
Harsh Rathod

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

* Re: unrecognized command line option '-fself-test"
  2020-10-22 11:55 ` unrecognized command line option '-fself-test" Harsh Rathod
@ 2020-10-23 20:00   ` Jim Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2020-10-23 20:00 UTC (permalink / raw)
  To: Harsh Rathod; +Cc: gcc-help

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

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

end of thread, other threads:[~2020-10-23 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1206693468.3550739.1603367701501.ref@mail.yahoo.com>
2020-10-22 11:55 ` unrecognized command line option '-fself-test" Harsh Rathod
2020-10-23 20:00   ` Jim Wilson

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).