* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
@ 2016-07-10 21:56 Yann E. MORIN
2016-07-11 9:02 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2016-07-10 21:56 UTC (permalink / raw)
To: buildroot
This toolchain uses glibc-2.18, which is tool old to provide O_TMPFILE,
which was added only in glibc-2.19.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/systemd/Config.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index 4a2aa33..48e6c45 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -145,6 +145,8 @@ config BR2_PACKAGE_SYSTEMD_IMPORTD
bool "enable import daemon"
depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11 # O_TMPFILE
+ # This toolchain has glibc-2.18, too old to provide O_TMPFILE
+ depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
select BR2_PACKAGE_LIBCURL
select BR2_PACKAGE_LIBGCRYPT
select BR2_PACKAGE_BZIP2
@@ -160,8 +162,12 @@ config BR2_PACKAGE_SYSTEMD_IMPORTD
comment "import daemon needs a toolchain w/ headers >= 3.11"
depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS
+ depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
+comment "import daemon broken on Sourcery CodeBench ARM 2014.05"
+ depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
+
config BR2_PACKAGE_SYSTEMD_KDBUS
bool "enable kdbus support"
help
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
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
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-07-11 9:02 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 10 Jul 2016 23:56:21 +0200, Yann E. MORIN wrote:
> This toolchain uses glibc-2.18, which is tool old to provide O_TMPFILE,
> which was added only in glibc-2.19.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> package/systemd/Config.in | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
> index 4a2aa33..48e6c45 100644
> --- a/package/systemd/Config.in
> +++ b/package/systemd/Config.in
> @@ -145,6 +145,8 @@ config BR2_PACKAGE_SYSTEMD_IMPORTD
> bool "enable import daemon"
> depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt
> depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11 # O_TMPFILE
> + # This toolchain has glibc-2.18, too old to provide O_TMPFILE
> + depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
So is the problem a kernel headers problem, or a glibc version problem ?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
2016-07-11 9:02 ` Thomas Petazzoni
@ 2016-07-11 17:16 ` Yann E. MORIN
2016-08-27 21:32 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2016-07-11 17:16 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2016-07-11 11:02 +0200, Thomas Petazzoni spake thusly:
> On Sun, 10 Jul 2016 23:56:21 +0200, Yann E. MORIN wrote:
> > This toolchain uses glibc-2.18, which is tool old to provide O_TMPFILE,
> > which was added only in glibc-2.19.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > ---
> > package/systemd/Config.in | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/package/systemd/Config.in b/package/systemd/Config.in
> > index 4a2aa33..48e6c45 100644
> > --- a/package/systemd/Config.in
> > +++ b/package/systemd/Config.in
> > @@ -145,6 +145,8 @@ config BR2_PACKAGE_SYSTEMD_IMPORTD
> > bool "enable import daemon"
> > depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt
> > depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11 # O_TMPFILE
> > + # This toolchain has glibc-2.18, too old to provide O_TMPFILE
> > + depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
>
> So is the problem a kernel headers problem, or a glibc version problem ?
Both. O_TMPFILE was introduced in Linux 3.11, so we need at least those
headers. Also, glibc-2.18 did not provide it in fcntl.h; it only
appeared in glibc-2.19.
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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
2016-07-11 17:16 ` Yann E. MORIN
@ 2016-08-27 21:32 ` Thomas Petazzoni
2016-08-27 21:48 ` Yann E. MORIN
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-08-27 21:32 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 11 Jul 2016 19:16:30 +0200, Yann E. MORIN wrote:
> > So is the problem a kernel headers problem, or a glibc version problem ?
>
> Both. O_TMPFILE was introduced in Linux 3.11, so we need at least those
> headers. Also, glibc-2.18 did not provide it in fcntl.h; it only
> appeared in glibc-2.19.
I'm still not sure to understand why both are needed.
In any case, this fix is not correct, since the issue appears with
other toolchains as well:
http://autobuild.buildroot.net/results/e6f/e6f8189029487155a784b4e664178adfd92f8884/build-end.log
This one is an ARM toolchain, that uses 3.12 kernel headers, so most
likely it's a glibc version issue.
http://autobuild.buildroot.net/results/339/33912eebb5f4ee3f73be078ba2035f48d76a6a46/build-end.log
This one is a PowerPC toolchain.
I see two possibilities only:
* Introduce some glibc version dependency config knobs.
* Add a workaround in the systemd code to define O_TMPFILE to the
proper value when not provided by the C library.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
2016-08-27 21:32 ` Thomas Petazzoni
@ 2016-08-27 21:48 ` Yann E. MORIN
2016-08-28 7:29 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2016-08-27 21:48 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2016-08-27 23:32 +0200, Thomas Petazzoni spake thusly:
> On Mon, 11 Jul 2016 19:16:30 +0200, Yann E. MORIN wrote:
> > > So is the problem a kernel headers problem, or a glibc version problem ?
> > Both. O_TMPFILE was introduced in Linux 3.11, so we need at least those
> > headers. Also, glibc-2.18 did not provide it in fcntl.h; it only
> > appeared in glibc-2.19.
>
> I'm still not sure to understand why both are needed.
Well, indeed, both are not needed. glibc-2.19 is enough, as it does
provide it if not defined by the kernel headers.
And if the kernel headers provide it but not glibc, then it is not
available. (Weird).
> In any case, this fix is not correct, since the issue appears with
> other toolchains as well:
>
> http://autobuild.buildroot.net/results/e6f/e6f8189029487155a784b4e664178adfd92f8884/build-end.log
>
> This one is an ARM toolchain, that uses 3.12 kernel headers, so most
> likely it's a glibc version issue.
glibc-2.18, so too old.
> http://autobuild.buildroot.net/results/339/33912eebb5f4ee3f73be078ba2035f48d76a6a46/build-end.log
>
> This one is a PowerPC toolchain.
glibc-2.18 too.
> I see two possibilities only:
>
> * Introduce some glibc version dependency config knobs.
That's unfortunately the only sane solution, I'm araid.
But that just for systemd is big a gun... :-/
> * 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.
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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
2016-08-27 21:48 ` Yann E. MORIN
@ 2016-08-28 7:29 ` Thomas Petazzoni
2016-08-28 14:36 ` Yann E. MORIN
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-08-28 7:29 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 27 Aug 2016 23:48:49 +0200, Yann E. MORIN wrote:
> > * Introduce some glibc version dependency config knobs.
>
> That's unfortunately the only sane solution, I'm araid.
>
> But that just for systemd is big a gun... :-/
Yes, it sucks :-/
> > * 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.
Same for SPARC.
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).
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] package/systemd: importd broken on Sourcery CodeBench ARM 2014.05
2016-08-28 7:29 ` Thomas Petazzoni
@ 2016-08-28 14:36 ` Yann E. MORIN
0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2016-08-28 14:36 UTC (permalink / raw)
To: buildroot
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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-08-28 14:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox