[Bug libgcc/95712] New: configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

Bug ID: 95712
   Summary: configure-target-libgcc fails on s390x target because
xgcc is not being built
   Product: gcc
   Version: 9.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: egorenar at linux dot ibm.com
  Target Milestone: ---

Created attachment 48744
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48744&action=edit
Console output

Hi all,

i'm trying to build buildroot on s390x machine for s390x machine and
the toolchain build step fails. I attached the build.log and the config.log
of the failing target configure-target-libgcc. It seems that xgcc
is not being built prior to configuring the target configure-target-libgcc.
When i build on host x86_64 for s390x target then everything works with the
same configuration.

Regards

[Bug libgcc/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #1 from Alexander Egorenkov  ---
Created attachment 48745
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48745&action=edit
config.log for configure-target-libgcc

[Bug libgcc/58260] configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. gmake[1]: *** [configure-target-libgcc] Error 1

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58260

Alexander Egorenkov  changed:

   What|Removed |Added

 CC||egorenar at linux dot ibm.com

--- Comment #14 from Alexander Egorenkov  ---
The config.log of configure-target-libgcc says:
/home/egorenar/Repositories/buildroot/output/s390x-syzkaller/build/host-gcc-initial-9.3.0/libgcc/configure:
line 3504:
/home/egorenar/Repositories/buildroot/output/s390x-syzkaller/build/host-gcc-initial-9.3.0/build/./gcc/xgcc:
No such file or directory

[Bug libgcc/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #2 from Alexander Egorenkov  ---
Created attachment 48746
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48746&action=edit
config.log for configure-target-libgcc gcc 9.3.0

Sorry attached gcc 8.4.0 log previosuly, but the same issue for gcc 9.3.0

[Bug libgcc/58260] configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. gmake[1]: *** [configure-target-libgcc] Error 1

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58260

--- Comment #15 from Alexander Egorenkov  ---
(In reply to Alexander Egorenkov from comment #14)
> The config.log of configure-target-libgcc says:
> /home/egorenar/Repositories/buildroot/output/s390x-syzkaller/build/host-gcc-
> initial-9.3.0/libgcc/configure: line 3504:
> /home/egorenar/Repositories/buildroot/output/s390x-syzkaller/build/host-gcc-
> initial-9.3.0/build/./gcc/xgcc: No such file or directory

Sorry, please ignore the comment, i misstyped.

[Bug libgcc/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #3 from Alexander Egorenkov  ---
The config.log of configure-target-libgcc says:

... build/host-gcc-initial-9.3.0/build/./gcc/xgcc: No such file or directory

[Bug libgcc/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-16 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #4 from Alexander Egorenkov  ---
I also have the same issue with gcc 8.4.0

[Bug libgcc/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-17 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

Alexander Egorenkov  changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |---

--- Comment #6 from Alexander Egorenkov  ---
Ok, i understand, therefore, i reproduced the problem without buildroot.

My steps:

$ mkdir compiler
$ cd compiler

$ tar xvjf gmp-6.1.0.tar.bz2
$ cd gmp-6.1.0
$ ./configure --prefix=$HOME/compiler/install --disable-shared
$ make -j81
$ make install
$ cd ..

$ tar xvjf mpfr-3.1.4.tar.bz2
$ cd mpfr-3.1.4
$ ./configure --prefix=$HOME/compiler/install --disable-shared
--with-gmp=$HOME/compiler/install
$ make -j81
$ make install
$ cd ..

$ tar xvzf mpc-1.0.3.tar.gz
$ cd mpc-1.0.3
$ ./configure --prefix=$HOME/compiler/install --disable-shared
--with-gmp=$HOME/compiler/install --with-mpfr=$HOME/compiler/install
$ make -j81
$ make install
$ cd ..


$ tar xvzf gcc-9.3.0.tar.xz
$ mkdir build-gcc
$ cd build-gcc
$ ../gcc-9.3.0/configure --prefix=$HOME/compiler/install --enable-shared
--disable-static \
 --disable-gtk-doc --disable-gtk-doc-html --disable-doc
--disable-docs \
 --disable-documentation --disable-debug
--with-xmlto=no --with-fop=no \
 --disable-nls --disable-dependency-tracking 
--target=s390x-buildroot-linux-gnu  \
 --enable-__cxa_atexit --with-gnu-ld --disable-libssp
--disable-multilib \
 --disable-decimal-float
--with-gmp=$HOME/compiler/install \
 --with-mpc=$HOME/compiler/install
--with-mpfr=$HOME/compiler/install \
 --with-pkgversion="Buildroot 2020.08-git-g2d8407f8ab"
\
 --with-bugurl="http://bugs.buildroot.net/";
--disable-libquadmath --enable-tls \
 --enable-threads --without-isl --without-cloog
--with-arch="z196" \
 --with-long-double-128 --enable-languages=c
--disable-shared --without-headers \
 --disable-threads --with-newlib --disable-largefile

$ make -j81 gcc_cv_libc_provides_ssp=yes all-gcc all-target-libgcc


The above steps were executed manually w/o any buildroot infrastructure. 
And i get the same problem, almost the same commands are executed by buildroot.

Again, xgcc is not being built and libgcc fails. I patched nothing, everything
was vanilla.

What i did notice, is that everything seems to work fine and the make commands
succeeds, if i drop "-j81" in the last step.
I did all these steps on a s390x machine with 80 cores, it is a highly parallel
machine.
So the issue seems to depend on it somehow, my guess is that maybe some
dependencies are not correctly
done in libgcc Makefile ? Another workaround i found is to split the last maske
command into 2 like this:
$ make -j81 all-gcc
$ make -j81 all-target-libgcc
This seems to fix it also.

I'm ready to do more test if required. I really want to fix it, it is very
annoying and blocking me.

Regards

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-17 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #8 from Alexander Egorenkov  ---

$ make --version
GNU Make 4.1
Built for s390x-ibm-linux-gnu

In my top Makefile the dependecny on maybe-all-gcc is missing:

configure-target-libgcc:
...

I attached the top Makefile.

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-17 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #9 from Alexander Egorenkov  ---
Created attachment 48751
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48751&action=edit
top gcc Makefile

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-17 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #10 from Alexander Egorenkov  ---
When i add the dependency in Makefile manually, then the parallel build works.

Regards

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-18 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #12 from Alexander Egorenkov  ---
Indeed, adding --disable-bootstrap helps also.

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-18 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #17 from Alexander Egorenkov  ---
(In reply to Andrew Pinski from comment #13)
> (In reply to Andreas Schwab from comment #11)
> > > generated for aarch64-linux-gnu that I configured for and it has:
> > 
> > You have used --disable-bootstrap.
> 
> No I did not, --disable-bootstrap is the default for the case where we are
> doing cross.
> 
> OH I did not notice it was s390 to s390 cross building but buildroot is not
> handling that case correctly.  Rather it is thinking it is always building a
> cross even when build==host==target .
> 
> > --build=s390x-ibm-linux-gnu --host=s390x-buildroot-linux-gnu 
> > --target=s390x-buildroot-linux-gnu
> 
> That is broken.  This is not a cross compiler but rather a build of the
> native gcc and therefor is not the correct options.
> 
> So the problem is rather how buildroot is not doing the right configure
> options to gcc for building a cross build.  NOT A BUG.

But i did not use those configure options in my test.
And now i also removed option "--target=" in my test and it is still failing
with the same problem. I'm not talking about buildroot, i got rid of it. Please
see my test.

Thanks

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-18 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

Alexander Egorenkov  changed:

   What|Removed |Added

 Resolution|INVALID |---
 Status|RESOLVED|UNCONFIRMED

--- Comment #18 from Alexander Egorenkov  ---
I reopened the problem because i reproduced this w/o buildroot and
--host,--target and --build configure options.

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-18 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #20 from Alexander Egorenkov  ---
(In reply to Andrew Pinski from comment #19)
> This is a config.sub issue where the vendor is always rest/set to ibm. Not
> directly a gcc issue.  Gcc does not maintain config.sub.

Ok, sorry, thank you :)

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-18 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #21 from Alexander Egorenkov  ---
Could you please point me to the bug report it was moved to ? Thanks

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-18 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #23 from Alexander Egorenkov  ---
I would gladly if i understood the real problem. Sorry i'm not very familiar
with config.guess & config.sub. Could you please elaborate what the problem is
and how it should be fixed ? Thanks

[Bug bootstrap/95712] configure-target-libgcc fails on s390x target because xgcc is not being built

2020-06-20 Thread egorenar at linux dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95712

--- Comment #24 from Alexander Egorenkov  ---
I finally figured it out and fixed buildroot.
This info is for posterity, in case somebody will have the same issue.
If i understood it correctly, then the problem was that buildroot
wrongly tried to build a native compiler on s390x host for s390 target instead
of a cross-compiler due to a problem is config.sub which is fixed by this path:

@@ -1138,14 +1138,6 @@ case $cpu-$vendor in
cpu=nsx
vendor=tandem
;;
-   s390-*)
-   cpu=s390
-   vendor=ibm
-   ;;
-   s390x-*)
-   cpu=s390x
-   vendor=ibm
-   ;;
tile*-*)
os=${os:-linux-gnu}
;;
@@ -1229,6 +1221,7 @@ case $cpu-$vendor in
| pyramid \
| riscv | riscv32 | riscv64 \
| rl78 | romp | rs6000 | rx \
+   | s390 | s390x \
| score \
| sh | shl \
| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb]
| sh[lb]e \



After fixing config.sub everything builds just fine and works great :)
I'm going to try to submit this fix to the config mailing list.
Best regard & thank you