Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 629128 - gcc 6.4.0 bootstrap on FreeBSD: error: multiple types in one declaration
Summary: gcc 6.4.0 bootstrap on FreeBSD: error: multiple types in one declaration
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-28 03:21 UTC by Pengcheng Xu
Modified: 2018-01-03 11:07 UTC (History)
1 user (show)

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


Attachments
build.log, bzip2-compressed (build.log.bz2,66.93 KB, application/x-bzip)
2017-08-28 03:22 UTC, Pengcheng Xu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pengcheng Xu 2017-08-28 03:21:02 UTC
Updating from 9.1 to 10.3. Neither leaving the old CHOST "x86_64-gentoo-freebsd9.1" nor using the new one "x86_64-gentoo-freebsd10.3" works, they fail at exactly the same point.

I'm using a clang profile; this build.log is generated with CC=gcc CXX=g++; building it with clang fails more earlier.

Portage 2.3.8 (python 3.4.6-final-0, default/bsd/fbsd/amd64/10.3/clang, gcc-4.6.4, freebsd-lib-10.3-r3, 10.3-r6-Gentoo amd64)
=================================================================
System uname: FreeBSD-10.3-r6-Gentoo-amd64-64bit-ELF
KiB Mem:     8363612 total
KiB Swap:    2097048 total
Timestamp of repository gentoo: Sun, 27 Aug 2017 07:00:01 +0000
Head commit of repository gentoo: e63a1ba6346da70d5a896393f0c28cef6a6fd868
sh sh
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:         4.2_p45::gentoo
dev-lang/perl:           5.16.3::gentoo
dev-lang/python:         2.7.13::gentoo, 3.4.6::gentoo
dev-util/cmake:          3.9.1::gentoo
dev-util/pkgconfig:      0.28::gentoo
sys-apps/baselayout:     2.2::gentoo
sys-apps/openrc:         0.29::gentoo
sys-devel/autoconf:      2.69::gentoo
sys-devel/automake:      1.9.6-r3::gentoo, 1.13.4::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:      2.25.1-r1::gentoo, 2.28.1::gentoo
sys-devel/gcc:           4.6.4::gentoo
sys-devel/gcc-config:    1.8::gentoo
sys-devel/libtool:       2.4.6-r4::gentoo
sys-devel/make:          3.82-r4::gentoo
sys-freebsd/freebsd-lib: 10.3-r3::gentoo (virtual/os-headers)
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

localrepo
    location: /usr/local/portage
    masters: gentoo

ACCEPT_KEYWORDS="amd64-fbsd ~amd64-fbsd"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-gentoo-freebsd10.3"
CFLAGS="-O2 -pipe -mtune=generic"
CHOST="x86_64-gentoo-freebsd10.3"
CONFIG_PROTECT="/boot/device.hints /etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -mtune=generic"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs chflags config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo"
INSTALL_MASK="/usr/lib/systemd"
LDFLAGS=""
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64-fbsd berkdb bindist cracklib crypt cxx dri gdbm iconv ipv6 modules multilib ncurses nls oss pam pcre readline ssl tcpd unicode xattr zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="FreeBSD" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="BSD" VIDEO_CARDS="apm ark chips cirrus cyrix dummy i128 intel mach64 mga nv r128 radeon rendition s3 s3virge savage siliconmotion sis tga trident tseng fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Pengcheng Xu 2017-08-28 03:22:09 UTC
Created attachment 490938 [details]
build.log, bzip2-compressed
Comment 2 Yuta SATOH 2017-08-30 11:06:48 UTC
I've confirmed this problem on Gentoo/FreeBSD 9.1, 11.0.

I don't know what the real cause of this problem is but I know sys-devel/binutils-2.28 or later version causes some serious problems like Segmentation fault.
Would you try binutils-2.27-r1 or older version and please tell me a result?
Thanks.


The following is an additional information for Gentoo/FreeBSD developers,

I've confirmed sys-devel/binutils-2.28.1 works correctly on Gentoo/FreeBSD 11.1. (it's a next version but it isn't available from the official tree yet. I'll open a PR soon.)
I'd like to add '>=sys-devel/binutils-2.28' to profiles/releases/freebsd-{9.1,10.3,11.0}/package.mask instead of looking into the real cause.
Comment 3 Pengcheng Xu 2017-08-30 13:45:32 UTC
Thanks a lot for the information. Replacing the buggy binutils-2.28 with 2.27 saved my day on my work with the clang stage elsewhere (where clang is generating segfaulting binaries).

Unfortunately I'm not able to test if it fixes the problem as I can't reproduce the situation now. The gcc build is stuck at a mysterious "checking for docbook stylesheets for documentation creation...". (despite the fact that the virtual machine has been suspended since the bug was created)

For the binutils problem, I'd recommend removing the ~fbsd keywords from =sys-devel/binutils-2.28.1 as they're known not to work on fbsd now.
Comment 4 Pengcheng Xu 2017-08-30 13:47:15 UTC
Ah sorry, please ignore my previous comment on the binutils issue.
Comment 5 Pengcheng Xu 2017-08-30 16:12:30 UTC
Great! After several annoying kill -HUP $(pgrep xsltproc) 's (which I'm trying to figure out why...), the gcc build succeeded. Seems like masking >=sys-devel/binutils-2.28 for now works perfectly.
Comment 6 Yuta SATOH 2017-11-26 15:10:35 UTC
FYI, I've found the patch for this bug.
If you want to use the binutils-2.28.1 on the older versions of Gentoo/FreeBSD, please apply the patch to sys-freebsd/freebsd-libexec.

Here's the fix for version 11.0:
https://svnweb.freebsd.org/base?view=revision&revision=312401

And, here's the fix for version 10.3:
https://svnweb.freebsd.org/base?view=revision&revision=312402

If you don't want to apply the patch, please add LDFLAGS="-Wl,-z,norelro" to /etc/portage/make.conf as a workaround.
But, be careful. The workaround will disable relro. If possible, please don't use it to keep your computer security.

Thanks.
Comment 7 Yuta SATOH 2018-01-03 11:07:10 UTC
(In reply to Yuta SATOH from comment #6)
> If you don't want to apply the patch, please add LDFLAGS="-Wl,-z,norelro" to
> /etc/portage/make.conf as a workaround.
> But, be careful. The workaround will disable relro. If possible, please
> don't use it to keep your computer security.

When I was updating the upgrade guide, I realized this workaround is incomplete. The gold linker should be disabled to compile gcc:

EXTRA_ECONF="--disable-relro --disable-gold" emerge binutils