Skip to content

Musl fixes#122

Merged
blueness merged 2 commits into
eudev-project:masterfrom
RomainNaour:musl-fixes
Sep 11, 2015
Merged

Musl fixes#122
blueness merged 2 commits into
eudev-project:masterfrom
RomainNaour:musl-fixes

Conversation

@RomainNaour
Copy link
Copy Markdown
Contributor

Hi,

Add a patch to disable mallinfo statistics with musl toolchains
which doesn't have struct mallinfo.

Fixes:
selinux-util.c: In function ‘mac_selinux_init’:
selinux-util.c:70:25: error: storage size of ‘before_mallinfo’ isn’t known
struct mallinfo before_mallinfo, after_mallinfo;

Add a second patch for strndupa() which is a GNU extension.

Fixes:
./.libs/libudev-core.a(selinux-util.o): In function mac_selinux_bind': selinux-util.c:(.text+0xd94): undefined reference tostrndupa'
collect2: error: ld returned 1 exit status

Best regards,
Romain Naour

Comment thread configure.ac Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit - s/use/uses

mallinfo is not specified by POSIX or the C standards, therefore
it's not available for all libc libraries (musl).

Add the ability to disable mallinfo statistics.

Fixes:
selinux-util.c: In function ‘mac_selinux_init’:
selinux-util.c:70:25: error: storage size of ‘before_mallinfo’ isn’t known
         struct mallinfo before_mallinfo, after_mallinfo;

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
strndupa is a GNU extension, therefore it's not available
for all libc libraries (musl).

This patch is based on the one proposed by Emil Renner Berthing for
systemd [1].

[1] http://lists.freedesktop.org/archives/systemd-devel/2014-September/023190.html

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
@RomainNaour
Copy link
Copy Markdown
Contributor Author

Hi,

I had a review on the Buildroot ml, see:
http://lists.busybox.net/pipermail/buildroot/2015-July/135059.html
mallinfo patch has been updated.

Also I fixed the typo in configure.ac.

Thanks!
Romain

blueness pushed a commit that referenced this pull request Sep 11, 2015
@blueness blueness merged commit 0cc8789 into eudev-project:master Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants