Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675368 - sys-fs/lvm2-2.02.145 - /usr/libexec/gcc/aarch64-unknown-linux-musl/ld: ../../libdm/libdevmapper.so: undefined reference to `rpl_malloc'
Summary: sys-fs/lvm2-2.02.145 - /usr/libexec/gcc/aarch64-unknown-linux-musl/ld: ../../...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-14 00:52 UTC by hanetzer
Modified: 2022-06-17 18:44 UTC (History)
6 users (show)

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


Attachments
build.log (file_675368.txt,48.29 KB, text/plain)
2019-01-14 01:07 UTC, hanetzer
Details
aarch64-unknown-linux-musl-emerge --info (file_675368.txt,2.80 KB, text/plain)
2019-01-14 01:09 UTC, hanetzer
Details
emerge --info (native aarch64-unknown-linux-gnu) (file_675368.txt,5.12 KB, text/plain)
2019-01-14 01:11 UTC, hanetzer
Details
x86_64-unknown-linux-musl config.log (config.log,149.93 KB, text/x-log)
2021-02-04 00:29 UTC, dkjii
Details
x86_64-unknown-linux-musl build.log (build.log,39.77 KB, text/x-log)
2021-02-04 00:29 UTC, dkjii
Details
x86_64-unknown-linux-musl emerge --info (log,2.68 KB, text/plain)
2021-02-04 00:33 UTC, dkjii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hanetzer 2019-01-14 00:52:02 UTC
Unsure if this is actually common to all hardware, trying some other flavors
as I write this, but on a gentoo aarch64-unknown-linux-gnu system emerging
sys-fs/lvm2::musl with an aarch64-unknown-linux-musl cross-toolchain the build
fails with undefined references to rpl_malloc and rpl_realloc

A fix/workaround I've found is to set (either in the ebuild's src_configure
or via pkg.env) ac_cv_func_malloc_0_nonnull=yes and ac_cv_func_realloc_0_nonnull=yes

Unsure where such a fix should be made, either in sys-devel/crossdev's site
files or maybe in the ebuild itself (I've seen it/similar hacks in a lot of
in-tree ebuilds).

Other info inbound as I un'fix' it and rerun builds to capture logs and such.
Comment 1 hanetzer 2019-01-14 01:07:24 UTC
Created attachment 560930 [details]
build.log
Comment 2 hanetzer 2019-01-14 01:09:55 UTC
Created attachment 560932 [details]
aarch64-unknown-linux-musl-emerge --info
Comment 3 hanetzer 2019-01-14 01:11:28 UTC
Created attachment 560934 [details]
emerge --info (native aarch64-unknown-linux-gnu)
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-14 07:24:35 UTC
I guess it would help to see config.log if it's dependent on ./configure output.
My guess would be that
    checking for GNU libc compatible malloc... no
is a relevant piece.
Comment 5 hanetzer 2019-01-14 08:23:58 UTC
(In reply to Sergei Trofimovich from comment #4)
> I guess it would help to see config.log if it's dependent on ./configure
> output.
> My guess would be that
>     checking for GNU libc compatible malloc... no
> is a relevant piece.

Exact same failure on an x86_64-pc-linux-gnu->x86_64-pc-linux-musl cross
Comment 6 dkjii 2021-02-04 00:29:16 UTC
Created attachment 685725 [details]
x86_64-unknown-linux-musl config.log
Comment 7 dkjii 2021-02-04 00:29:39 UTC
Created attachment 685728 [details]
x86_64-unknown-linux-musl build.log
Comment 8 dkjii 2021-02-04 00:33:46 UTC
Created attachment 685731 [details]
x86_64-unknown-linux-musl emerge --info
Comment 9 dkjii 2021-02-04 00:34:09 UTC
(In reply to hanetzer from comment #5)
> (In reply to Sergei Trofimovich from comment #4)
> > I guess it would help to see config.log if it's dependent on ./configure
> > output.
> > My guess would be that
> >     checking for GNU libc compatible malloc... no
> > is a relevant piece.
> 
> Exact same failure on an x86_64-pc-linux-gnu->x86_64-pc-linux-musl cross

Same issue here, added some attachments
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-17 02:34:31 UTC
I'm indeed very tempted to just throw this in to crossdev or the profiles when using a known libc.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-17 02:38:00 UTC
(In reply to Sam James from comment #10)
> I'm indeed very tempted to just throw this in to crossdev or the profiles
> when using a known libc.

Now I get it. I was wondering why this had never been (much of) an issue for other places. It's because of the CHOST being slightly different for just some musl profiles. I'll fix it.
Comment 12 Larry the Git Cow gentoo-dev 2022-06-17 02:44:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=51dfd93c5122df670d2753070807e5a172727ded

commit 51dfd93c5122df670d2753070807e5a172727ded
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-06-17 02:39:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-17 02:43:42 +0000

    site: add linux-musl
    
    Follow-up to 8b1b79e02cc36bc6f2b5583db6aeea333fb8d59b.
    
    Sets
    ```
    ac_cv_func_malloc_0_nonnull=yes
    ac_cv_func_realloc_0_nonnull=yes
    ```
    ... to sort out flex and a bunch of other packages, like procps.
    
    I was wondering why this never seemed to come up when doing cross
    for other "standard" targets which we know work and are used often;
    the answer is that we never had the -musl suffix CHOSTs covered.
    
    (e.g. linux-gnu already has this set.)
    
    Bug: https://bugs.gentoo.org/554032
    Closes: https://bugs.gentoo.org/675368
    Closes: https://bugs.gentoo.org/705800
    See: 8b1b79e02cc36bc6f2b5583db6aeea333fb8d59b
    Signed-off-by: Sam James <sam@gentoo.org>

 wrappers/site/linux-musl | 4 ++++
 1 file changed, 4 insertions(+)
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-17 02:44:33 UTC
(In reply to Sam James from comment #11)
> (In reply to Sam James from comment #10)
> > I'm indeed very tempted to just throw this in to crossdev or the profiles
> > when using a known libc.
> 
> Now I get it. I was wondering why this had never been (much of) an issue for
> other places. It's because of the CHOST being slightly different for just
> some musl profiles. I'll fix it.

(Ignore the last part, was confusing it w/ -gentoo- vendor part for some, point remains though)
Comment 14 Larry the Git Cow gentoo-dev 2022-06-17 18:44:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a1d005f7decdb50955cd653762f1b171a4e878e

commit 8a1d005f7decdb50955cd653762f1b171a4e878e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-06-17 18:34:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-17 18:44:02 +0000

    sys-devel/crossdev: add 20220617
    
    Bug: https://bugs.gentoo.org/675368
    Bug: https://bugs.gentoo.org/554032
    Bug: https://bugs.gentoo.org/705800
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/crossdev/Manifest                 |  1 +
 sys-devel/crossdev/crossdev-20220617.ebuild | 35 +++++++++++++++++++++++++++++
 sys-devel/crossdev/crossdev-99999999.ebuild |  2 +-
 3 files changed, 37 insertions(+), 1 deletion(-)