Compilation issues on Linux with musl

17 views
Skip to first unread message

brendan...@gmail.com

unread,
Jul 26, 2015, 11:14:58 AM7/26/15
to exFAT
Hi guys, 

exfat-utils, when compiling for Linux, requires that __GLIBC__ be set (see libexfat/platform.h), otherwise the build fails with an "Unknown platform" error. This macro is set by some C libraries (glibc, obviously, plus uclibc) but not by others (such as the new musl c library). 

Attached is a patch which reorganises this slightly. When compiling on *BSD or OSX, the behaviour is as before; otherwise we simply fall back to the macros defined on Linux. I've tested that this compiles as expected on glibc, uclibc and musl. 

Comments most welcome. 

regards

Brendan
0001-fix-compiling-with-non-glibc-libcs.patch

Andrew Nayenko

unread,
Jul 27, 2015, 4:41:08 AM7/27/15
to exfat, brendan...@gmail.com
Hi Brendan,

I definitely welcome patches that add support for new systems. Thanks
for your efforts!

But I don't like the idea of default platform. If someone will try to
build the project under an unknown system he will get weird linkage
errors instead of a preprocessor error message that clearly points
where things went wrong.

Looks like musl guys live in a perfect world and thus don't provide a
define that could be used to detect musl.

I believe a compromise is possible: we can use glibc-style defines if
we are on Linux. All libc implementations that support Linux (even
lame Bionic) have the required defines. What do you think about this
approach?
--
Andrew Nayenko <res...@gmail.com>

Brendan Heading

unread,
Jul 27, 2015, 7:30:52 AM7/27/15
to Andrew Nayenko, exfat
Hi Andrew, 
 
I believe a compromise is possible: we can use glibc-style defines if
we are on Linux. All libc implementations that support Linux (even
lame Bionic) have the required defines. What do you think about this
approach?

No problem at all. In fact I think great minds think alike, as Thomas Petazzoni on the buildroot mailing list made a similar suggestion. 

Attached is an updated patch. It's much closer to the original intent of the code, ie compile for any Linux platform but fail for any unrecognised platform. 

Can I ask an unrelated question - you are undoubtedly aware that Google Code is switching to read-only in August. Have you any plans to migrate the codebase elsewhere ?

regards

Brendan

 
0001-fix-compiling-with-non-glibc-libcs.patch

Andrew Nayenko

unread,
Jul 27, 2015, 2:51:32 PM7/27/15
to Brendan Heading, exfat
>> I believe a compromise is possible: we can use glibc-style defines if
>> we are on Linux. All libc implementations that support Linux (even
>> lame Bionic) have the required defines. What do you think about this
>> approach?
>
> No problem at all. In fact I think great minds think alike, as Thomas
> Petazzoni on the buildroot mailing list made a similar suggestion.
>
> Attached is an updated patch. It's much closer to the original intent of
> the code, ie compile for any Linux platform but fail for any unrecognised
> platform.

Applied, thanks!

> Can I ask an unrelated question - you are undoubtedly aware that Google
> Code is switching to read-only in August. Have you any plans to migrate the
> codebase elsewhere ?

Sure. I'm in the process of migration and I'll announce the new hosting
soon.

--
Andrew Nayenko <res...@gmail.com>

Brendan Heading

unread,
Jul 27, 2015, 3:55:24 PM7/27/15
to Andrew Nayenko, exfat
Attached is an updated patch. It's much closer to the original intent of
the code, ie compile for any Linux platform but fail for any unrecognised
platform.

Applied, thanks!

Great!
 
Can I ask an unrelated question - you are undoubtedly aware that Google
Code is switching to read-only in August. Have you any plans to migrate the
codebase elsewhere ?

Sure. I'm in the process of migration and I'll announce the new hosting soon.

Nice one. I'll keep an eye out for the announcement.

regards

Brendan
Reply all
Reply to author
Forward
0 new messages