Re: error: implicit declaration of function ‘__OPEN_NEEDS_MODE’

florian.bezdeka at florian.bezdeka at
Mon Dec 28 18:51:59 CET 2020

Hi Gabriel,

On Mon, 2020-12-28 at 15:37 +0000, Gabriel Dinse via Xenomai wrote:
> Hello, I’m getting the following error when doing:
> ~/xenomai-3/build$ make install
> [… MORE OUTPUT ...]
> make[3]: Entering directory '/home/gabriel/xenomai-3/build/lib/cobalt'
>   CC       libcobalt_la-rtdm.lo
> ../../../lib/cobalt/rtdm.c: In function ‘__cobalt___open_2’:
> ../../../lib/cobalt/rtdm.c:104:2: error: implicit declaration of function ‘__OPEN_NEEDS_MODE’
> [-Werror=implicit-function-declaration]
>   if (__OPEN_NEEDS_MODE(oflag)) {

__OPEN_NEEDS_MODE was introduced in glibc version 2.22. Looks your
glibc version is older. Right?

glibc commit:
65f6f938cd56 ("linux: open and openat ignore 'mode' with O_TMPFILE in flags")

The xenomai commit that introduced the breakage:
89f00a2e5458 ("lib/cobalt: Wrap __open_2/__open64_2 to support _FORTIFY_SOURCE")

Adding Jan Kiszka (Maintainer) and Jan Leupold (Author of ba04669d01e8)
to CC.

IMHO the dependency to glibc >= 2.22 is not properly documented and I
guess supporting older glibc versions is still necessary. I guess this
would not fly for other standard libraries (like musl) as well.

>   ^
> cc1: all warnings being treated as errors
> make[3]: *** [Makefile:721: libcobalt_la-rtdm.lo] Error 1
> make[3]: Leaving directory '/home/gabriel/xenomai-3/build/lib/cobalt'
> make[2]: *** [Makefile:838: install-recursive] Error 1
> make[2]: Leaving directory '/home/gabriel/xenomai-3/build/lib/cobalt'
> make[1]: *** [Makefile:428: install-recursive] Error 1
> make[1]: Leaving directory '/home/gabriel/xenomai-3/build/lib'
> make: *** [Makefile:461: install-recursive] Error 1
> ~/xenomai-3/build$
> What can be done in this case?

More information about the Xenomai mailing list