Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 590974 - sys-apps/memtest86+ fails to build on hardened: undefined reference to `__stack_chk_fail'
Summary: sys-apps/memtest86+ fails to build on hardened: undefined reference to `__sta...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-10 19:23 UTC by Eugene Shalygin
Modified: 2017-03-14 23:37 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,7.91 KB, text/x-log)
2016-08-10 19:23 UTC, Eugene Shalygin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Shalygin 2016-08-10 19:23:27 UTC
Created attachment 442980 [details]
build.log

x86_64-pc-linux-gnu-ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o smp.o vmem.o random.o
test.o: In function `L24':
test.c:(.text+0xa97): undefined reference to `__stack_chk_fail'
test.o: In function `L7':
test.c:(.text+0xe23): undefined reference to `__stack_chk_fail'
test.o: In function `L43':
test.c:(.text+0x12ab): undefined reference to `__stack_chk_fail'
test.o: In function `L73':
test.c:(.text+0x166c): undefined reference to `__stack_chk_fail'
test.o: In function `L123':
test.c:(.text+0x1a60): undefined reference to `__stack_chk_fail'
make: *** [Makefile:28: memtest_shared] Error 1
Comment 1 Eugene Shalygin 2016-08-10 19:24:47 UTC
$ emerge --info sys-apps/memtest86+
Portage 2.3.0 (python 3.5.2-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-6.1.0, glibc-2.23-r2, 4.7.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.7.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-4810MQ_CPU_@_2.80GHz-with-gentoo-2.2
KiB Mem:    32867088 total,   3702480 free
KiB Swap:   33554428 total,  33554292 free
sh bash 4.3_p46
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p46::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/cmake:           3.6.1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2-r1::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo
sys-devel/gcc:            5.3.0::gentoo, 6.1.0::hardened-development
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /var/portage/gentoo
    sync-type: git
    sync-uri: git://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

alexxy
    location: /var/portage/repository/alexxy
    sync-type: git
    sync-uri: git://anongit.gentoo.org/dev/alexxy.git
    masters: gentoo
    priority: 50

andy
    location: /var/portage/repository/andy
    sync-type: git
    sync-uri: git://anongit.gentoo.org/user/andy.git
    masters: gentoo
    priority: 50

bobwya
    location: /var/portage/repository/bobwya
    sync-type: git
    sync-uri: https://github.com/bobwya/miscellaneous_ebuilds.git
    masters: gentoo
    priority: 50

dotnet
    location: /var/portage/repository/dotnet
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/dotnet.git
    masters: gentoo
    priority: 50

eigenlay
    location: /var/portage/repository/eigenlay
    sync-type: git
    sync-uri: https://git.gitorious.org/eigennet/eigenlay.git
    masters: gentoo
    priority: 50

fkmclane
    location: /var/portage/repository/fkmclane
    sync-type: laymansync
    sync-uri: git://github.com/fkmclane/overlay.git
    masters: gentoo
    priority: 50

gamerlay
    location: /var/portage/repository/gamerlay
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/gamerlay.git
    masters: gentoo
    priority: 50

hardened-development
    location: /var/portage/repository/hardened-development
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/hardened-dev.git
    masters: gentoo
    priority: 50

kde
    location: /var/portage/repository/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

multimedia
    location: /var/portage/repository/multimedia
    sync-type: git
    sync-uri: https://github.com/gentoo/multimedia.git
    masters: gentoo
    priority: 50

mv
    location: /var/portage/repository/mv
    sync-type: git
    sync-uri: git://anongit.gentoo.org/user/mv.git
    masters: gentoo
    priority: 50

qt
    location: /var/portage/repository/qt
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

raiagent
    location: /var/portage/repository/raiagent
    sync-type: git
    sync-uri: git://github.com/leycec/raiagent.git
    masters: gentoo
    priority: 50

rion
    location: /var/portage/repository/rion
    sync-type: git
    sync-uri: git://github.com/rion-overlay/rion-overlay.git
    masters: gentoo
    priority: 50

science
    location: /var/portage/repository/science
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/sci.git
    masters: gentoo
    priority: 50

spike
    location: /var/portage/repository/spike
    sync-type: git
    sync-uri: https://github.com/Spike-Pentesting/spike-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/portage/repository/steam-overlay
    sync-type: git
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

sunrise
    location: /var/portage/repository/sunrise
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/sunrise-reviewed.git
    masters: gentoo
    priority: 50

systemd
    location: /var/portage/repository/systemd
    sync-type: git
    sync-uri: git://anongit.gentoo.org/user/systemd.git
    masters: gentoo
    priority: 50

x11
    location: /var/portage/repository/x11
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/x11
    masters: gentoo
    priority: 50

fontconfig-ultimate
    location: /var/portage/repository/fontconfig-ultimate
    masters: gentoo
    priority: 80

my-gentoo
    location: /var/portage/repository/my-gentoo
    masters: gentoo
    priority: 80

xanf
    location: /home/eugene/develop/xanf/distribution/Gentoo/repository
    masters: gentoo
    priority: 80

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA @FSF-APPROVED google-chrome skype-eula dlj-1.1 PUEL Google-TOS googleearth TeamViewer Oracle-BCLA-JavaSE skype-4.0.0.7-copyright AdobeFlash-11.x Intel-SDP"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -flto=4 -fuse-linker-plugin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /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="-march=native -O2 -pipe -flto=4 -fuse-linker-plugin"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://de-mirror.org/gentoo/"
LANG="uk_UA.UTF-8"
LDFLAGS="-Wl,-O1 -march=native -O2 -pipe -flto=4 -fuse-linker-plugin"
MAKEOPTS="-j4"
PKGDIR="/var/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--quiet"
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/portage/tmp"
USE="X a52 aac acl acpi alsa amd64 amr apng attica avahi bash-completion berkdb bluetooth bluray branding bs2b btrfs bzip2 cairo canberra caps cdda cdr cli colord cracklib crypt css cups cxx dbus declarative dirac djvu dovecot dri dts dv dvd dvdnav dvdr efi egl emboss encode exif faac fam ffmpeg firefox flac fontconfig fortran fuse gdbm geoip gif git glamor gnuplot gnutls gold gpm gsm gstreamer gtk gtk3 harfbuzz iconv idn ieee1394 imagemagick inotify iproute2 ipv6 jemalloc jit jpeg jpeg2k kde kerberos kipi lame lapack latex lcms ldap libass libinput libnotify libsamplerate libsecret live lto luatex lzma mad metalink mmx mmxext mng modules mp3 mp4 mpeg mpi mpris mtp multicall multilib ncurses netlink network networkmanager nfs nftables nls nptl ogg openexr opengl openmp openssl pam pango pch pcre pdf phonon pkcs11 plasma png policykit postscript ppds pulseaudio qml qt3support qt4 qt5 quicktime quvi radio readline romio rss rtmp samba scanner sctp sdl seccomp semantic-desktop session slp smartcard smp speex spell sqlite sse sse2 ssl startup-notification svg symlink system-icu system-sqlite systemd taglib tcpd theora threads thumbnail tiff truetype udev udisks unicode upnp upower usb v4l v4l2 vaapi vdpau vim-syntax vorbis vpx wayland widgets wifi wxwidgets x264 x265 xattr xcb xcomposite xetex xft xinerama xml xmp xrandr xscreensaver xv xvid yv12 zeroconf zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 proxy" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2 canon ptp2 fuji" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma fma3 mmx mmxext popcnt sse sse2 sse3 sse4 sse4_1 sse4_2 ssse3" DRACUT_MODULES="caps systemd" ELIBC="glibc" GPSD_PROTOCOLS="garmin garmintxt gpsclock timing" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="keyboard mouse evdev evdev libinput" KERNEL="linux" L10N="en en-GB eo de ru uk ru uk" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer nlpsolver" LINGUAS="en en_GB eo de ru uk ru_RU uk_UA" LIRC_DEVICES="alsa_usb" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_5" RUBY_TARGETS="ruby22 ruby23" SANE_BACKENDS="epson2 net" USERLAND="GNU" VIDEO_CARDS="v4l radeon radeonsi intel i965 amdgpu" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/memtest86+-5.01-r1::gentoo was built with the following:
USE="(policykit) -floppy -serial" ABI_X86="64"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="-march=native -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
Comment 2 SpanKY gentoo-dev 2016-08-11 14:27:45 UTC
does it build when you use a gcc version that's actually in the tree ?
Comment 3 Eugene Shalygin 2016-08-12 13:47:23 UTC
Yes, GCC 5 builds it successfully.
Comment 4 J.Borme 2016-11-01 10:20:04 UTC
I also got link errors with memtest86+ but slightly different. I put it here because I think they might have the same root cause (something to do with the gcc ABI change). The package merges with gcc-4.9.3 (stable) but not with gcc-5.4.0 (~amd64) and also not with gcc-6.2.0-r1 (hardened).

This happened while I recompiled my install with gcc-5.4 and only 3 packages (including memtest86+) among 1379 failed to build.

x86_64-pc-linux-gnu-ld --warn-constructors --warn-common -static -T memtest_shared.lds \
-o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o li
nuxbios.o memsize.o pci.o controller.o random.o spd.o error.o dmi.o cpuid.o && \
x86_64-pc-linux-gnu-ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc
.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o cont
roller.o random.o spd.o error.o dmi.o cpuid.o
lib.o: In function `__inb':
lib.c:(.text+0x0): multiple definition of `__inb'
init.o:init.c:(.text+0x0): first defined here
lib.o: In function `__inbc':
lib.c:(.text+0x10): multiple definition of `__inbc'
init.o:init.c:(.text+0x10): first defined here

[... lots of similar lines ...]
Comment 5 SpanKY gentoo-dev 2016-12-07 08:01:05 UTC
(In reply to Jérôme Borme from comment #4)

your error messages imply you're not building the latest 5.01-r2
Comment 6 SpanKY gentoo-dev 2016-12-07 08:01:56 UTC
this bug should be fixed by:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a1ef46c041d7851ff0bb27ddb3bd321afebed8f

the test.c & random.c files were missing -fno-stack-protector.