Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 539656 - games-emulation/yabause-0.9.14:d - ../libyabause.a(linkage_x64.s.o): relocation R_X86_64_32S against `master_ip' can not be used when making a shared object; recompile with -fPIC ../libyabause.a: error adding symbols: Bad value
Summary: games-emulation/yabause-0.9.14:d - ../libyabause.a(linkage_x64.s.o): relocati...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-10 17:44 UTC by Toralf Förster
Modified: 2018-05-03 00:23 UTC (History)
2 users (show)

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


Attachments
emerge log (games-emulation:yabause-0.9.10:20150209-054741.log,75.19 KB, text/plain)
2015-02-11 21:29 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2015-02-10 17:44:21 UTC
Linking C executable yabause
cd /var/tmp/portage/games-emulation/yabause-0.9.14/work/yabause-0.9.14_build/src/gtk && /usr/bin/cmake -E cmake_link_script CMakeFiles/yabause-gtk.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-gcc  -O2 -pipe   -Wdeclaration-after-statement -I/usr/include/gdk-pixbuf-2.0   -Wl,-O1 -Wl,--as-needed CMakeFiles/yabause-gtk.dir/gtk-compat.c.o CMakeFiles/yabause-gtk.dir/gtkglwidget.c.o CMakeFiles/yabause-gtk.dir/main.c.o CMakeFiles/yabause-gtk.dir/menu.c.o CMakeFiles/yabause-gtk.dir/pergtk.c.o CMakeFiles/yabause-gtk.dir/settings.c.o CMakeFiles/yabause-gtk.dir/yuicheckbutton.c.o CMakeFiles/yabause-gtk.dir/yuifileentry.c.o CMakeFiles/yabause-gtk.dir/yuiinputentry.c.o CMakeFiles/yabause-gtk.dir/yuim68k.c.o CMakeFiles/yabause-gtk.dir/yuimem.c.o CMakeFiles/yabause-gtk.dir/yuipage.c.o CMakeFiles/yabause-gtk.dir/yuirange.c.o CMakeFiles/yabause-gtk.dir/yuiresolution.c.o CMakeFiles/yabause-gtk.dir/yuiscreenshot.c.o CMakeFiles/yabause-gtk.dir/yuiscsp.c.o CMakeFiles/yabause-gtk.dir/yuiscudsp.c.o CMakeFiles/yabause-gtk.dir/yuish.c.o CMakeFiles/yabause-gtk.dir/yuitransfer.c.o CMakeFiles/yabause-gtk.dir/yuivdp1.c.o CMakeFiles/yabause-gtk.dir/yuivdp2.c.o CMakeFiles/yabause-gtk.dir/yuiviewer.c.o CMakeFiles/yabause-gtk.dir/yuiwindow.c.o  -o yabause -rdynamic ../libyabause.a -lm -lGLU -lGL -lSM -lICE -lX11 -lXext -lglut -lXmu -lXi -lXrandr -lX11 -lglib-2.0 -lgobject-2.0 -latk-1.0 -lgio-2.0 -lgthread-2.0 -lgmodule-2.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lpangocairo-1.0 -lpangoft2-1.0 -lpangoxft-1.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -lgtkglext-x11-1.0 -lgdkglext-x11-1.0 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: ../libyabause.a(linkage_x64.s.o): relocation R_X86_64_32S against `master_ip' can not be used when making a shared object; recompile with -fPIC
../libyabause.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
src/gtk/CMakeFiles/yabause-gtk.dir/build.make:661: recipe for target 'src/gtk/yabause' failed
make[2]: *** [src/gtk/yabause] Error 1
make[2]: Leaving directory '/var/tmp/portage/games-emulation/yabause-0.9.14/work/yabause-0.9.14_build'
CMakeFiles/Makefile2:194: recipe for target 'src/gtk/CMakeFiles/yabause-gtk.dir/all' failed
make[1]: *** [src/gtk/CMakeFiles/yabause-gtk.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/games-emulation/yabause-0.9.14/work/yabause-0.9.14_build'
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: games-emulation/yabause-0.9.14::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=games-emulation/yabause-0.9.14::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=games-emulation/yabause-0.9.14::gentoo'`.
 * The complete build log is located at '/var/log/portage/games-emulation:yabause-0.9.14:20150210-050655.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/games-emulation/yabause-0.9.14/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/games-emulation/yabause-0.9.14/temp/environment'.
 * Working directory: '/var/tmp/portage/games-emulation/yabause-0.9.14/work/yabause-0.9.14_build'
 * S: '/var/tmp/portage/games-emulation/yabause-0.9.14/work/yabause-0.9.14'


! ! !  This is a build bot chroot image at a hardened amd64 host ! ! !

Portage 2.2.15 (python 3.3.5-final-0, hardened/linux/amd64, gcc-4.9.2, glibc-2.20-r1, 3.18.5-hardened-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.18.5-hardened-r1-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16166860 total,   1216216 free
KiB Swap:   16777212 total,  16752008 free
Timestamp of tree: Tue, 10 Feb 2015 02:45:01 +0000
sh bash 4.3_p33-r1
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p33-r1
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9-r1, 3.3.5-r1
dev-util/cmake:           3.1.0
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.9
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6-r1, 1.13.4, 1.15
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.9.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.5
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.18 (virtual/os-headers)
sys-libs/glibc:           2.20-r1
Repositories:
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2015-02-11 08:17:53 UTC
does it build with MAKEOPTS=-j1 ?
Comment 2 Toralf Förster gentoo-dev 2015-02-11 19:19:45 UTC
(In reply to Mr. Bones. from comment #1)
> does it build with MAKEOPTS=-j1 ?

sry, forgot to mention - the tinderbox uses -j1 per default
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2015-02-11 19:53:20 UTC
builds fine for me on stable amd64 so try it with stable toolchain.
Comment 4 Toralf Förster gentoo-dev 2015-02-11 21:26:21 UTC
(In reply to Mr. Bones. from comment #3)
> builds fine for me on stable amd64 so try it with stable toolchain.

The stable tinderbox masked the package too due to a build failure :

# grep yab amd64/etc/portage/package.mask/*
amd64/etc/portage/package.mask/package.mask.amd64:<=games-emulation/yabause-0.9.10
Comment 5 Toralf Förster gentoo-dev 2015-02-11 21:29:55 UTC
Created attachment 396208 [details]
emerge log
Comment 6 Mr. Bones. (RETIRED) gentoo-dev 2015-02-11 21:35:14 UTC
well that's a much earlier version.  Can you try it with the stable toolchain and the latest version?  Since I can't reproduce it here you're going to have to the the heavy lifting to track down the issue.
Comment 7 Toralf Förster gentoo-dev 2015-02-12 19:56:12 UTC
(In reply to Mr. Bones. from comment #6)
> well that's a much earlier version.  Can you try it with the stable
> toolchain and the latest version?  Since I can't reproduce it here you're
> going to have to the the heavy lifting to track down the issue.

0.9.14 builds fine at a stable amd64 chroot
Comment 8 Mr. Bones. (RETIRED) gentoo-dev 2015-02-12 22:32:05 UTC
thanks for checking.  maybe a gcc-4.9 issue so ccing toolchain just in case.
Comment 9 Magnus Granberg gentoo-dev 2015-02-12 23:01:57 UTC
With a hardened compiler we build with PIE as default and when you link in
static libs you will get link error when you don't compile the lib with pic or use a shared lib version of the lib.
Comment 10 Mr. Bones. (RETIRED) gentoo-dev 2015-02-13 04:52:33 UTC
So, is it legit to just append-ldflags -fPIC or is there a better way?
Comment 11 SpanKY gentoo-dev 2015-05-19 04:11:26 UTC
it's not a toolchain problem.  this package has assembly code that is not PIC clean.  adding -fPIC won't help as the hardened toolchain already does that implicitly for you :).

there's two options:
(1) if the assembly is optional, put it behind USE=pic and report it upstream
(2) fix the assembly and send that upstream

see this guide we wrote a while back for cases exactly like this:
https://wiki.gentoo.org/wiki/Hardened/Textrels_Guide

a quick glance at the assembly shows that it's calling symbols directly rather than going through the PLT, so that code would need rewriting slightly.
Comment 12 Mr. Bones. (RETIRED) gentoo-dev 2015-05-22 16:56:15 UTC
ok, there was already a cmake variable to not use the asm so I added the pic USE flag there.
Comment 13 Samuel Bauer 2018-05-03 00:23:38 UTC
https://bugs.gentoo.org/654674

Sorry about not sharing this before