Re: Problem with configure when trying to build gcc 5.3

Keith Marshall <[email protected]> Sun, 8 Jan 2017 13:28:59 +0000
Newsgroups gmane.comp.gnu.mingw.devel
Organization MinGW Project
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/01/17 20:09, David Gressett wrote:
>> There's not a lot we can do, to help you debug that; have you
>> tried running 'mingw-pkg configure' under 'sh -vx ...', (as I
>> suggested on Tuesday)?  The output from that should show you
>> where the bogus setting is creeping in.
> 
> I tried that and the result  looked just like the example that 
> you had in your Tuesday message. config.log  still showed 
> 
> Configured with: ../src/gcc-5.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw ... 

I meant you to search in the echoed shell commands, as executed
by mingw-pkg, to identify which of them is adding that bogus
option; if you can't find it there, then do you, perhaps, have
a stale config.cache in your build tree, from whence it may be
inherited?  If so, get rid of it; ideally, 'rm -rf' the entire
build tree, and start with a clean slate.

> config.status, however, contained an option list that had no --build
> option. At that point, I tried the compile step, using tee to save
> the console display. It eventually crashed with this message:
> 
> C:\MinGW\mingw32\bin\ld.exe: cannot find dllcrt2.o: No such file or directory

Hmm.  dllcrt2.o is a component of mingwrt; for me it lives in
'/home/keith/mingw32/lib`, (under the '/home/keith/mingw32'
prefix, where my Linux hosted mingw32-gcc cross-compiler is
installed).  For the crossed-native build, I didn't appear to
need to do anything in particular, to have that found, but,
when building the cross-compiler itself, I need to:

1) Configure and 'make install-headers' for mingwrt/w32api,
   with prefix configured as /home/keith/mingw32

2) Configure, make, and 'make install' GNU binutils, with
   this same prefix, (also specified for '--with-sysroot'),
   and with `--target=mingw32'

3) Symbolically link /home/keith/mingw32/mingw to its own
   containing directory; (this is a ludicrously defective
   requirement of the GCC build system itself -- without it,
   the build will fail with 'the directory which should
   contain the system headers does not exist', in spite of
   them being correctly installed in prefix/sysroot at
   step (1)).

4) Configure the GCC build, again with /home/keith/mingw32
   as prefix, and sysroot; (sysroot is appropriate in the
   case of cross-compilers, but not native builds).

5) Perform the first 'make all-gcc' phase, of a two stage
   GCC build.

6) 'make install-gcc' the partial GCC built in step (5).

7) Use that partially built and installed step (6) GCC
   to make and 'make install' mingwrt/w32api.

8) Complete the GCC build, with 'make', then 'make install'

Once the above is in place, the crossed-native build is much
simpler:

1) Configure, as per mingw-pkg specification.

2) Build it; all that seems to be required is 'make', which
   is all that 'mingw-pkg compile' does, for the GCC case.

I've never tried to build GCC natively on Windows; the whole
process is much too painful!  Perhaps you need something like
the stage-by-stage procedure used for my cross-compiler?  Or
maybe, a 'make bootstrap' procedure, (for which the mingw-pkg
specification isn't set up, in the 'mingw-pkg compile' case)?

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJYcj6bAAoJEMCtNsY0flo/AXwQALOYw7T8UDacxKOnwu3M86S6
PNGC+yI88qKPROZxNAIYOkhc7gRyLdbYkXTuHtCsYtMl5+4bpkdEaDktBORbo740
4SUo/O9+WhUwoYS9DZ4niEa8xW/aBPRpiSFjlX6Voodqhb9DA6t04H5J3ImKuUjA
0wcLaTdDX9j/hrOsSzVfaoUEIyHkcu/z333w9/0Ov6+UiL9GYQS/O0tKWeFJe3/s
IzRWyALyH6jsQHhYtdNx472b/WY4knNzWoCyYxi1HvORdlZ7R8xdgFAMmnsOL8O0
hrdF1W+MoPx1/nHRvkanMQ3zaA+GIITV0E0bqYU1cUAkDxlUsPbmPIcRo1FYQ/Lj
6Vps1ls/MlNG9ctfTsEAkV3iFDMtK5DGOFRQCoM1sygx0IYDa9E7FLYS6FWj6DzB
+NxrlCDERYtAtX8PcTI8vPoObNODbtos84LGe0vQPyzC5l/XzjhUf+ORR/OcMqwT
/i5VxPRx5N58HgKwmReDhsoK4OVFOLT6jduNT+CcQ9Kb2GIpJh0xYlMtiUW3LecC
ZztlOsGypeLtcwXRc3a2M1qloqCokg0HgOnLlOUVGE8NdKWBqQPagV8pwjWl83xM
XpWWE/f+9cSBnfNhKbk8MRIdlgcT+kVcnEWzmEhDsObnb4apLuEe+Wc+Zd8pR4KC
OgT81+5Jy+wVhPZOZ2P3
=aFUb
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot