From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
Date: Sun, 28 Aug 2016 16:36:47 +0200 [thread overview]
Message-ID: <20160828143647.GB5758@free.fr> (raw)
In-Reply-To: <20160828092904.2a7d4e0e@free-electrons.com>
Thomas, All,
On 2016-08-28 09:29 +0200, Thomas Petazzoni spake thusly:
> > > * Add a workaround in the systemd code to define O_TMPFILE to the
> > > proper value when not provided by the C library.
> >
> > At the same time, I'm not really happy with patching systemd...
> >
> > O_TMPFILE is not the same value on all archs: generic, alpha, parisc and
> > sparc.
>
> I must say I still don't understand the overlap of the kernel headers
> and glibc here.
>
> In the kernel, we have:
>
> include/uapi/asm-generic/fcntl.h:#define __O_TMPFILE 020000000
>
> In glibc, we have:
>
> sysdeps/unix/sysv/linux/bits/fcntl-linux.h:# define __O_TMPFILE (020000000 | __O_DIRECTORY)
>
> Which is not even the same value.
Ah, I got the answer to that one! :-)
O_TMPFILE is defined as such to be sure to break at runtime on old
kernels that do not have O_TMPFILE, becasue open() silently ignores
unknown flags. So, a userland app may request O_TMPFILE but silently not
get it:
https://lwn.net/Articles/558940/
> I'd still say that patching systemd is the easiest solution, and we
> will be able to remove this patch once we get rid of those too old
> toolchains (which we will have to do at some point, when they become
> too annoying / irrelevant).
Fact is, upstream has a missing.h header that defines O_TMPFILE if not
already defined.
But they do it only for __i386__ and __x86_64__:
https://github.com/systemd/systemd/blob/master/src/basic/missing.h#L540
So the fix will be two-fold:
- use missing.h from importd,
- enhance missing.h to also define O_TMPFILE for other archs.
I'll be doing that shortly (first already done).
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
prev parent reply other threads:[~2016-08-28 14:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-10 21:56 [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05 Yann E. MORIN
2016-07-11 9:02 ` Thomas Petazzoni
2016-07-11 17:16 ` Yann E. MORIN
2016-08-27 21:32 ` Thomas Petazzoni
2016-08-27 21:48 ` Yann E. MORIN
2016-08-28 7:29 ` Thomas Petazzoni
2016-08-28 14:36 ` Yann E. MORIN [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160828143647.GB5758@free.fr \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox