Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631258 - media-libs/x265-2.5 : /.../ld: CMakeFiles/.../checkasm-a.asm.o: relocation R_X86_64_PC32 against symbol puts@@GLIBC_2.2.5 can not be used when making a shared object; recompile with -fPIC
Summary: media-libs/x265-2.5 : /.../ld: CMakeFiles/.../checkasm-a.asm.o: relocation R_...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-17 19:38 UTC by Toralf Förster
Modified: 2018-10-01 19:22 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,15.44 KB, text/plain)
2017-09-17 19:38 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,61.50 KB, text/plain)
2017-09-17 19:38 UTC, Toralf Förster
Details
environment (environment,136.09 KB, text/plain)
2017-09-17 19:39 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,12.31 KB, application/x-bzip)
2017-09-17 19:39 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,6.78 KB, application/x-bzip)
2017-09-17 19:39 UTC, Toralf Förster
Details
media-libs:x265-2.5:20170916-164049.log (media-libs:x265-2.5:20170916-164049.log,86.44 KB, text/plain)
2017-09-17 19:39 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 2017-09-17 19:38:53 UTC
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/TestBench.dir/checkasm-a.asm.o: warning: relocation against `puts@@GLIBC_2.2.5' in readonly section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/TestBench.dir/checkasm-a.asm.o: relocation R_X86_64_PC32 against symbol `puts@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/TestBench.dir/build.make:218: test/TestBench] Error 1

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0-desktop_libressl_20170914-215948

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-6.4.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python2.7 (fallback)

java-config:
The following VMs are available for generation-2:
*)	IcedTea JDK 3.5.1 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm

emerge -qpv media-libs/x265
[ebuild  N    ] media-libs/x265-2.5  USE="10bit 12bit {test} -numa -pic (-power8)" ABI_X86="(64) -32 (-x32)"
Comment 1 Toralf Förster gentoo-dev 2017-09-17 19:38:56 UTC
Created attachment 495028 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-09-17 19:38:59 UTC
Created attachment 495030 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2017-09-17 19:39:02 UTC
Created attachment 495032 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2017-09-17 19:39:05 UTC
Created attachment 495034 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2017-09-17 19:39:09 UTC
Created attachment 495036 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2017-09-17 19:39:12 UTC
Created attachment 495038 [details]
media-libs:x265-2.5:20170916-164049.log
Comment 7 Alexis Ballier gentoo-dev 2017-09-19 22:05:46 UTC
can't reproduce :(
Comment 8 Toralf Förster gentoo-dev 2017-09-20 08:40:19 UTC
(In reply to Alexis Ballier from comment #7)
indeed, currently this issue happens only at this particular image
Comment 9 normaduponte 2017-11-05 12:04:51 UTC
(Bug #616552 might be related to this.)

I get the same failure on my amd64 system with hardened toolchain.

The failure effects only the test-executable `TestBench`, the actual library and executable build fine.

As a workaround I modified the tests/CMakeLists.txt to build the test executable as a static one.
To do this I added `set(CMAKE_EXE_LINKER_FLAGS "-static")` before `add_executable` and `set_target_properties(TestBench PROPERTIES LINK_SEARCH_END_STATIC 1)` after it:


set(CMAKE_EXE_LINKER_FLAGS "-static")
add_executable(TestBench ${YASM_SRC}
    testbench.cpp testharness.h
    pixelharness.cpp pixelharness.h
    mbdstharness.cpp mbdstharness.h
    ipfilterharness.cpp ipfilterharness.h
    intrapredharness.cpp intrapredharness.h)
set_target_properties(TestBench PROPERTIES LINK_SEARCH_END_STATIC 1)


In my tests, omitting the `set_target_properties(TestBench PROPERTIES LINK_SEARCH_END_STATIC 1)` yields successful builds of `TestBench` in the `main12` and `main10` variant but fails in the `main` variant with


/usr/bin/x86_64-pc-linux-gnu-g++  -march=native -O2 -pipe -fPIC  -static -rdynamic -L. -Wl,-Bsymbolic,-znoexecstack -L.. CMakeFiles/TestBench.dir/checkasm-a.asm.o CMakeFiles/TestBench.dir/testbench.cpp.o CMakeFiles/TestBench.dir/pixelharness.cpp.o CMakeFiles/TestBench.dir/mbdstharness.cpp.o CMakeFiles/TestBench.dir/ipfilterharness.cpp.o CMakeFiles/TestBench.dir/intrapredharness.cpp.o  -o TestBench ../libx265.a -lpthread -lrt -ldl -Wl,-Bstatic -lx265_main12 -lx265_main10 -Wl,-Bdynamic
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../lib64/libpthread.a(elision-lock.o): In function `elision_init':
elision-lock.c:(.text+0x25): undefined reference to `_dl_x86_cpu_features'


removing the last argument, namely `-Wl,-Bdynamic`, solves this (and that is what `LINK_SEARCH_END_STATIC` does).

Does this look like a suitable workaround?
Comment 10 Toralf Förster gentoo-dev 2017-12-30 22:35:01 UTC
Hhm, maybe a dup of bug #583842 ?
Comment 11 normaduponte 2018-01-03 10:20:51 UTC
> Hhm, maybe a dup of bug #583842 ?

I don't think so. I've rebuild flex (and also the entire system) and it still fails the same way.
Comment 12 Pacho Ramos gentoo-dev 2018-09-27 12:58:17 UTC
can you retest with 2.8?
Comment 13 Toralf Förster gentoo-dev 2018-10-01 19:22:15 UTC
fixed there