[Mingw-users] Problems with compiling Windows system calls with MinGW gcc 6.3.0

Back to archive index

Keith Marshall keith****@users*****
Tue Jul 3 23:39:56 JST 2018


On 01/07/18 19:08, Eli Zaretskii wrote:
>> From: David Gressett <DGres****@amli-*****>
>> Date: Sun, 1 Jul 2018 13:00:34 -0500
>>
>>>> If it's left to me to produce it, then the answer's "not very
>>>> likely".
>>
>>> Too bad.  But thanks for trying.

I've had a change of heart; or rather, while comparing David's build
specification with my own, I had one of those "light-bulb" moments.
(Specifically, GCC's configure scripts don't respect the convention, as
normal autoconf generated scripts *should*, that $target may be inferred
by propagation from $host, unless explicitly specified otherwise).

When I explicitly specify "--target=mingw32", in addition to the already
required "--host=mingw32", then I can achieve a successful build;
however, the step at which the build previously choked -- a self-test
feature which is new in gcc-7.x -- still seems to be of questionable
value, for it tests the capabilities of the build compiler, rather than
the one we're actually building, (contrary to the intent indicated by
comments in the Makefile)!

>> You might want to try building it yourself; My Windows native build
>> has very few problems.
> 
> I might do that if I find enough free time.

Or, you may prefer to try the binaries, which I've now published at:
https://osdn.net/projects/mingw/releases/p15691

> One thing that always consumes time in these cases is deciding which
> optional features to turn on.  Keith published his decisions, but I'm
> not sure I understand the factors to consider.  Any insights will be
> appreciated.

FWIW, a native bootstrap on my GNU/Linux box takes around 5 hours, (and
is necessary if I want an Ada enabled tool chain, because gcc-ada-6.3.0
cannot build a gcc-ada-7.3.0 cross); I've never built GCC natively on
Windows, but my experience with other packages suggests that it could
take an order of magnitude longer.

Once I have the native build, using that to build a Linux-hosted mingw32
cross compiler takes around 2 hours more, then a further 1½ to 2 hours
to complete a cross-native mingw32 deployable build.

If you're interested, I've attached my build specification, which I run
through mingw-pkg thus:

  $ mingw-pkg --option="configure --target=mingw32" configure

to configure the cross-native build, using that option in addition to
the "--build" and "--host" options, (which my mingw-pkg local
configuration supplies), and the aggregation of the package specific
"option configure" settings from the build specification file.  I
believe my choice of options should be fairly self-explanatory, but if
you'd like clarification of any, please ask.

Additionally, if you'd like to see the patch-set I've used, you will
find it in the "arch/mingw32" directory of the source tarball on OSDN.

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-------------- next part --------------
# gcc-7.3.0-mingw32.pkgspec
#
# Package name and version must be explicitly specified; these appear
# as the initial part of the package name, as interpreted by mingw-get.
#
pkgname 	gcc
pkgversion	7.3.0

# Contributed by Keith Marshall <keith****@users*****>
# Copyright (C) 2017, 2018, MinGW.org Project
#
# -----------------------------------------------------------------------------
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# -----------------------------------------------------------------------------

# A release identifier is optional; if specified, it will be appended
# to the package name and version, delimited by an intervening hyphen.
#
pkgrelease 	1

# A system architecture identifier is required for any package which
# is to be delivered by mingw-get; it establishes the sub-system type
# identifier which will appear within the package name, following the
# package name, version and release identifiers.
#
arch		mingw32

# The pkgtype specification determines the packaging method to be used
# for all distributable component packages, and the final extension to
# be appended to the component package names.  The default is tar.gz;
# alternatives supported by mingw-get are tar.bz2, tar.lzma and tar.xz
#
pkgtype 	tar.xz

# Optional alias, title, and description specifications may be provided;
# these are used by 'mingw-pkg mkxml', to specify the associated entries
# in mingw-get's xml catalogue specification for this package.
#
# Each of these should be specified only once; 'aliases' is permitted as
# a synonym for 'alias', where the associated value is a space separated
# list of multiple alias names.
#
alias		gcc
title		"The GNU Compiler Collection"
description	"
A collection of packages, which together provide the GNU C Compiler, and
optionally, the GNU C++ Compiler, GNU Object-C Compiler, GNU Object-C++
Compiler, and GNU FORTRAN Compiler.
"

# An affiliate specification is also optional; it identifies a package
# category with which mingw-get will affiliate this package.  Unlike
# the alias, title, and description specifications, multiple affiliate
# specifications are permitted, allowing for affiliation of the package
# with multiple mingw-get categories.
#
affiliate	"MinGW Base System"
affiliate	"MinGW Compiler Suite"


