Menu

#7 musl compilation issue

2.0.23
closed
nobody
None
2015-08-16
2015-07-21
No

When acpid is compiled against musl (a new C library implementation) it fails due to the absence of TEMP_FAILURE_RETRY. musl are averse to implementing glibcisms such as this.

I have a patch which fixes this, and also cleans up a few compiler warnings associated with musl and recent toolchains - can I pass it on for review ? SF's SCM widgets are down right now so I'm not sure what method works best ..

Discussion

  • Ted Felix

    Ted Felix - 2015-07-21

    Sure, just attach it here.

     
  • Brendan Heading

    Brendan Heading - 2015-07-21

    Ted,

    Here goes as a first cut. Happy to rework these if you feel it appropriate.

    I placed the missing elements in a new header libc_compat.h and included this from each file which uses the missing elements.

    I've also attached a patch which fixes some compiler warnings. I've tested the code builds under buildroot w/ musl and on Fedora 22.

    Comments welcome!

     

    Last edit: Brendan Heading 2015-07-21
  • Ted Felix

    Ted Felix - 2015-07-21

    These look fine. My only question would be... Is there a way to detect musl? If so, it would be good to wrap the two items in an #if or #ifdef. Something like:

    /* As of July 2015, musl doesn't have the following. */
    #if __MUSL__
    ...
    #endif
    

    This way non-musl builds won't accidentally end up using these. It will also document why these were added.

     
  • Brendan Heading

    Brendan Heading - 2015-07-22

    Ted,

    Happy to make this enhancement but I'm wondering if we should do it the other way around. Since the macro is a glibcism, it might be best to detect glibc ? This way any non-glibc library now or in the future should also work.

    (I have a feeling the macro has been added to uclibc, but I'd need to check).

    Let me know your thoughts and I'll look at respinning the patch.

    Brendan

     
  • Ted Felix

    Ted Felix - 2015-07-22

    Since the macro is a glibcism, it might be best to detect glibc ?

    Sure, go for it. We can always adjust later.

     
  • Brendan Heading

    Brendan Heading - 2015-07-22

    Ted,

    OK I added in checks for glibc where appropriate (uclibc defines GLIBC so the check for TEMP_FAILURE_RETRY handles both cases).

    The compiler warning patch is unchanged.

    [update - I decided the missing CLOEXEC is really a C library bug rather than something an application should support; patches exist to fix this, so I took it out here.]

     

    Last edit: Brendan Heading 2015-07-22
  • Ted Felix

    Ted Felix - 2015-08-16

    Fixed in 2.0.25.

     
  • Ted Felix

    Ted Felix - 2015-08-16
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB