Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541662 - dev-libs/unibilium ebuild compiles library without -fPIC
Summary: dev-libs/unibilium ebuild compiles library without -fPIC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-28 17:00 UTC by ZyX
Modified: 2017-08-23 09:20 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ZyX 2015-02-28 17:00:47 UTC
If you try to compile neovim with unibilium then you will see that it is missing -fPIC compilation flag, even though it seems to be defined in ebuild.

Note: this is about compiling neovim *test library* by hand, *not* using neovim ebuild and *not* compiling nvim executable.

Reproducible: Always

Steps to Reproduce:
1. Emerge unibilium.
2. Try to build neovim test library using

        git clone git://github.com/neovim/neovim
        cd neovim
        mkdir build
        cd build
        CC=clang CFLAGS=' -O0 -g ' cmake .. -DCMAKE_BUILD_TYPE=Debug
        make nvim-test
Actual Results:  
Errors out with

Linking C shared module ../../lib/libnvim-test.so
/usr/bin/x86_64-pc-linux-gnu-ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../lib64/libunibilium.a(unibilium.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../lib64/libunibilium.a: error adding symbols: Bad value
x86_64-pc-linux-gnu-clang-3.5.0: error: linker command failed with exit code 1 (use -v to see invocation)

Expected Results:  
Builds fine.
Comment 1 ZyX 2015-02-28 17:16:33 UTC
To fix this issue ebuild must supply -fPIC in CFLAGS argument to emake (it does not matter whether -fPIC will (not) be in global variable). But ebuild must *not* supply -fPIE argument.

--- /usr/portage/dev-libs/unibilium/unibilium-1.1.2.ebuild	2015-02-26 08:54:55.000000000 +0300
+++ portage-overlay/dev-libs/unibilium/unibilium-1.1.2.ebuild	2015-02-28 20:17:34.288389735 +0300
@@ -19,8 +19,8 @@
 RDEPEND=""
 
 src_compile() {
-	append-flags -fPIC -fPIE
-	emake PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" all
+	append-flags -fPIC
+	emake PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" CFLAGS="$CFLAGS" all
 }
 
 src_install() {
Comment 2 Tim Harder gentoo-dev 2017-08-23 09:20:38 UTC
I think this is fixed in the tree now.