# Configuration Options for GCC Build
# -----------------------------------
# Note that, for a crossed-native build, we MUST augment the --build, and
# the --host specifications, (which are typically hard-wired into the local
# mingw-pkg configuration), by addition of a --target specification; this
# may be conveniently specified by use of the:
#
#   mingw-pkg --option='configure --target=mingw32' configure
#
# command line format for package configuration; on the other hand, when
# building entirely natively, it is likely that a GCC bootstrap will be
# appropriate, in which case the alternative invocation:
#
#   mingw-pkg --option='configure --enable-bootstrap' configure
#
# may be the preferred form for the command.
#
option		configure --prefix=/mingw
option		configure --disable-win32-registry
option		configure --with-arch=i586 --with-tune=generic
option		configure --enable-languages=c,c++,objc,obj-c++,fortran,ada
option		configure --with-pkgversion="'MinGW.org GCC-$VERSION-$RELEASE'"
option		configure --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw
option		configure --enable-static --enable-shared --enable-threads
option		configure --with-dwarf2 --disable-sjlj-exceptions
option		configure --enable-version-specific-runtime-libs
option		configure --with-libiconv-prefix=/mingw
option		configure --with-libintl-prefix=/mingw
option		configure --enable-libstdcxx-debug
option		configure --with-isl=/mingw
option		configure --enable-libgomp
option		configure --disable-libvtv
option		configure --enable-nls

# The following isn't imperative, but it does reduce noise in the build
# log, by suppressing a deluge of unhelpful warnings about the Microsoft
# "I64" format modifier being unsupported by ISO-C++11
#
option		configure --disable-build-format-warnings


# Distributable Package Specifications
# ------------------------------------
# The distributable package inventory is established by means of a
# collection of component specifications; each is of the form:
#
#   component  keyword  "content"
#
#   where:
#     keyword	specifies the component package class name, as it
#		will be included in the mingw-get compatible package
#		archive name, immediately preceding the pkgtype.
#     content	specifies a white-space separated list of directory
#		and/or file path names, relative to the top of the
#		staging directory tree in which the distribution is
#		prepared, which are to be passed as argument list
#		to the archiving program, so defining the content
#		for the associated component package.
#
#
# We like to distribute a licence package, which doesn't conform to any
# requirement of the GNU Coding Standards, and isn't directly supported
# by the GCC build infrastructure.  Thus, we provide our own function,
# scavenge for licence files within the staged source tree.
#
abs_builddir=`pwd`
abs_srcdir=$abs_builddir/dist/staged/$PACKAGE-$VERSION
test -d $abs_srcdir || abs_srcdir=$PACKAGE_ABS_SRCDIR
select_source_wildcard_matches(){
  if test -d $abs_srcdir; then
    for pattern; do find $abs_srcdir -name "$pattern"; done
  fi
}
component  lic "
  --transform=s,$abs_srcdir,share/doc/$PACKAGE/$VERSION,
  `select_source_wildcard_matches 'COPYING*' 'LICEN[CS]E*'`
  --exclude=go --exclude=libgo --exclude=libiberty --exclude=libjava
  --exclude=libffi --exclude=libquadmath --exclude=libsanitizer
  --exclude=$PACKAGE-$VERSION/gcc --exclude=include
  --transform=s,/contrib/dotzlib,,
"
component  lang "
  share/locale/*/LC_MESSAGES
"
component  man "
  --exclude=share/man/man1/g++.1
  --exclude=share/man/man1/gfortran.1
  share/man
"
# We note that GCC's "make install-info" rule-set is utterly broken -- it
# installs little which is pertinent, and many requisite *.info files are
# missing from the distribution, (in violation of GNU Coding Standards).
# Furthermore, the makefile rules are unable to find most of those which
# are distributed, (among them, those pertinent to the primary package.
# Thus, we must scavenge for these, within the source tree, and fix-up
# the path names within the distributed package tarball.
#
component  info "
  --transform=s,$abs_srcdir.*/,share/info/,
  `select_source_wildcard_matches cpp.info gcc.info`
"

subpackage gcc-core
component  bin "
  bin/*.exe
  --exclude=bin/*[cg]++*.exe
  --exclude=bin/*fortran.exe
  --exclude=bin/gnat*.exe
  libexec/$PACKAGE/$ARCH/$VERSION/*.exe
  --exclude=libexec/$PACKAGE/$ARCH/$VERSION/cc1plus.exe
  --exclude=libexec/$PACKAGE/$ARCH/$VERSION/cc1obj*.exe
  --exclude=libexec/$PACKAGE/$ARCH/$VERSION/f951.exe
  --exclude=libexec/$PACKAGE/$ARCH/$VERSION/gnat1.exe
  libexec/$PACKAGE/$ARCH/$VERSION/install-tools
  libexec/$PACKAGE/$ARCH/$VERSION/*_plugin*
  lib/$PACKAGE/$ARCH/$VERSION/include
  --exclude=lib/$PACKAGE/$ARCH/$VERSION/include/c++
  --exclude=lib/$PACKAGE/$ARCH/$VERSION/include/objc
  lib/$PACKAGE/$ARCH/$VERSION/include-fixed
  --exclude=lib/$PACKAGE/$ARCH/$VERSION/libs??c++.*
  --exclude=lib/$PACKAGE/$ARCH/$VERSION/libgfortran*
  --exclude=lib/$PACKAGE/$ARCH/$VERSION/libcaf_single*
  --exclude=lib/$PACKAGE/$ARCH/$VERSION/libobjc*.a
  lib/$PACKAGE/$ARCH/$VERSION/*.[oa]
  lib/$PACKAGE/$ARCH/$VERSION/*.spec
  --exclude=*.la
"

subpackage libgcc
component  dll-1 "
  --transform=s,.*/,bin/,
  lib/$PACKAGE/$ARCH/libgcc_s_dw2-1.dll
"

subpackage libatomic
component  dll-1 "
  bin/libatomic-1.dll
"

subpackage gcc-c++
component  bin "
  bin/*[cg]++*.exe
  libexec/$PACKAGE/$ARCH/$VERSION/cc1plus.exe
  lib/$PACKAGE/$ARCH/$VERSION/debug
  lib/$PACKAGE/$ARCH/$VERSION/include/c++
  lib/$PACKAGE/$ARCH/$VERSION/libs??c++.*
  share/$PACKAGE-$VERSION/python
  --exclude=*.la
"
component  man "
  share/man/man1/g++.1
"

subpackage libstdc++
component  dll-6 "
  bin/libstdc++-6.dll
"

subpackage gcc-ada
component  bin "
  bin/gnat*.exe
  lib/$PACKAGE/$ARCH/$VERSION/ada* --exclude=*.dll*
  libexec/$PACKAGE/$ARCH/$VERSION/gnat1.exe
"

subpackage libgnat
component  dll-6 "
  lib/$PACKAGE/$ARCH/$VERSION/adalib/*.dll --transform=s,.*/,bin/,
"
component  dev "
  lib/$PACKAGE/$ARCH/$VERSION/adalib/*.dll.a
"

subpackage gcc-fortran
component  bin "
  bin/*fortran.exe
  libexec/$PACKAGE/$ARCH/$VERSION/f951.exe
  lib/$PACKAGE/$ARCH/$VERSION/libcaf_single.*
  lib/$PACKAGE/$ARCH/$VERSION/libgfortran.*
  lib/$PACKAGE/$ARCH/$VERSION/finclude
  --exclude=*.la
"
# This is another case where the info file is available in the source
# tree, but is not installed by "install-info"; once again, we scavenge
# for the source copy, and fix-up the path name in the tarball.
#
component  info "
  --transform=s,$abs_srcdir.*/,share/info/,
  `find $abs_srcdir -name gfortran.info`
"
component  man "
  share/man/man1/gfortran.1
"

subpackage libgfortran
component  dll-4 "
  bin/libgfortran-4.dll
"

subpackage gcc-objc
component  bin "
  libexec/$PACKAGE/$ARCH/$VERSION/cc1obj*.exe
  lib/$PACKAGE/$ARCH/$VERSION/include/objc
  lib/$PACKAGE/$ARCH/$VERSION/libobjc*.a
"

subpackage libobjc
component  dll-4 "
  bin/libobjc-4.dll
"

subpackage libquadmath
component  dll-0 "
  bin/libquadmath-0.dll
"
component  info "
  share/info/libquadmath.info
"

subpackage libgomp
component  dll-1 "
  bin/libgomp-1.dll
"
component  info "
  share/info/libgomp.info
"

subpackage libssp
component  dll-0 "
  bin/libssp-0.dll
"
# gcc-7.3.0-mingw32.pkgspec: end of file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : https://lists.osdn.me/mailman/archives/mingw-users/attachments/20180703/fe6c12b2/attachment-0001.pgp 



More information about the MinGW-Users mailing list
Back to archive index