Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix musl build errors #56

Closed
wants to merge 2 commits into from
Closed

Conversation

sergioprado
Copy link

No description provided.

Build is failing with musl libc:

sysfs.cc:103:21: error: ‘basename’ was not declared in this scope
       "/devices/" + basename(path.c_str());

That's because basename() is in <libgen.h> on musl libc.

Also, its argument is not const, so add const_cast.

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
LONG_BIT is not a sysconf value, it is either 32 or 64. Using it as
a sysconf value will give weird results.

Originally it was sysconf(_SC_LONG_BIT) (before it was "fixed" by the
gentoo guys). But this is useless: it will always return a value
equal to LONG_BIT: it's either compiled 32-bit or 64-bit so a runtime
lookup doesn't make sense. For this reason, musl has removed the
definition of _SC_LONG_BIT.

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
woodsts pushed a commit to woodsts/buildroot that referenced this pull request Jul 5, 2020
Remove patch 0001 (changes already upstream) and rework patches 0002 and
0003 (merge request sent upstream [1])

[1] lyonel/lshw#56

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
jezze pushed a commit to jezze/buildroot that referenced this pull request Aug 7, 2020
Remove patch 0001 (changes already upstream) and rework patches 0002 and
0003 (merge request sent upstream [1])

[1] lyonel/lshw#56

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
celaxodon pushed a commit to celaxodon/buildroot that referenced this pull request Oct 1, 2020
Remove patch 0001 (changes already upstream) and rework patches 0002 and
0003 (merge request sent upstream [1])

[1] lyonel/lshw#56

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
awanga pushed a commit to awanga/alt-f-next that referenced this pull request Oct 7, 2020
Remove patch 0001 (changes already upstream) and rework patches 0002 and
0003 (merge request sent upstream [1])

[1] lyonel/lshw#56

Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
@lyonel
Copy link
Owner

lyonel commented Jan 10, 2021

merged upstream

@lyonel lyonel closed this Jan 10, 2021
@ericonr
Copy link

ericonr commented Jan 11, 2021

This breaks const correctness... musl's dirname and basename can change the string passed to them (I don't know about glibc), so just doing the cast seems wrong to me. Is it okay to change the string here?

158fbe6

@ericonr
Copy link

ericonr commented Jan 12, 2021

Opened #61 to deal with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants