Bug 65794 - Building crossback fails: No rule to make target `auto-build.h', needed by `build/genmddeps.o'
Summary: Building crossback fails: No rule to make target `auto-build.h', needed by `b...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: 10.0
Assignee: Not yet assigned to anyone
URL: https://gcc.gnu.org/ml/gcc-patches/20...
Keywords: build, patch
Depends on:
Blocks:
 
Reported: 2015-04-17 12:53 UTC by Georg-Johann Lay
Modified: 2021-09-11 23:07 UTC (History)
0 users

See Also:
Host: i386-mingw32
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2018-12-10 00:00:00


Attachments
Patch to Makefile to proceed with the build (367 bytes, patch)
2015-08-16 21:49 UTC, Marcin Cieślak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2015-04-17 12:53:10 UTC
GCC configured as:

../../gcc.gnu.org/trunk/configure --build=x86_64-linux-gnu --host=i386-mingw32 --enable-languages=c,c++ --target=x86_64-linux-gnu --prefix=/home/georg/gnu/install/gcc-64-32-cross

with empty build and empty install directory.

Building the compiler aborts:

...
/usr/bin/msgfmt --statistics -o po/zh_TW.gmo ../../../gcc.gnu.org/trunk/gcc/po/zh_TW.po
3519 translated messages, 6759 fuzzy translations, 904 untranslated messages.
TARGET_CPU_DEFAULT="" \
        HEADERS="auto-host.h ansidecl.h config/i386/xm-mingw32.h" DEFINES="" \
        /bin/bash ../../../gcc.gnu.org/trunk/gcc/mkconfig.sh config.h
TARGET_CPU_DEFAULT="" \
        HEADERS="options.h insn-constants.h config/vxworks-dummy.h config/i386/biarch64.h config/i386/i386.h config/i386/unix.h config/i386/att.h config/dbxelf.h config/elfos.h config/gnu-user.h config/glibc-stdint.h config/i386/x86-64.h config/i386/gnu-user-common.h config/i386/gnu-user64.h config/linux.h config/linux-android.h config/i386/linux-common.h config/i386/linux64.h config/initfini-array.h defaults.h" DEFINES="LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 DEFAULT_LIBC=LIBC_GLIBC ANDROID_DEFAULT=0" \
        /bin/bash ../../../gcc.gnu.org/trunk/gcc/mkconfig.sh tm.h
TARGET_CPU_DEFAULT="" \
        HEADERS="config/i386/i386-protos.h config/linux-protos.h tm-preds.h" DEFINES="" \
        /bin/bash ../../../gcc.gnu.org/trunk/gcc/mkconfig.sh tm_p.h
TARGET_CPU_DEFAULT="" \
        HEADERS="auto-build.h ansidecl.h" DEFINES="" \
        /bin/bash ../../../gcc.gnu.org/trunk/gcc/mkconfig.sh bconfig.h
make[2]: *** No rule to make target `auto-build.h', needed by `build/genmddeps.o'.  Stop.
make[2]: Leaving directory `/data/home/georg/gnu/build/gcc-64-32-cross/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/data/home/georg/gnu/build/gcc-64-32-cross'
make: *** [all] Error 2

The system has a i386-mingw32 toolchain installed, but presumably the above problem occurs also with other crossback configuration with 

build = target != host
Comment 1 Marcin Cieślak 2015-08-16 21:16:03 UTC
I have the same problem on solaris 2.9 using GCC:

I am using gcc 4.9.3 (compiled as a 32-bit binary) to compile gcc 4.9.3 as a 64-bit binary:


env \
        BOOT_CFLAGS="-m64 -mcpu=ultrasparc3" \
        BOOT_CXXFLAGS="-m64 -mcpu=ultrasparc3" \
        CFLAGS="-m64 -mcpu=ultrasparc3" \
        CXXFLAGS="-m64 -mcpu=ultrasparc3" \
        CC=$HOME/sparcv7/bin/gcc \
        CXX=$HOME/sparcv7/bin/g++ \
        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/sparcv9/lib \
        AR="/usr/ccs/bin/ar" \
        RANLIB="/usr/ccs/bin/ranlib" \
        AS="/usr/ccs/bin/as" \
        $HOME/src/gcc-4.9.3/configure \
         --prefix=$HOME/sparcv9    \
         --with-gmp=$HOME/sparcv9  \
         --with-mpfr=$HOME/sparcv9 \
         --with-mpc=$HOME/sparcv9  \
         --with-isl=$HOME/sparcv9  \
         --with-cloog=$HOME/sparcv9  \
         --without-gnu-as --without-gnu-ld \
         --enable-languages=c,c++ --enable-obsolete \
         --host=sparc64-sun-solaris2.9 \
         --target=sparc64-sun-solaris2.9 \
         --build=sparc-sun-solaris2.9 \
         --disable-bootstrap


Failure:

make[2]: Entering directory '/home/admini/saper/build/gcc-4.9.3/gcc'
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h" DEFINES="" \
/bin/bash /home/admini/saper/src/gcc-4.9.3/gcc/mkconfig.sh config.h
TARGET_CPU_DEFAULT="TARGET_CPU_v9" \
HEADERS="options.h insn-constants.h config/sparc/default-64.h config/sparc/biarch64.h config/vxworks-dummy.h config/sparc/sparc.h config/dbxelf.h config/elfos.h config/sparc/sysv4.h config/sol2.h config/sparc/sol2.h config/sol2-bi.h config/sparc/tso.h config/initfini-array.h defaults.h" DEFINES="LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" \
/bin/bash /home/admini/saper/src/gcc-4.9.3/gcc/mkconfig.sh tm.h
TARGET_CPU_DEFAULT="" \
HEADERS="config/sparc/sparc-protos.h config/sol2-protos.h tm-preds.h" DEFINES="" \
/bin/bash /home/admini/saper/src/gcc-4.9.3/gcc/mkconfig.sh tm_p.h
TARGET_CPU_DEFAULT="" \
HEADERS="auto-build.h ansidecl.h" DEFINES="" \
/bin/bash /home/admini/saper/src/gcc-4.9.3/gcc/mkconfig.sh bconfig.h
make[2]: *** No rule to make target 'auto-build.h', needed by 'build/genmddeps.o'.  Stop.
make[2]: Leaving directory '/home/admini/saper/build/gcc-4.9.3/gcc'
Makefile:3972: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory '/home/admini/saper/build/gcc-4.9.3'
Makefile:859: recipe for target 'all' failed
make: *** [all] Error 2
Comment 2 Marcin Cieślak 2015-08-16 21:49:45 UTC
Created attachment 36191 [details]
Patch to Makefile to proceed with the build

The attached patch allowed me to continue the build. Probably this patch is not the correct fix though.

It can be applied to Makefile.in prior to the configure stage. It looks like "config.status" has no special knowledge of the "auto-build.h" header.

(Basically in my case the generated files - auto-host.h and auto-build.h were identical, except for the comment in line 1)
Comment 3 Eric Gallager 2018-12-10 00:36:17 UTC
There's a patch for this (or at least something similar) on the gcc-patches mailing list; taking it as confirmation:
https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00525.html
Comment 4 coypu 2018-12-10 00:47:42 UTC
Hi,

It's probably a setup/configuration issue for everyone reporting this issue.
It's hard to debug, my patch helps with figuring out the problem - but doesn't fix it.

I didn't ping this bug report because I don't understand what the other patch described here does.
Comment 5 Eric Gallager 2019-06-10 05:03:02 UTC
(In reply to coypu from comment #4)
> Hi,
> 
> It's probably a setup/configuration issue for everyone reporting this issue.
> It's hard to debug, my patch helps with figuring out the problem - but
> doesn't fix it.
> 
> I didn't ping this bug report because I don't understand what the other
> patch described here does.

The patch described here appears to simply add a rule to create auto-build.h from the Makefile; as Marcin said, though, it might not be correct... probably worth continuing to pursue your own patch separately...
Comment 6 Andrew Pinski 2021-09-11 23:07:36 UTC
Fixed for GCC 10 by r10-4331.