Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921837 - sys-fs/f2fs-tools has an implicit dependency on libsparse
Summary: sys-fs/f2fs-tools has an implicit dependency on libsparse
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Other
: Normal trivial (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-11 20:53 UTC by sarthak
Modified: 2024-01-13 02:29 UTC (History)
2 users (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 sarthak 2024-01-11 20:53:55 UTC
In ChromiumOS, building f2fs-tools-1.16.0 results in the following errors:


ld.lld: error: undefined reference due to --no-allow-shlib-undefined: sparse_file_import
>>> referenced by ../lib/.libs/libf2fs.so

ld.lld: error: undefined reference due to --no-allow-shlib-undefined: sparse_file_len
>>> referenced by ../lib/.libs/libf2fs.so
...

f2fs-tools' src_configure() detects the presence of libsparse[1] and assumes that f2fs-tools should be built using it, if the libsparse header exists. On ChromeOS, this header is pulled in via brillo-base/libsparse [2] so f2fs-tools fails to link against the library since it is missing -lsparse.

Since libsparse is not managed as a gentoo package, would it make sense to disable the dependency completely via the following patch?

diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r1.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r1.ebuild
index 27994fba8..c7051bbf4 100644
--- a/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r1.ebuild
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r1.ebuild
@@ -39,6 +39,7 @@ src_prepare() {
 }
 
 src_configure() {
+       export ac_cv_header_sparse_sparse_h=no
        local myconf=(
                # This is required to install to /sbin, bug #481110
                --bindir="${EPREFIX}"/sbin


[1] https://packages.debian.org/unstable/android-libsparse
[2] https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/chromiumos-overlay/brillo-base/libsparse/