Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] relocation R_X86_64_PC32 against undefined symbol
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Tue Jun 20, 2017 10:57 am    Post subject: [SOLVED] relocation R_X86_64_PC32 against undefined symbol Reply with quote

[Moderator note: this was originally posted as a reply to a similar looking, but unrelated, problem report in [SOLVED] gcc broken after being build in a hardened binhost. Since that thread seems to have a different problem, and had been marked solved, I moved this problem to a separate thread. -Hu]

Hi,

I have the same problem here, but already had gcc-config set to vanilla 5.4.0.
Though changed it to "normal" one, it doesnt change anything, the errors occur again.

Code:
/x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status


building libtool worked fine,
gcc (and almost any other package) fails to merge.

any ideas?

greets


Last edited by drt on Thu Jul 20, 2017 4:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Tue Jun 20, 2017 1:18 pm    Post subject: Reply with quote

drt wrote:
I have the same problem here, but already had gcc-config set to vanilla 5.4.0.
Though changed it to "normal" one, it doesnt change anything, the errors occur again.

Code:
/x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status


building libtool worked fine,
gcc (and almost any other package) fails to merge.


Could you post the output of:

Code:
gcc-config -l



What I did, was to build sys-devel/gcc-5.4.0-r3 with vainilla sys-devel/gcc-4.9.4. When sys-devel/gcc-5.4.0-r3 was build, I changed the profile to hardened.

Cheers1
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Take care of the community answering unanswered posts.
Back to top
View user's profile Send private message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Tue Jun 20, 2017 3:12 pm    Post subject: Reply with quote

Hi,
thanks for the quick answer!
Of course, here it is:

Code:
Host ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-5.4.0 *
 [2] x86_64-pc-linux-gnu-5.4.0-hardenednopie
 [3] x86_64-pc-linux-gnu-5.4.0-hardenednopiessp
 [4] x86_64-pc-linux-gnu-5.4.0-hardenednossp
 [5] x86_64-pc-linux-gnu-5.4.0-vanilla

Code:

Sigma ~ # eselect profile list
Available profile symlink targets:
  [1]   default/linux/amd64/13.0
  [2]   default/linux/amd64/13.0/selinux
  [3]   default/linux/amd64/13.0/desktop
  [4]   default/linux/amd64/13.0/desktop/gnome
  [5]   default/linux/amd64/13.0/desktop/gnome/systemd
  [6]   default/linux/amd64/13.0/desktop/plasma
  [7]   default/linux/amd64/13.0/desktop/plasma/systemd
  [8]   default/linux/amd64/13.0/developer
  [9]   default/linux/amd64/13.0/no-multilib
  [10]  default/linux/amd64/13.0/systemd
  [11]  default/linux/amd64/13.0/x32
  [12]  hardened/linux/amd64 *
  [13]  hardened/linux/amd64/selinux
  [14]  hardened/linux/amd64/no-multilib
  [15]  hardened/linux/amd64/no-multilib/selinux
  [16]  hardened/linux/amd64/x32
  [17]  hardened/linux/musl/amd64
  [18]  hardened/linux/musl/amd64/x32
  [19]  default/linux/uclibc/amd64
  [20]  hardened/linux/uclibc/amd64


gcc-5.4.0-r3 fails to merge, either with [1] hardened or [5] vanilla selected.
Code:
Host ~ # emerge --oneshot gcc
...
mv -f mkheadersT mkheaders
x86_64-pc-linux-gnu-gcc -O2 -pipe -Wl,-O1 -Wl,--as-needed -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
yes
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../libiberty/libiberty.a(fopen_unlocked.o): warning: relocation against `stdout@@GLIBC_2.2.5' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: fixincl.o: relocation R_X86_64_PC32 against undefined symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:110: full-stamp] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.4.0-r3/work/build/build-x86_64-pc-linux-gnu/fixincludes'
make[2]: *** [Makefile:2731: all-build-fixincludes] Error 2
...


This error line with "recomple with -fPIC" leads me to the wiki:
https://wiki.gentoo.org/wiki/Project:AMD64/Fixing_-fPIC_Errors_Guide
but unfortunately I do not find anything useful on this.

I tried to merge gcc-4.9.4 with vanilla and hardened set: both fail.

Did you mean, you changed the profile (via eselect or any) to [1] default, set gcc-config to [5] vanilla, then merged gcc-4.9.4 and the set profile and gcc-config back to hardened?

thanks, greets!
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Tue Jun 20, 2017 6:06 pm    Post subject: Reply with quote

drt wrote:
building libtool worked fine,
gcc (and almost any other package) fails to merge.


a) Have you been able to build sys-devel/libtool with sys-devel/gcc-5.4.0?

b) If you write this code into 'test.c':
Code:
#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}

Does gcc test.c -o test compiles? What is the output?

c) This is my output of gcc-config -l
Code:
 [1] x86_64-pc-linux-gnu-4.9.3
 [2] x86_64-pc-linux-gnu-4.9.3-hardenednopie
 [3] x86_64-pc-linux-gnu-4.9.3-hardenednopiessp
 [4] x86_64-pc-linux-gnu-4.9.3-hardenednossp
 [5] x86_64-pc-linux-gnu-4.9.3-vanilla
 [6] x86_64-pc-linux-gnu-4.9.4
 [7] x86_64-pc-linux-gnu-4.9.4-hardenednopie
 [8] x86_64-pc-linux-gnu-4.9.4-hardenednopiessp
 [9] x86_64-pc-linux-gnu-4.9.4-hardenednossp
 [10] x86_64-pc-linux-gnu-4.9.4-vanilla
 [11] x86_64-pc-linux-gnu-5.4.0 *
 [12] x86_64-pc-linux-gnu-5.4.0-hardenednopie
 [13] x86_64-pc-linux-gnu-5.4.0-hardenednopiessp
 [14] x86_64-pc-linux-gnu-5.4.0-hardenednossp
 [15] x86_64-pc-linux-gnu-5.4.0-vanilla


This is what I did:
# gcc-config x86_64-pc-linux-gnu-4.9.4-vanilla
# emerge sys-devel/gcc
# gcc-config x86_64-pc-linux-gnu-5.4.0

As you do not have sys-devl/gcc-4.9.4 installed, the only solution that comes to mind is to install a binary sys-devel/gcc.

Before that, just check this page, just in case there is an easier solution.

Cheers!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Take care of the community answering unanswered posts.
Back to top
View user's profile Send private message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Sun Jul 09, 2017 11:09 am    Post subject: Reply with quote

Hi,

sorry, was quite busy so I didn't manage to answer shortly.

yes, libtool-2.4.6-r3 rebuilds without any hassle, and so does llvm-3.9.1-r1
as suggested at the bottom of gcc-upgrade wiki page.

I created a c-file,
gcc test.c -o test seems to compile, no std-output, no errors,
and the test object-file gets created beside the c-file.

But as I run some merging of world or system, the first package fails immediately,
today it is app-arch/unrar which fails with:
Code:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: consio.o: warning: relocation against `stdout@@GLIBC_2.2.5' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: consio.o: relocation R_X86_64_PC32 against undefined symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [../makefile:148: unrar] Error 1


If I run revdev-rebuild it says the system is consistent and doesn't merge anything.
If I try to run
Quote:
revdep-rebuild --library 'libstdc++.so.6' -- --exclude gcc

it fails at first package ncurses with
Code:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-libs/ncurses-6.0-r1/temp/cc1Ql4SH.o: warning: relocation against `stdin@@GLIBC_2.2.5' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-libs/ncurses-6.0-r1/temp/cc1Ql4SH.o: relocation R_X86_64_PC32 against undefined symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sun Jul 09, 2017 4:51 pm    Post subject: Reply with quote

I think your relocation problem is different from the original poster's. OP had an unrecognized relocation. You have a recognized but unusable relocation. Please post the output of emerge --info (Portage should have told you to do this as part of its error output).
Back to top
View user's profile Send private message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Mon Jul 10, 2017 4:16 pm    Post subject: Reply with quote

Hi,

hmm, I think you're right.
Should I open a separate topic insted of posting in this (solved) one?

here's the outputs:
Code:
Host ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-5.4.0 *
 [2] x86_64-pc-linux-gnu-5.4.0-hardenednopie
 [3] x86_64-pc-linux-gnu-5.4.0-hardenednopiessp
 [4] x86_64-pc-linux-gnu-5.4.0-hardenednossp
 [5] x86_64-pc-linux-gnu-5.4.0-vanilla


Code:
Host ~ # emerge --info
Portage 2.3.6 (python 2.7.12-final-0, hardened/linux/amd64, gcc-5.4.0, glibc-2.23-r4, 4.8.17-hardened-r2 x86_64)
=================================================================
System uname: Linux-4.8.17-hardened-r2-x86_64-Intel-R-_Pentium-R-_CPU_G3420_@_3.20GHz-with-gentoo-2.3
KiB Mem:     3458292 total,     46388 free
KiB Swap:     524284 total,    463668 free
Timestamp of repository gentoo: Sun, 09 Jul 2017 09:30:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.26.2::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

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

gentoo-kodi-overlay
    location: /var/lib/layman/gentoo-kodi-overlay
    masters: gentoo
    priority: 50

Installed sets: @steam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA GIMPS"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inode.at/ ftp://gentoo.lagis.at/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/"
LANG="en_US.iso88591"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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="X acl alsa amd64 apache2 avahi berkdb bzip2 cli consolekit cracklib crypt cxx dri gdbm hardened iconv justify lm_sensors modules multilib mysql ncurses nls nptl opengl openmp pam pax_kernel pcre pie pulseaudio readline seccomp session ssl ssp tcpd truetype unicode urandom vaapi xattr xmlrpc xtpax zlib" 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" 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 popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" 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" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="intel i965" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


thanks!
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 713
Location: Barcelona, Spain

PostPosted: Mon Jul 10, 2017 6:13 pm    Post subject: Reply with quote

drt wrote:
I created a c-file,
gcc test.c -o test seems to compile, no std-output, no errors,
and the test object-file gets created beside the c-file.


Good! gcc is working!

Hu wrote:
I think your relocation problem is different from the original poster's


Yes, you are right! Coult this be related with binutils?

drt wrote:
sys-devel/binutils: 2.26.1::gentoo


This is what I have in my emerge --info:

Quote:
sys-devel/binutils: 2.26.1::gentoo, 2.28-r2::gentoo


Cheers!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
Take care of the community answering unanswered posts.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Tue Jul 11, 2017 12:09 am    Post subject: Reply with quote

drt wrote:
hmm, I think you're right.
Should I open a separate topic insted of posting in this (solved) one?
No need. I moved it to a new thread.

Unfortunately, I do not know how to solve your problem. Perhaps someone else will see this unsolved thread and offer useful advice.
Back to top
View user's profile Send private message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Tue Jul 11, 2017 5:52 am    Post subject: Reply with quote

Ah, thank you very much.

binutils-2.28-r2 is awaiting installation, but compiling also fails with some similar error message.

Code:
Host  ~ # tail -n50 /var/tmp/portage/sys-devel/binutils-2.28-r2/temp/build.log

else true; fi
make[2]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build/libiberty'
make[2]: Entering directory '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build/bfd'
rm -f elf32-target.h
rm -f elf64-target.h
/bin/sed -e s/NN/32/g < /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/elfxx-target.h > elf32-target.new
creating bfdver.h
/bin/sed -e s/NN/64/g < /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/elfxx-target.h > elf64-target.new
mv -f elf32-target.new elf32-target.h
mv -f elf64-target.new elf64-target.h
rm -f targmatch.h
/bin/sed -f /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/targmatch.sed < /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/config.bfd > targmatch.new
Making info in doc
make[3]: Entering directory '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build/bfd/doc'
x86_64-pc-linux-gnu-gcc -o chw$$ -O2 -pipe \
  -Wl,-O1 -Wl,--as-needed  -I.. -I/var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/.. -I/var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/../../include -I/var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/../../intl -I../../intl /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/chew.c; \
/bin/sh /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/../../move-if-change \
  chw$$ chew; \
touch chew.stamp
mv -f targmatch.new targmatch.h
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-devel/binutils-2.28-r2/temp/cczDnsCO.o: warning: relocation against `stdout@@GLIBC_2.2.5' in readonly section `.text.startup'.
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-devel/binutils-2.28-r2/temp/cczDnsCO.o: relocation R_X86_64_PC32 against undefined symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
mv: cannot stat 'chw31382': No such file or directory
./chew -f /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/doc.str < /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/../aoutx.h >aoutx.tmp
./chew -f /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/doc.str < /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/../archive.c >archive.tmp
./chew -f /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/doc.str < /var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28/bfd/doc/../archures.c >archures.tmp
/bin/sh: ./chew: No such file or directory
make[3]: *** [Makefile:848: aoutx.stamp] Error 127
make[3]: *** Waiting for unfinished jobs....
/bin/sh: ./chew: No such file or directory
/bin/sh: ./chew: No such file or directory
make[3]: *** [Makefile:855: archive.stamp] Error 127
make[3]: *** [Makefile:862: archures.stamp] Error 127
make[3]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build/bfd/doc'
make[2]: *** [Makefile:1725: info-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build/bfd'
make[1]: *** [Makefile:2726: all-bfd] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build'
make: *** [Makefile:851: all] Error 2
 * ERROR: sys-devel/binutils-2.28-r2::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-devel/binutils-2.28-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/binutils-2.28-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/binutils-2.28-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/binutils-2.28-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/build'
 * S: '/var/tmp/portage/sys-devel/binutils-2.28-r2/work/binutils-2.28'


I had binutils-2.28-r2 installed before (and had the same error), then after masking latest gcc-5.4.0 and binutils-2.28 a depclean removed the 2.28 and omitted the 2.26, thats why I have currently only 2.26 installed.
But - the problems still existed when I had 2.28 installed.

I wonder why nearly all merges fail including any version of gcc and sys-devel/llvm,
but sys-devel/libtool-2.4.6-r3 and dev-libs/boost-1.62.0-r1 merge flawlessy without any issues. :?:

thank you guys a lot!
Back to top
View user's profile Send private message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Fri Jul 14, 2017 8:58 am    Post subject: Reply with quote

no idea, anyone?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Fri Jul 14, 2017 9:18 am    Post subject: Reply with quote

drt,

Code:
R_X86_64_PC32 against undefined symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC


Add -fPIC to your CFLAGS and CXXFLAGS. Its standard with the hardened profile, and is set as default in gcc with the pie and ssp USE flags, which you have set.
However its not normally used (yet) in 32 bit code.
It looks like you have partially moved to the /17.0/ profiles which are still hidden for testing.

Expect to find other issues like this. Your settings (and some others) will become Gentoo defaults when the /17.0/ profiles are unmasked.
That requires gcc-6 going stable.

If you feel adventurous, you can unmask gcc-6 now (its in testing) and switch to the /17.0/ profile. You are almost there anyway.
You will need to rebuild all of your static libs as mixing pie and non pie things is a very bad thing.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4554
Location: Germany

PostPosted: Fri Jul 14, 2017 10:56 am    Post subject: Reply with quote

NeddySeagoon wrote:
[...]
You will need to rebuild all of your static libs as mixing pie and non pie things is a very bad thing.

Yes.. :-/
For rebuilding all installed packages that installed static libs, using
Code:
emerge -av1 $(find /lib* /usr/lib* -type f -name "*.a") --exclude='sys-devel/gcc dev-haskell/*'
should be fine.
Back to top
View user's profile Send private message
drt
n00b
n00b


Joined: 29 Apr 2017
Posts: 33

PostPosted: Thu Jul 20, 2017 4:11 pm    Post subject: Reply with quote

Hey folks,

thank you guys, that did the trick! :D

Firstly I avoided adding -fPIC to the CFLAGS, because of the note in the wiki page:
Quote:
In this case, globally adding -fPIC to C[XX]FLAGS resolves the issue, although this practice is discouraged because the executable end up being PIC-enabled as well.
Source: https://wiki.gentoo.org/wiki/Project:AMD64/Fixing_-fPIC_Errors_Guide

but anyway, I tried it, it didn't help, same error.

Executing Josefs code did work flawlessy, and so did every other merge after that.

Quote:
If you feel adventurous, ...

:D After that experience I do not feel like that, but thanks for pointing out anyway.

I wonder how it could be, that I am almost at /17.0/ profile...
...but now, as all is working, I feel fine. :9

thanks a lot you guys out there!

greets
Back to top
View user's profile Send private message
provod
n00b
n00b


Joined: 18 Oct 2017
Posts: 8

PostPosted: Wed Oct 18, 2017 7:33 am    Post subject: Reply with quote

I had an issue with similar symptoms. I was doing a fresh gentoo install using hardened stage3. As the target machine is relatively slow (GPD Pocket) I was setting up distcc at the very beginning, before doing any big emerges.
I set up CFLAGS according to this page: https://wiki.gentoo.org/wiki/Distcc. It suggests using this code to distribute -march=native compilation:
Code:
gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/^.* - //g;'


Directly using output of this command as CFLAGS on hardened breaks many packages, e.g. openssl, perl and python. They complain about R_X86_64_PC32 and related relocations.
Turns out, this last part of the command output is to blame:
Code:
-mtune=generic -fno-strict-overflow -fPIE -fstack-protector-all -fstack-check=specific

I'm not sure which specific flag causes this (investigating this is requires time), but removing all of these from CFLAGS solved the issue for me.

Hope that can be useful for anyone googling for the same issue.
Back to top
View user's profile Send private message
NightMonkey
Guru
Guru


Joined: 21 Mar 2003
Posts: 356
Location: Philadelphia, PA

PostPosted: Wed Dec 06, 2017 2:15 am    Post subject: Reply with quote

Josef.95 wrote:
NeddySeagoon wrote:
[...]
You will need to rebuild all of your static libs as mixing pie and non pie things is a very bad thing.

Yes.. :-/
For rebuilding all installed packages that installed static libs, using
Code:
emerge -av1 $(find /lib* /usr/lib* -type f -name "*.a") --exclude='sys-devel/gcc dev-haskell/*'
should be fine.


Just FYI, this solved problems for me migrating today, under the "official" release of profile 17.0. Thank you, Josef.95.
_________________
:D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum