Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 842915 - dev-libs/ffcall-2.4: "vacall" test fails on riscv system
Summary: dev-libs/ffcall-2.4: "vacall" test fails on riscv system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Common Lisp Bugs
URL:
Whiteboard:
Keywords: PullRequest, TESTFAILURE
Depends on:
Blocks:
 
Reported: 2022-05-06 11:26 UTC by Raymond Wong
Modified: 2022-05-08 19:28 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge-info.txt,5.25 KB, text/plain)
2022-05-06 11:37 UTC, Raymond Wong
Details
build.log (build.log,73.03 KB, text/x-log)
2022-05-06 11:46 UTC, Raymond Wong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Wong 2022-05-06 11:26:07 UTC
When I emerge =dev-libs/ffcall-2.4 on Unmatched with USE='test' enabled, it would fail indefinitely. Specifically, at libffcall-2.4/vacall make check, with the following message:

> /usr/lib/gcc/riscv64-unknown-linux-gnu/11.3.0/../../../../riscv64-unknown-linux-gnu/bin/ld: libvacall.a(vacall.o): relocation R_RISCV_HI20 against `vacall_function' can not be used when making a shared object; recompile with -fPIC
> collect2: error: ld returned 1 exit status

Make from source manually would end up with the same result.
Comment 1 Jakov Smolić archtester gentoo-dev 2022-05-06 11:30:01 UTC
Can you attach full build log and emerge --info for completeness?
Comment 2 Raymond Wong 2022-05-06 11:35:56 UTC
To my knowledge, it seems that vacall only has non-PIC implementations for riscv systems precompiled and nowadays distributions have PIE/PIC enabled by default when possible, which leads to the test failure.
Both patching riscv assembly source code or append -no-pie to Makefile could resolve this, but we might want the former solution as ebuild suggests that we want it to be position-independent.
Comment 3 Raymond Wong 2022-05-06 11:37:30 UTC
Created attachment 777023 [details]
emerge --info
Comment 4 Raymond Wong 2022-05-06 11:46:35 UTC
Created attachment 777026 [details]
build.log
Comment 5 Raymond Wong 2022-05-06 11:47:57 UTC
(In reply to Jakov Smolić from comment #1)
> Can you attach full build log and emerge --info for completeness?

Done
Comment 6 Larry the Git Cow gentoo-dev 2022-05-08 19:28:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27474f966c5c419ea4fd3a7cb050071d0f9d84c6

commit 27474f966c5c419ea4fd3a7cb050071d0f9d84c6
Author:     Raymond Wong <infiwang@pm.me>
AuthorDate: 2022-05-08 15:57:29 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2022-05-08 19:27:55 +0000

    dev-libs/ffcall-2.4: add vacall PIC support for Linux/riscv
    
    Patch is already done upstream, drop on next version bump.
    
    Closes: https://bugs.gentoo.org/842915
    Signed-off-by: Raymond Wong <infiwang@pm.me>
    Closes: https://github.com/gentoo/gentoo/pull/25388
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 dev-libs/ffcall/ffcall-2.4.ebuild                  |   7 +-
 .../ffcall/files/ffcall-2.4-vacall-riscv-pic.patch | 792 +++++++++++++++++++++
 2 files changed, 798 insertions(+), 1 deletion(-)