mailing list of musl libc
 help / color / mirror / code / Atom feed
* Trying to compile libselinux against musl
@ 2013-11-19 16:20 Raphael Cohn
  2013-11-19 19:15 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Raphael Cohn @ 2013-11-19 16:20 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

Hi,

I'm exploring building my own linux - a bit like LFS - to get a handle on a
few things. I really like musl - it's very clean code - and musl-cross is a
great bit of work. Without it, I'd never have got started.

I'm trying to compile libselinux, to statically link it into busybox. I've
built patchelf, pcre and libsepol statically (admittedly with a few
judicious seds of makefiles), but this one's stumped me.

There's two issues:-

src/booleans.c wants to use the macro _D_ALLOC_NAMLEN - which seems to be a
glibc-ism in dirent.h. It may be possible to hack in their macro definition
to overcome this;
src/proccattr.c tries to use __register_atfork, which is in the LSB but I
suspect is a glibc-ism.

I'm stuck on the latter - I'm not deep into this stuff. Does anyone have
any ideas how to patch / hack / bypass this to get things compiled? Are
there any other workarounds (apart from not using libselinux or musl)?

Raph

[-- Attachment #2: Type: text/html, Size: 1209 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trying to compile libselinux against musl
  2013-11-19 16:20 Trying to compile libselinux against musl Raphael Cohn
@ 2013-11-19 19:15 ` Szabolcs Nagy
  2013-11-20 10:33   ` Raphael Cohn
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2013-11-19 19:15 UTC (permalink / raw)
  To: musl

* Raphael Cohn <raphael.cohn@stormmq.com> [2013-11-19 16:20:27 +0000]:
> src/booleans.c wants to use the macro _D_ALLOC_NAMLEN - which seems to be a
> glibc-ism in dirent.h. It may be possible to hack in their macro definition

should be fixed upstream

> to overcome this;
> src/proccattr.c tries to use __register_atfork, which is in the LSB but I
> suspect is a glibc-ism.
> 
> I'm stuck on the latter - I'm not deep into this stuff. Does anyone have
> any ideas how to patch / hack / bypass this to get things compiled? Are
> there any other workarounds (apart from not using libselinux or musl)?

i think you can just use pthread_atfork instead

#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child)

the dso arg is just there in case dlclose() is used
which is broken on glibc anyway and noop on musl


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trying to compile libselinux against musl
  2013-11-19 19:15 ` Szabolcs Nagy
@ 2013-11-20 10:33   ` Raphael Cohn
  0 siblings, 0 replies; 3+ messages in thread
From: Raphael Cohn @ 2013-11-20 10:33 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

Thank you - using pthread_atfork seems to solve things. I've added in the
macro by modifying the definition in glibc (Seems a bit pointless).

Raphael Cohn
Chief Architect, stormmq
Co-Chair, OASIS MQTT Standard
Secretary, OASIS AMQP Standard
raphael.cohn@stormmq.com
+44 7590 675 756

UK Office:
Hamblethorpe Farm, Crag Lane, Bradley BD20 9DB, North Yorkshire, United
Kingdom
Telephone: +44 845 3712 567

Registered office:
16 Anchor Street, Chelmsford, Essex, CM2 0JY, United Kingdom
StormMQ Limited is Registered in England and Wales under Company Number
07175657
StormMQ.com


On 19 November 2013 19:15, Szabolcs Nagy <nsz@port70.net> wrote:

> * Raphael Cohn <raphael.cohn@stormmq.com> [2013-11-19 16:20:27 +0000]:
> > src/booleans.c wants to use the macro _D_ALLOC_NAMLEN - which seems to
> be a
> > glibc-ism in dirent.h. It may be possible to hack in their macro
> definition
>
> should be fixed upstream
>
> > to overcome this;
> > src/proccattr.c tries to use __register_atfork, which is in the LSB but I
> > suspect is a glibc-ism.
> >
> > I'm stuck on the latter - I'm not deep into this stuff. Does anyone have
> > any ideas how to patch / hack / bypass this to get things compiled? Are
> > there any other workarounds (apart from not using libselinux or musl)?
>
> i think you can just use pthread_atfork instead
>
> #define __register_atfork(prepare,parent,child,dso)
> pthread_atfork(prepare,parent,child)
>
> the dso arg is just there in case dlclose() is used
> which is broken on glibc anyway and noop on musl
>

[-- Attachment #2: Type: text/html, Size: 2255 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-20 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 16:20 Trying to compile libselinux against musl Raphael Cohn
2013-11-19 19:15 ` Szabolcs Nagy
2013-11-20 10:33   ` Raphael Cohn

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).