Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 827925 - media-gfx/sam2p-0.49.4_p20190718-r1 - error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment - with hardened clang
Summary: media-gfx/sam2p-0.49.4_p20190718-r1 - error: can't create dynamic relocation ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: TeX project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-12-01 05:18 UTC by nvinson234
Modified: 2021-12-01 16:36 UTC (History)
2 users (show)

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


Attachments
clang.patch (clang.patch,820 bytes, patch)
2021-12-01 05:18 UTC, nvinson234
Details | Diff
clang.patch (clang.patch,1008 bytes, patch)
2021-12-01 05:31 UTC, nvinson234
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nvinson234 2021-12-01 05:18:26 UTC
Created attachment 757116 [details, diff]
clang.patch

media-gfx/sam2p-0.49.4_p20190718-r1 fails to configure when built with clang and hardened flags are set.

Steps to reproduce:
    1. Set LDFLAGS to "-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -pie"
    2. Set CFLAGS to "-march=native -O2 -pipe -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2"
    3. Set CXXFLAGS to "-march=native -O2 -pipe -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2"
    4. Attempt to emerge media-gfx/sam2p-0.49.4_p20190718-r1
    5. Observe build failure

Excepted results:
    sam2p-0.49.4_p20190718-r1 configures successfully

Actual results:
    build fails with error:
        checking whether we are cross compiling... configure: error: in `/var/tmp/portage/media-gfx/sam2p-0.49.4_p20190718-r1/work/sam2p-b953f63307c4a83fa4615a4863e3fb250205cd98'
    config.log error:
        configure:2736: checking whether we are cross compiling
        configure:2744: clang++ -o conftest    -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -pie conftest.cpp  >&5
        ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC
                or pass '-Wl,-z,notext' to allow text relocations in the output
Comment 1 nvinson234 2021-12-01 05:31:20 UTC
Created attachment 757117 [details, diff]
clang.patch

clang patch to fix configure errors.
Comment 2 Larry the Git Cow gentoo-dev 2021-12-01 16:25:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23139790af0807c7a92d0861e4601f02dd2ee808

commit 23139790af0807c7a92d0861e4601f02dd2ee808
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-01 15:59:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-01 16:25:43 +0000

    media-gfx/sam2p: fix configure with clang
    
    Closes: https://bugs.gentoo.org/827925
    Thanks-to: <nvinson234@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../sam2p-0.49.4_p20190718-fix-configure-clang.patch      | 15 +++++++++++++++
 media-gfx/sam2p/sam2p-0.49.4_p20190718-r1.ebuild          |  7 +++++--
 2 files changed, 20 insertions(+), 2 deletions(-)