From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] runc: depend on linux headers >= 3.11 for O_TMPFILE
Date: Tue, 26 Feb 2019 08:32:25 +0100 [thread overview]
Message-ID: <20190226083225.2b23e850@windsurf.home> (raw)
In-Reply-To: <87o96zeapq.fsf@dell.be.48ers.dk>
Hello,
On Mon, 25 Feb 2019 23:59:13 +0100
Peter Korsgaard <peter@korsgaard.com> wrote:
> Indeed, O_TMPFILE support was only added to glibc in 2.19 with the
> following commit:
>
> commit ffdd31816a67f48697ea4d6b852e58d2886d42ca
> Author: Andreas Schwab <schwab@suse.de>
> Date: Wed Sep 11 11:15:45 2013 +0200
>
> Add O_TMPFILE to <fcntl.h>
>
> And to musl in 0.9.15 with the following commit:
>
> commit f7d348ec39ce31efdc4963eb4a8f16f48e5ef095
> Author: Szabolcs Nagy <nsz@port70.net>
> Date: Sat Nov 23 23:47:48 2013 +0000
>
> add O_TMPFILE flag, new in linux 3.11
>
> definition in linux:
> #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
> where __O_TMPFILE and O_DIRECTORY are arch specific
>
> We have already dropped support for glibc <= 2.17 back in 2017.08,
> perhaps we should bump that to <= 2.18 now?
>
> A number of our preconfigured toolchains do use glibc 2.18 though,
> E.G. the codesourcery / mentor ARM toolchain and a number of the
> toolchains we use on the autobuilders.
While I understand the maintenance burden that it causes, I would like
to try to keep support for fairly old toolchains. Even if it seems
crazy, a number of companies are still using oldish toolchains
(typically provided by SoC vendors) to build stuff with relatively
recent Buildroot versions. It is becoming more and more difficult due
to the use of C++11 in many userspace components (which requires gcc >=
4.8), but still. So we should be careful about bumping our glibc
version requirements in a global way, when only a package like "runc"
is affected, which serves some very specific purpose.
Can we work around the lack of O_TMPFILE in the C library directly in
the package source code, and then rely on a >= 3.11 kernel headers
dependency ?
Systemd has this logic in missing_fcntl.h:
/* The precise definition of __O_TMPFILE is arch specific; use the
* values defined by the kernel (note: some are hexa, some are octal,
* duplicated as-is from the kernel definitions):
* - alpha, parisc, sparc: each has a specific value;
* - others: they use the "generic" value.
*/
#ifndef __O_TMPFILE
#if defined(__alpha__)
#define __O_TMPFILE 0100000000
#elif defined(__parisc__) || defined(__hppa__)
#define __O_TMPFILE 0400000000
#elif defined(__sparc__) || defined(__sparc64__)
#define __O_TMPFILE 0x2000000
#else
#define __O_TMPFILE 020000000
#endif
#endif
/* a horrid kludge trying to make sure that this will fail on old kernels */
#ifndef O_TMPFILE
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
#endif
I suppose the first part, that defines __O_TMPFILE is only needed if
you have kernel headers < 3.11, so we would not need that. Only the
second part would be needed ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-02-26 7:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 22:35 [Buildroot] [PATCH 1/3] runc: depend on linux headers >= 3.11 for O_TMPFILE Christian Stewart
2019-02-19 22:35 ` [Buildroot] [PATCH 2/3] docker-containerd: propagate runc headers >= 3.11 dependency Christian Stewart
2019-02-20 21:31 ` Arnout Vandecappelle
2019-02-19 22:35 ` [Buildroot] [PATCH 3/3] docker-engine: " Christian Stewart
2019-02-20 8:01 ` [Buildroot] [PATCH 1/3] runc: depend on linux headers >= 3.11 for O_TMPFILE Thomas Petazzoni
2019-02-20 21:30 ` Arnout Vandecappelle
2019-02-25 22:59 ` Peter Korsgaard
2019-02-26 7:32 ` Thomas Petazzoni [this message]
2019-02-26 8:33 ` Peter Korsgaard
2019-02-26 9:17 ` Thomas Petazzoni
2019-02-26 10:10 ` Peter Korsgaard
2019-02-27 9:07 ` Peter Korsgaard
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=20190226083225.2b23e850@windsurf.home \
--to=thomas.petazzoni@bootlin.com \
--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