Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447708 (PR55886) - sys-devel/gcc-4.7.2 fails to crosscompile for mingw64: options.c:952:3: error: ‘HAVE_GAS_ALIGNED_COMM’ undeclared here (not in a function)
Summary: sys-devel/gcc-4.7.2 fails to crosscompile for mingw64: options.c:952:3: error...
Status: RESOLVED INVALID
Alias: PR55886
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR55886
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-18 13:33 UTC by Dennis Schridde
Modified: 2013-03-28 05:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gcc-stage1.log (cross-x86_64-pc-mingw64-gcc-stage1.log.xz,23.18 KB, application/x-xz)
2012-12-18 13:34 UTC, Dennis Schridde
Details
gcc-build-logs (gcc-build-logs.tar.bz2,42.24 KB, application/x-bzip)
2012-12-18 13:36 UTC, Dennis Schridde
Details
gcc-4.7.2-define-have_gas_aligned_comm.patch (gcc-4.7.2-define-have_gas_aligned_comm.patch,571 bytes, patch)
2013-02-13 22:35 UTC, Dennis Schridde
Details | Diff
gcc-4.7.2-define-have_gas_aligned_comm.patch (for configure) (gcc-4.7.2-configure-define-have_gas_aligned_comm.patch,491 bytes, patch)
2013-02-13 22:36 UTC, Dennis Schridde
Details | Diff
gcc-4.7.2-inclhack-hpux10_stdio_declarations.patch (gcc-4.7.2-inclhack-hpux10_stdio_declarations.patch,472 bytes, patch)
2013-02-14 19:47 UTC, Dennis Schridde
Details | Diff
gcc-4.7.2-inclhack-hpux10_stdio_declarations.patch (for fixincl.x) (gcc-4.7.2-fixincl-x-inclhack-hpux10_stdio_declarations.patch,424 bytes, patch)
2013-02-14 19:49 UTC, Dennis Schridde
Details | Diff
gcc-4.7.2-libstdc++-v3-crossconfig-support-mingw64.patch (gcc-4.7.2-libstdc++-v3-crossconfig-support-mingw64.patch,351 bytes, patch)
2013-02-14 22:32 UTC, Dennis Schridde
Details | Diff
gcc-4.7.2-libstdc++-v3-crossconfig-support-mingw64.patch (for configure) (gcc-4.7.2-libstdc++-v3-configure-crossconfig-support-mingw64.patch,370 bytes, patch)
2013-02-14 22:33 UTC, Dennis Schridde
Details | Diff
gcc-4.7.2-libstdc++-v3-os_include_dir-and-error_constants_dir-for-mingw64.patch (gcc-4.7.2-libstdc++-v3-os_include_dir-and-error_constants_dir-for-mingw64.patch,408 bytes, patch)
2013-02-14 22:33 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2012-12-18 13:33:59 UTC
x86_64-pc-linux-gnu-gcc -c     -O2 -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-m
acros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/cross-x86_64-pc-mingw64/gcc-4.7.2/work/gcc-4.7.2/gcc -I/var/tmp/portage/cross-x86_64-pc-mingw64/gcc-4.7.2/work/gcc-4.7.2/gcc/. -
I/var/tmp/portage/cross-x86_64-pc-mingw64/gcc-4.7.2/work/gcc-4.7.2/gcc/../include -I/var/tmp/portage/cross-x86_64-pc-mingw64/gcc-4.7.2/work/gcc-4.7.2/gcc/../libcpp/include  -I/var/tmp/portage/cross-x86_64-pc-mingw64/gcc-4.7.2/work/gcc-4.7.
2/gcc/../libdecnumber -I/var/tmp/portage/cross-x86_64-pc-mingw64/gcc-4.7.2/work/gcc-4.7.2/gcc/../libdecnumber/bid -I../libdecnumber    options.c -o options.o
options.c:952:3: error: ‘HAVE_GAS_ALIGNED_COMM’ undeclared here (not in a function)
make[2]: *** [options.o] Error 1


Reproducible: Always




Portage 2.2.0_alpha149 (default/linux/amd64/10.0/desktop/kde, gcc-4.7.2, glibc-2
.16.0, 3.7.0-gentoo x86_64)
=================================================================
System uname: Linux-3.7.0-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor
_5000+-with-gentoo-2.2
Timestamp of tree: Tue, 18 Dec 2012 09:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p39-r1
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo systemd ambro-cross local enlightenment kde sunrise g-ctan
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=athlon64-sse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share
/openvpn/easy-rsa /usr/share/polkit-1/actions /usr/share/themes/oxygen-gtk/gtk-2
.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/neatx/home"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /
etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/san
dbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/te
xmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -O2 -march=athlon64-sse3"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--depclean-lib-check n --with-bdeps y --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg compressdebug config-protect-if
-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch prese
rve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs
 unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://distfile
s.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j3"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress 
--force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/
distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cache/portage/gentoo"
PORTDIR_OVERLAY="/var/lib/layman/systemd /var/lib/layman/ambro-cross /var/cache/
portage/local /var/cache/portage/overlays/enlightenment /var/cache/portage/overl
ays/kde /var/cache/portage/overlays/sunrise /var/lib/g-ctan"
[..]
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAG
E_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


Portage 2.2.0_alpha149 (embedded, gcc-4.7.2, unavailable, 3.7.0-gentoo x86_64)
=================================================================
System uname: Linux-3.7.0-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor
_5000+-with-gentoo-2.2
Timestamp of tree: Tue, 18 Dec 2012 09:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p39-r1
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo systemd ambro-cross local enlightenment kde sunrise g-ctan
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=generic -fomit-frame-pointer"
CHOST="x86_64-pc-mingw64"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share
/openvpn/easy-rsa /usr/share/polkit-1/actions /usr/share/themes/oxygen-gtk/gtk-2
.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/neatx/home"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /
etc/fonts/fonts.conf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc
/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.
d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=generic -fomit-frame-pointer"
DISTDIR="/var/cache/portage/distfiles"
FCFLAGS="-Os -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distloc
ks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch pre
serve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-lo
gs unmerge-orphans userfetch xattr"
FFLAGS="-Os -pipe"
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://distfile
s.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS=""
MAKEOPTS="-j3"
PKGDIR="/usr/x86_64-pc-mingw64/packages/"
PORTAGE_CONFIGROOT="/usr/x86_64-pc-mingw64/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress 
--force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/
distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/usr/x86_64-pc-mingw64/tmp/"
PORTDIR="/var/cache/portage/gentoo"
PORTDIR_OVERLAY="/var/lib/layman/systemd /var/lib/layman/ambro-cross /var/cache/
portage/local /var/cache/portage/overlays/enlightenment /var/cache/portage/overl
ays/kde /var/cache/portage/overlays/sunrise /var/lib/g-ctan"
[...]
USE="amd64 bindist kdrive make-symlinks minimal modules multicall zlib" ELIBC="_
_LIBC__" INPUT_DEVICES="evdev mouse keyboard tslib" KERNEL="linux" LINGUAS="en" 
USERLAND="GNU" VIDEO_CARDS="fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BU
NZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPT
S, USE_PYTHON
Comment 1 Dennis Schridde 2012-12-18 13:34:34 UTC
Created attachment 332638 [details]
gcc-stage1.log
Comment 2 Dennis Schridde 2012-12-18 13:36:25 UTC
Created attachment 332640 [details]
gcc-build-logs
Comment 3 Dennis Schridde 2012-12-18 13:38:12 UTC
Command was:
# crossdev x86_64-pc-mingw64

I edited the make.conf slightly to use -O2 instead of -Os and I set MARCH_TUNE=-march=generic, which was unset before.
Comment 4 Dennis Schridde 2013-01-06 13:59:29 UTC
The error happens in:
const struct gcc_options global_options_init =
{
…
  0, /* TARGET_NOP_FUN_DLLIMPORT */
  HAVE_GAS_ALIGNED_COMM, /* use_pe_aligned_common */
  0, /* ix86_preferred_stack_boundary_arg */
…
};

Apparently HAVE_GAS_ALIGNED_COMM should be defined to some value (probably 0 or 1) depending on the setup.


This seems to stem from gcc-4.7.2/gcc/configure.ac:3604:
    case $target_os in
      cygwin* | pe | mingw32* | interix*)
    # Recent binutils allows the three-operand form of ".comm" on PE.  This
Which should probably be:
     cygwin* | pe | mingw* | interix*)


There are probably similar problems in the following lines:
    case $host in                                                                                                                                                                                                                        
1453: *-*-mingw32*)
    use_cxa_atexit=yes

case $host_os in                                                                                                                                                                                                                        
1656:  win32 | pe | cygwin* | mingw32* | uwin*)
    if test "x$enable_win32_registry" != xno; then

[case $target_os in                                                                                                                                                                                                                     
2565:  win32 | pe | cygwin* | mingw32* | uwin*)
    # Need to check that we generated the correct relocation for the
Comment 5 Dennis Schridde 2013-01-06 14:08:52 UTC
I reported the issue upstream: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55886
Comment 6 Dennis Schridde 2013-02-13 22:35:19 UTC
Created attachment 338806 [details, diff]
gcc-4.7.2-define-have_gas_aligned_comm.patch

Attached patch fixes this error. However, I ran into another problem where build/./gcc/include-fixed/stdio.h was messed up and created another GCC bug about it.

See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56311
Comment 7 Dennis Schridde 2013-02-13 22:36:59 UTC
Created attachment 338808 [details, diff]
gcc-4.7.2-define-have_gas_aligned_comm.patch (for configure)

Attached patch fixes configure directly, because gcc does not run eautoreconf.
Comment 8 Dennis Schridde 2013-02-14 19:47:53 UTC
Created attachment 338892 [details, diff]
gcc-4.7.2-inclhack-hpux10_stdio_declarations.patch

(In reply to comment #6)
> Attached patch fixes this error. However, I ran into another problem where
> build/./gcc/include-fixed/stdio.h was messed up and created another GCC bug
> about it.

Attached patch fixes this issue for me. Since Gentoo does not support HP-UX, it should be safe to apply.
Comment 9 Dennis Schridde 2013-02-14 19:49:08 UTC
Created attachment 338894 [details, diff]
gcc-4.7.2-inclhack-hpux10_stdio_declarations.patch (for fixincl.x)

Attached patch fixes the generated fixincl.x code directly, because the build-system does not automatically regenerate it.
Comment 10 Dennis Schridde 2013-02-14 19:49:50 UTC
With both (or rather: all 4) patches applied, gcc-4.7.2 builds for x86_64-pc-mingw64 here.
Comment 11 Dennis Schridde 2013-02-14 22:31:47 UTC
I ran into more issues when building libstdc++-v3 for this target. Patches attached.

See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56332
Comment 12 Dennis Schridde 2013-02-14 22:32:51 UTC
Created attachment 338906 [details, diff]
gcc-4.7.2-libstdc++-v3-crossconfig-support-mingw64.patch
Comment 13 Dennis Schridde 2013-02-14 22:33:18 UTC
Created attachment 338908 [details, diff]
gcc-4.7.2-libstdc++-v3-crossconfig-support-mingw64.patch (for configure)
Comment 14 Dennis Schridde 2013-02-14 22:33:32 UTC
Created attachment 338910 [details, diff]
gcc-4.7.2-libstdc++-v3-os_include_dir-and-error_constants_dir-for-mingw64.patch
Comment 15 Ryan Hill (RETIRED) gentoo-dev 2013-02-18 00:46:25 UTC
So now that you're using the right triplet, how much of this is valid?
Comment 16 Dennis Schridde 2013-02-18 16:35:04 UTC
(In reply to comment #15)
> So now that you're using the right triplet, how much of this is valid?

x86_64-w64-mingw32 and i686-w32-mingw32 build without any of the patches. Though I now think that maybe crossdev could warn about the wrong triplets...
Comment 17 SpanKY gentoo-dev 2013-03-28 05:09:07 UTC
(In reply to comment #16)

there is, almost literally, no way for crossdev to know what is "valid".  that is entirely up to the toolchain packages (and their versions).  binutils supports some obscure targets than gcc/glibc doesn't.  add in the huge variety of naming conventions.

i've made "mingw64" into an alias for "x86_64-w64-mingw32".