Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elogind 235.2 fail to compile with glibc 2.27 #46

Closed
florin65 opened this issue Feb 5, 2018 · 28 comments
Closed

elogind 235.2 fail to compile with glibc 2.27 #46

florin65 opened this issue Feb 5, 2018 · 28 comments
Assignees

Comments

@florin65
Copy link

florin65 commented Feb 5, 2018

Hi,

Here is the compile log:
++ Mark Compile start : "elogind" "235.2" "Mon, 05 Feb 2018 22:50:46 +0000"
The Meson build system
Version: 0.44.0
Source dir: /usr/src/elogind-235.2
Build dir: /usr/src/elogind-235.2/build
Build type: native build
Project name: elogind
Native C compiler: gcc (gcc 7.3.0)
Appending CFLAGS from environment: ' -O2 -march=x86-64 -pipe'
Appending LDFLAGS from environment: ' -s'
Appending CPPFLAGS from environment: ' -D_FORTIFY_SOURCE=2'
Build machine cpu family: x86_64
Build machine cpu: x86_64
Program tools/meson-check-compilation.sh found: YES (/usr/src/elogind-235.2/tools/meson-check-compilation.sh)
Program c++ found: YES (/var/lib/lunar/compilers/c++)
Native C++ compiler: g++ (gcc 7.3.0)
Appending CXXFLAGS from environment: ' -O2 -march=x86-64 -pipe'
Appending LDFLAGS from environment: ' -s'
Appending CPPFLAGS from environment: ' -D_FORTIFY_SOURCE=2'
Compiler for C supports argument -Wextra: YES
Compiler for C supports argument -Werror=undef: YES
Compiler for C supports argument -Wlogical-op: YES
Compiler for C supports argument -Wmissing-include-dirs: YES
Compiler for C supports argument -Wold-style-definition: YES
Compiler for C supports argument -Wpointer-arith: YES
Compiler for C supports argument -Winit-self: YES
Compiler for C supports argument -Wdeclaration-after-statement: YES
Compiler for C supports argument -Wfloat-equal: YES
Compiler for C supports argument -Wsuggest-attribute=noreturn: YES
Compiler for C supports argument -Werror=missing-prototypes: YES
Compiler for C supports argument -Werror=implicit-function-declaration: YES
Compiler for C supports argument -Werror=missing-declarations: YES
Compiler for C supports argument -Werror=return-type: YES
Compiler for C supports argument -Werror=incompatible-pointer-types: YES
Compiler for C supports argument -Werror=format=2: YES
Compiler for C supports argument -Wstrict-prototypes: YES
Compiler for C supports argument -Wredundant-decls: YES
Compiler for C supports argument -Wmissing-noreturn: YES
Compiler for C supports argument -Wshadow: YES
Compiler for C supports argument -Wendif-labels: YES
Compiler for C supports argument -Wstrict-aliasing=2: YES
Compiler for C supports argument -Wwrite-strings: YES
Compiler for C supports argument -Werror=overflow: YES
Compiler for C supports argument -Wdate-time: YES
Compiler for C supports argument -Wnested-externs: YES
Compiler for C supports argument -ffast-math: YES
Compiler for C supports argument -fno-common: YES
Compiler for C supports argument -fdiagnostics-show-option: YES
Compiler for C supports argument -fno-strict-aliasing: YES
Compiler for C supports argument -fvisibility=hidden: YES
Compiler for C supports argument -fstack-protector: YES
Compiler for C supports argument -fstack-protector-strong: YES
Compiler for C supports argument -fPIE: YES
Compiler for C supports argument --param=ssp-buffer-size=4: YES
Compiler for C supports argument -Wunused-parameter: YES
Compiler for C supports argument -Wmissing-field-initializers: YES
Compiler for C supports argument -Wunused-result: YES
Compiler for C supports argument -Wformat-signedness: YES
Compiler for C supports argument -Werror=nonnull: YES
Checking if "-Werror=shadow with local shadowing" compiles: YES
Message: Linking with -Wl,-z,relro supported: yes
Message: Linking with -Wl,-z,now supported: yes
Message: Linking with -pie supported: yes
Checking for size of "pid_t": 4
Checking for size of "uid_t": 4
Checking for size of "gid_t": 4
Checking for size of "dev_t": 8
Checking for size of "ino_t": 8
Checking for size of "time_t": 8
Checking for size of "rlim_t": 8
Checking for size of "char16_t": 2
Checking for size of "char32_t": 4
Checking for size of "key_serial_t": -1
Checking for size of "struct ethtool_link_settings": 48
Checking for size of "struct fib_rule_uid_range": 8
Header <linux/if_link.h> has symbol "IFLA_INET6_ADDR_GEN_MODE": YES
Header <linux/if_link.h> has symbol "IN6_ADDR_GEN_MODE_STABLE_PRIVACY": YES
Header <linux/if_link.h> has symbol "IFLA_VRF_TABLE": YES
Header <linux/if_link.h> has symbol "IFLA_MACVLAN_FLAGS": YES
Header <linux/if_link.h> has symbol "IFLA_IPVLAN_MODE": YES
Header <linux/if_link.h> has symbol "IFLA_PHYS_PORT_ID": YES
Header <linux/if_link.h> has symbol "IFLA_BOND_AD_INFO": YES
Header <linux/if_link.h> has symbol "IFLA_VLAN_PROTOCOL": YES
Header <linux/if_link.h> has symbol "IFLA_VXLAN_REMCSUM_NOPARTIAL": YES
Header <linux/if_link.h> has symbol "IFLA_VXLAN_GPE": YES
Header <linux/if_link.h> has symbol "IFLA_GENEVE_LABEL": YES
Header <linux/if_tunnel.h> has symbol "IFLA_VTI_REMOTE": YES
Header <linux/if_tunnel.h> has symbol "IFLA_IPTUN_ENCAP_DPORT": YES
Header <linux/if_tunnel.h> has symbol "IFLA_GRE_ENCAP_DPORT": YES
Header <linux/if_bridge.h> has symbol "IFLA_BRIDGE_VLAN_INFO": YES
Header <linux/if_link.h> has symbol "IFLA_BRPORT_PROXYARP": YES
Header <linux/if_link.h> has symbol "IFLA_BRPORT_LEARNING_SYNC": YES
Header <linux/if_link.h> has symbol "IFLA_BR_VLAN_DEFAULT_PVID": YES
Header <linux/neighbour.h> has symbol "NDA_IFINDEX": YES
Header <linux/if_addr.h> has symbol "IFA_FLAGS": YES
Header <linux/fib_rules.h> has symbol "FRA_UID_RANGE": YES
Header <linux/loop.h> has symbol "LO_FLAGS_PARTSCAN": YES
Checking for function "secure_getenv": YES
Checking for function "__secure_getenv": NO
Checking for function "memfd_create": NO
Checking for function "gettid": NO
Checking for function "pivot_root": NO
Checking for function "name_to_handle_at": YES
Checking for function "setns": YES
Checking for function "renameat2": NO
Checking for function "kcmp": NO
Checking for function "keyctl": NO
Checking for function "copy_file_range": NO
Checking for function "bpf": NO
Checking for function "explicit_bzero": YES
Checking for function "getrandom": YES
Program sed found: YES (/usr/bin/sed)
Program grep found: YES (/usr/bin/grep)
Program awk found: YES (/usr/bin/awk)
Program m4 found: YES (/usr/bin/m4)
Program stat found: YES (/usr/bin/stat)
Program git found: YES (/usr/bin/git)
Program kexec found: NO
Program /usr/sbin/kexec found: NO
Program /sbin/kexec found: NO
Program nonexistingprogram found: NO
Program reboot found: YES (/usr/bin/reboot)
Program halt found: YES (/usr/bin/halt)
Program gperf found: YES (/usr/bin/gperf)
Message: gperf len type is unsigned
Has header "sys/capability.h": YES
Has header "linux/btrfs.h": YES
Has header "linux/memfd.h": YES
Has header "linux/vm_sockets.h": YES
Has header "sys/auxv.h": YES
Has header "valgrind/memcheck.h": NO
Has header "valgrind/valgrind.h": NO
Program tools/meson-get-cg-controller.sh found: YES (/usr/src/elogind-235.2/tools/meson-get-cg-controller.sh)
Message: maximum system UID is 999
Message: maximum system GID is 999
Dependency threads found: YES
Library rt found: YES
Library m found: YES
Library dl found: YES
Library crypt found: YES
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Native dependency libcap found: YES 2.25
Dependency libselinux found: NO
Native dependency polkit-gobject-1 found: YES 0.113
Library acl found: YES
Dependency audit found: NO
Library pam found: YES
Library pam_misc found: YES
Native dependency glib-2.0 found: YES 2.54.3
Native dependency gobject-2.0 found: YES 2.54.3
Native dependency gio-2.0 found: YES 2.54.3
Native dependency dbus-1 found: YES 1.12.2
Configuring config.h using configuration
Program intltool-merge found: YES (/usr/bin/intltool-merge)
Program /usr/src/elogind-235.2/tools/meson-symlink_headers.sh found: YES (/usr/src/elogind-235.2/tools/meson-symlink_headers.sh)
Program c++ found: YES (/var/lib/lunar/compilers/c++)
Program generate-gperfs.py found: YES (/usr/src/elogind-235.2/src/basic/generate-gperfs.py)
Program generate-cap-list.sh found: YES (/usr/src/elogind-235.2/src/basic/generate-cap-list.sh)
Program generate-errno-list.sh found: YES (/usr/src/elogind-235.2/src/basic/generate-errno-list.sh)
Configuring libelogind.pc using configuration
Configuring logind.conf using configuration
Configuring org.freedesktop.login1.service using configuration
Configuring 71-seat.rules using configuration
Configuring 73-seat-late.rules using configuration
Native dependency libudev found: YES 220
Program generate-sym-test.py found: YES (/usr/src/elogind-235.2/src/test/generate-sym-test.py)
Message: test-ipcrm is an unsafe test
Message: test-cgroup is a manual test
Message: test-inhibit is a manual test
Program tools/make-directive-index.py found: YES (/usr/src/elogind-235.2/tools/make-directive-index.py)
Program tools/make-man-index.py found: YES (/usr/src/elogind-235.2/tools/make-man-index.py)
Program tools/xml_helper.py found: YES (/usr/src/elogind-235.2/tools/xml_helper.py)
Program xsltproc found: YES (/usr/bin/xsltproc)
Native dependency bash-completion found: YES 2.7
Message: bash completions: /usr/share/bash-completion/completions
Message: zsh completions: /usr/share/zsh/site-functions
Program sh found: YES (/usr/bin/sh)
Program tools/meson-check-help.sh found: YES (/usr/src/elogind-235.2/tools/meson-check-help.sh)
Program tools/meson-git-contrib.sh found: YES (/usr/src/elogind-235.2/tools/meson-git-contrib.sh)
Message: elogind 235.2
prefix: /usr
rootprefix: /usr
sysconf dir: /etc
includedir: /usr/include
lib dir: /usr/lib
rootlib dir: /usr/lib
rootexeclib dir: /usr/libexec/elogind
PAM modules dir: /usr/lib/security
PAM configuration dir: /etc/pam.d
D-Bus policy dir: /usr/share/dbus-1/system.d
D-Bus session dir: /usr/share/dbus-1/services
D-Bus system dir: /usr/share/dbus-1/system-services
bash completions dir: /usr/share/bash-completion/completions
zsh completions dir: /usr/share/zsh/site-functions
TTY GID: 5
maximum system UID: 999
maximum system GID: 999
default KillUserProcesses setting: true

     enabled features: PAM, SMACK, ACL, polkit, dbus, glib, man pages, man page indices, utmp
     
     disabled features: AUDIT, SELinux, legacy pkla, html pages, debug elogind, debug hashmap, debug mmap cache

Build targets in project: 411
Found ninja-1.8.2 at /usr/bin/ninja
ninja: Entering directory `build'
[1/530] Compiling C object 'src/libelogind/elogind@sta/sd-bus_bus-common-errors.c.o'.
[2/530] Compiling C object 'src/libelogind/elogind@sta/sd-bus_bus-bloom.c.o'.
FAILED: src/libelogind/elogind@sta/sd-bus_bus-bloom.c.o
gcc -Isrc/libelogind/elogind@sta -Isrc/libelogind -I../src/libelogind -I. -I../ -Isrc/update-utmp -I../src/update-utmp -Isrc/sleep -I../src/sleep -I../src/libelogind/sd-id128 -I../src/libelogind/sd-bus -Isrc/core -I../src/core -Isrc/login -I../src/login -Isrc/systemd -I../src/systemd -Isrc/shared -I../src/shared -Isrc/basic -I../src/basic -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Werror=shadow -include config.h -O2 -march=x86-64 -D_FORTIFY_SOURCE=2 -fPIC -pthread -MMD -MQ 'src/libelogind/elogind@sta/sd-bus_bus-bloom.c.o' -MF 'src/libelogind/elogind@sta/sd-bus_bus-bloom.c.o.d' -o 'src/libelogind/elogind@sta/sd-bus_bus-bloom.c.o' -c ../src/libelogind/sd-bus/bus-bloom.c
In file included from ../src/basic/missing.h:1278:0,
from ../src/basic/util.h:46,
from ../src/libelogind/sd-bus/bus-bloom.c:22:
../src/basic/missing_syscall.h:311:23: error: static declaration of 'copy_file_range' follows non-static declaration
static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
^~~~~~~~~~~~~~~
In file included from ../src/basic/util.h:42:0,
from ../src/libelogind/sd-bus/bus-bloom.c:22:
/usr/include/unistd.h:1110:9: note: previous declaration of 'copy_file_range' was here
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
^~~~~~~~~~~~~~~
[3/530] Generating errno-list.txt with a meson_exe.py custom command.
++ Mark Compile stop : "elogind" "235.2" "Mon, 05 Feb 2018 22:51:00 +0000"
[4/530] Compiling C object 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o'.
FAILED: src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o
gcc -Isrc/libelogind/elogind@sta -Isrc/libelogind -I../src/libelogind -I. -I../ -Isrc/update-utmp -I../src/update-utmp -Isrc/sleep -I../src/sleep -I../src/libelogind/sd-id128 -I../src/libelogind/sd-bus -Isrc/core -I../src/core -Isrc/login -I../src/login -Isrc/systemd -I../src/systemd -Isrc/shared -I../src/shared -Isrc/basic -I../src/basic -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Werror=shadow -include config.h -O2 -march=x86-64 -D_FORTIFY_SOURCE=2 -fPIC -pthread -MMD -MQ 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o' -MF 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o.d' -o 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o' -c ../src/libelogind/sd-bus/bus-kernel.c
In file included from ../src/basic/missing.h:1278:0,
from ../src/basic/util.h:46,
from ../src/basic/hashmap.h:29,
from ../src/libelogind/sd-bus/bus-match.h:24,
from ../src/libelogind/sd-bus/bus-internal.h:29,
from ../src/libelogind/sd-bus/bus-kernel.c:36:
../src/basic/missing_syscall.h:66:19: error: static declaration of 'memfd_create' follows non-static declaration
static inline int memfd_create(const char *name, unsigned int flags) {
^~~~~~~~~~~~
In file included from /usr/include/bits/mman-linux.h:115:0,
from /usr/include/bits/mman.h:45,
from /usr/include/sys/mman.h:41,
from ../src/libelogind/sd-bus/bus-kernel.c:26:
/usr/include/bits/mman-shared.h:46:5: note: previous declaration of 'memfd_create' was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
In file included from ../src/basic/missing.h:1278:0,
from ../src/basic/util.h:46,
from ../src/basic/hashmap.h:29,
from ../src/libelogind/sd-bus/bus-match.h:24,
from ../src/libelogind/sd-bus/bus-internal.h:29,
from ../src/libelogind/sd-bus/bus-kernel.c:36:
../src/basic/missing_syscall.h:311:23: error: static declaration of 'copy_file_range' follows non-static declaration
static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
^~~~~~~~~~~~~~~
In file included from ../src/basic/util.h:42:0,
from ../src/basic/hashmap.h:29,
from ../src/libelogind/sd-bus/bus-match.h:24,
from ../src/libelogind/sd-bus/bus-internal.h:29,
from ../src/libelogind/sd-bus/bus-kernel.c:36:
/usr/include/unistd.h:1110:9: note: previous declaration of 'copy_file_range' was here
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
^~~~~~~~~~~~~~~

@perfect7gentleman
Copy link

confirm

@Yamakuzure
Copy link
Collaborator

glibc-2.27 is brand new. I'll see what I can do. Please understand that I first look for a fix in yet to migrate systemd commits, as I do not want to divert too far from systemd-login.

@perfect7gentleman
Copy link

systemd-236/237 builds fine with glibc-2.27

@Yamakuzure
Copy link
Collaborator

@perfect7gentleman : The upgrade to systemd-236 will come soon. However, maybe I can backport glibc-2.27 support...

@ghost
Copy link

ghost commented Mar 8, 2018

I'm successfully compiling elogind with this patch:
glibc patch

@brothermechanic
Copy link

Hey, this is a super cool patch!
it works!
thanks!

@florin65
Copy link
Author

florin65 commented Mar 8, 2018

Thank you selflex.
The patch solve the problem.

@Yamakuzure
Copy link
Collaborator

@selflex Nice! Does elogind still build against the older glibc after applying that patch?

@ghost
Copy link

ghost commented Mar 13, 2018

It should build against older glibc versions but I can try building on glibc-2.26 in case it doesn't.

@ghost
Copy link

ghost commented Mar 13, 2018

@Yamakuzure I've built elogind successfully with glibc version 2.26 after applying the patch. Keep up the good work!

@poyraz76
Copy link

A suitable patch in glibc 2.27

@Yamakuzure
Copy link
Collaborator

Sorry for the delay. I'll backport the patch to 235 and release a new version during this week.

Yamakuzure added a commit that referenced this issue Mar 27, 2018
Bug: #46
elogind 235.2 fail to compile with glibc-2.27.

Ali H. Caliskan (selflex) posted this patch which fixes the incompatibility
with glibc-2.27+

He also made sure that elogind still compiles against glibc-2.26.
@Yamakuzure
Copy link
Collaborator

Please have a look whether the current state in the v235-stable branch compiles for you.

@Yamakuzure
Copy link
Collaborator

Yamakuzure commented Mar 27, 2018

And while you are at it: Does the current master compile against glibc 2.27? If it does it is almost ready to become v236.1 .

@Yamakuzure Yamakuzure self-assigned this Mar 28, 2018
@ghost
Copy link

ghost commented Mar 28, 2018

Current master doesnt compile against glibc version 2.27. I get this error:

elogind-236.1/src/basic/missing_syscall.h:312:23: error: static declaration of 'copy_file_range' follows non-static declaration
static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,

@ghost
Copy link

ghost commented Mar 28, 2018

elogind 236.1 glibc-2.27 patch:

--- a/src/basic/missing_syscall.h	2018-03-28 12:23:43.449996193 +0200
+++ b/src/basic/missing_syscall.h	2018-03-28 12:25:53.056662651 +0200
@@ -64,7 +64,7 @@
 #    endif
 #  endif
 
-static inline int memfd_create(const char *name, unsigned int flags) {
+static inline int missing_memfd_create(const char *name, unsigned int flags) {
 #  ifdef __NR_memfd_create
         return syscall(__NR_memfd_create, name, flags);
 #  else
@@ -309,7 +309,7 @@
 #    endif
 #  endif
 
-static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
+static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in,
                                       int fd_out, loff_t *off_out,
                                       size_t len,
                                       unsigned int flags) {

@Yamakuzure
Copy link
Collaborator

@selflex : If I rename those functions, the build will fail on all systems where these are really missing.

The build system should have detected whether they are there or not. And if they are, those definitions wouldn't be needed, because the appropriate macros would have been defined.

@Yamakuzure
Copy link
Collaborator

I have already branched out v236-stable, as upstream has committed a bunch of updates already.

Part of the updates went into the build system, including the detection of these functions.

Please test whether v235-stable and v236-stable branches compile cleanly against glibc-2.27.

Thank you very much!

@plorenzo19
Copy link
Contributor

plorenzo19 commented Apr 4, 2018

@Yamakuzure
Hi, first of all thank you for your work with elogind :)

Please test whether v235-stable and v236-stable branches compile cleanly against glibc-2.27.

elogind 235-stable builds and works fine without patching, but v236-stable still fail to build for me with the following error

[27/540] cc -Isrc/basic/basic@sta -Isrc/basic -I../src/basic -I. -I../ -Isrc/update-utmp -I../src/update-utmp -Isrc/sleep -I../src/sleep -I../src/libelogind/sd-id128 -I../src/libelogind/sd-bus -Isrc/core -I../src/core -Isrc/login -I../src/login -Isrc/systemd -I../src/systemd -Isrc/shared -I../src/shared -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Werror=shadow -ffunction-sections -fdata-sections -include config.h -O2 -march=core2 -fstack-protector -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -pthread -MD -MQ 'src/basic/basic@sta/fileio.c.o' -MF 'src/basic/basic@sta/fileio.c.o.d' -o 'src/basic/basic@sta/fileio.c.o' -c ../src/basic/fileio.c
FAILED: src/basic/basic@sta/fileio.c.o
cc -Isrc/basic/basic@sta -Isrc/basic -I../src/basic -I. -I../ -Isrc/update-utmp -I../src/update-utmp -Isrc/sleep -I../src/sleep -I../src/libelogind/sd-id128 -I../src/libelogind/sd-bus -Isrc/core -I../src/core -Isrc/login -I../src/login -Isrc/systemd -I../src/systemd -Isrc/shared -I../src/shared -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Werror=shadow -ffunction-sections -fdata-sections -include config.h -O2 -march=core2 -fstack-protector -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -pthread -MD -MQ 'src/basic/basic@sta/fileio.c.o' -MF 'src/basic/basic@sta/fileio.c.o.d' -o 'src/basic/basic@sta/fileio.c.o' -c ../src/basic/fileio.c
In file included from ../src/basic/missing.h:1349:0,
from ../src/basic/util.h:47,
from ../src/basic/def.h:23,
from ../src/basic/fileio.c:36:
../src/basic/missing_syscall.h:67:19: error: static declaration of ‘memfd_create’ follows non-static declaration
static inline int memfd_create(const char *name, unsigned int flags) {
^~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:115:0,
from /usr/include/x86_64-linux-gnu/bits/mman.h:45,
from /usr/include/x86_64-linux-gnu/sys/mman.h:41,
from ../src/basic/fileio.c:29:
/usr/include/x86_64-linux-gnu/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
ninja: build stopped: subcommand failed.
dh_auto_build: cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 ninja -j1 -v returned exit code 1
make: *** [debian/rules:48: build] Error 1
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

libc is 2.27 and meson is 0.45.1, Debian Sid/Unstable.
Let me know if you need more info

@Yamakuzure
Copy link
Collaborator

Dammit. Something is really fishy here. Could you please post your configuration log?

@plorenzo19
Copy link
Contributor

I got this with meson + ninja (the previous post i was using the Debian building system, so the output is different)
$ meson -Dselinux=false -Ddefault-hierarchy=legacy -Dcgroup-controller=elogind build-test/

The Meson build system
Version: 0.45.1
Source dir: /home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable
Build dir: /home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/build-test
Build type: native build
Project name: elogind
Native C compiler: cc (gcc 7.3.0 "cc (Debian 7.3.0-14) 7.3.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Program tools/meson-check-compilation.sh found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/meson-check-compilation.sh)
Program c++ found: YES (/usr/bin/c++)
Native C++ compiler: c++ (gcc 7.3.0 "c++ (Debian 7.3.0-14) 7.3.0")
Compiler for C supports argument -Wextra: YES
Compiler for C supports argument -Werror=undef: YES
Compiler for C supports argument -Wlogical-op: YES
Compiler for C supports argument -Wmissing-include-dirs: YES
Compiler for C supports argument -Wold-style-definition: YES
Compiler for C supports argument -Wpointer-arith: YES
Compiler for C supports argument -Winit-self: YES
Compiler for C supports argument -Wdeclaration-after-statement: YES
Compiler for C supports argument -Wfloat-equal: YES
Compiler for C supports argument -Wsuggest-attribute=noreturn: YES
Compiler for C supports argument -Werror=missing-prototypes: YES
Compiler for C supports argument -Werror=implicit-function-declaration: YES
Compiler for C supports argument -Werror=missing-declarations: YES
Compiler for C supports argument -Werror=return-type: YES
Compiler for C supports argument -Werror=incompatible-pointer-types: YES
Compiler for C supports argument -Werror=format=2: YES
Compiler for C supports argument -Wstrict-prototypes: YES
Compiler for C supports argument -Wredundant-decls: YES
Compiler for C supports argument -Wmissing-noreturn: YES
Compiler for C supports argument -Wimplicit-fallthrough=5: YES
Compiler for C supports argument -Wshadow: YES
Compiler for C supports argument -Wendif-labels: YES
Compiler for C supports argument -Wstrict-aliasing=2: YES
Compiler for C supports argument -Wwrite-strings: YES
Compiler for C supports argument -Werror=overflow: YES
Compiler for C supports argument -Wdate-time: YES
Compiler for C supports argument -Wnested-externs: YES
Compiler for C supports argument -ffast-math: YES
Compiler for C supports argument -fno-common: YES
Compiler for C supports argument -fdiagnostics-show-option: YES
Compiler for C supports argument -fno-strict-aliasing: YES
Compiler for C supports argument -fvisibility=hidden: YES
Compiler for C supports argument -fstack-protector: YES
Compiler for C supports argument -fstack-protector-strong: YES
Compiler for C supports argument -fPIE: YES
Compiler for C supports argument --param=ssp-buffer-size=4: YES
Compiler for C supports argument -Wunused-parameter: YES
Compiler for C supports argument -Wmissing-field-initializers: YES
Compiler for C supports argument -Wunused-result: YES
Compiler for C supports argument -Wformat-signedness: YES
Compiler for C supports argument -Werror=nonnull: YES
Checking if "-Werror=shadow with local shadowing" compiles: YES
Message: Linking with -Wl,-z,relro supported: yes
Message: Linking with -Wl,-z,now supported: yes
Message: Linking with -pie supported: yes
Checking for size of "pid_t": 4
Checking for size of "uid_t": 4
Checking for size of "gid_t": 4
Checking for size of "dev_t": 8
Checking for size of "ino_t": 8
Checking for size of "time_t": 8
Checking for size of "rlim_t": 8
Checking for size of "char16_t": 2
Checking for size of "char32_t": 4
Checking for size of "key_serial_t": -1
Checking for size of "struct ethtool_link_settings": 48
Checking for size of "struct fib_rule_uid_range": 8
Header <linux/if_link.h> has symbol "IFLA_INET6_ADDR_GEN_MODE": YES
Header <linux/if_link.h> has symbol "IN6_ADDR_GEN_MODE_STABLE_PRIVACY": YES
Header <linux/if_link.h> has symbol "IFLA_VRF_TABLE": YES
Header <linux/if_link.h> has symbol "IFLA_MACVLAN_FLAGS": YES
Header <linux/if_link.h> has symbol "IFLA_IPVLAN_MODE": YES
Header <linux/if_link.h> has symbol "IFLA_PHYS_PORT_ID": YES
Header <linux/if_link.h> has symbol "IFLA_BOND_AD_INFO": YES
Header <linux/if_link.h> has symbol "IFLA_VLAN_PROTOCOL": YES
Header <linux/if_link.h> has symbol "IFLA_VXLAN_REMCSUM_NOPARTIAL": YES
Header <linux/if_link.h> has symbol "IFLA_VXLAN_GPE": YES
Header <linux/if_link.h> has symbol "IFLA_GENEVE_LABEL": YES
Header <linux/if_tunnel.h> has symbol "IFLA_VTI_REMOTE": YES
Header <linux/if_tunnel.h> has symbol "IFLA_IPTUN_ENCAP_DPORT": YES
Header <linux/if_tunnel.h> has symbol "IFLA_GRE_ENCAP_DPORT": YES
Header <linux/if_bridge.h> has symbol "IFLA_BRIDGE_VLAN_INFO": YES
Header <linux/if_link.h> has symbol "IFLA_BRPORT_PROXYARP": YES
Header <linux/if_link.h> has symbol "IFLA_BRPORT_LEARNING_SYNC": YES
Header <linux/if_link.h> has symbol "IFLA_BR_VLAN_DEFAULT_PVID": YES
Header <linux/neighbour.h> has symbol "NDA_IFINDEX": YES
Header <linux/if_addr.h> has symbol "IFA_FLAGS": YES
Header <linux/fib_rules.h> has symbol "FRA_UID_RANGE": YES
Header <linux/loop.h> has symbol "LO_FLAGS_PARTSCAN": YES
Header <linux/can/vxcan.h> has symbol "VXCAN_INFO_PEER": YES
Checking for function "secure_getenv": YES
Checking for function "__secure_getenv": NO
Checking for function "memfd_create": NO
Checking for function "gettid": NO
Checking for function "pivot_root": NO
Checking for function "name_to_handle_at": YES
Checking for function "setns": YES
Checking for function "renameat2": NO
Checking for function "kcmp": NO
Checking for function "keyctl": NO
Checking for function "copy_file_range": YES
Checking for function "bpf": NO
Checking for function "explicit_bzero": YES
Checking for function "getrandom": YES
Program sed found: YES (/bin/sed)
Program awk found: YES (/usr/bin/awk)
Program m4 found: YES (/usr/bin/m4)
Program stat found: YES (/usr/bin/stat)
Program git found: YES (/usr/bin/git)
Program kexec found: NO
Program /usr/sbin/kexec found: NO
Program /sbin/kexec found: NO
Program reboot found: NO
Program /usr/sbin/reboot found: NO
Program /sbin/reboot found: YES (/sbin/reboot)
Program halt found: NO
Program /usr/sbin/halt found: NO
Program /sbin/halt found: YES (/sbin/halt)
Program gperf found: YES (/usr/bin/gperf)
Message: gperf len type is size_t
Has header "sys/capability.h": YES
Has header "linux/btrfs.h": YES
Has header "linux/memfd.h": YES
Has header "linux/vm_sockets.h": YES
Has header "sys/auxv.h": YES
Has header "valgrind/memcheck.h": YES
Has header "valgrind/valgrind.h": YES
Program tools/meson-get-cg-controller.sh found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/meson-get-cg-controller.sh)
Message: maximum system UID is 999
Message: maximum system GID is 999
Message: WARNING:
The local group with the GID 65534 does not match the configured group name "nobody" of the nobody group (its name is nogroup).
Your build will result in an group table setup that is incompatible with the local system.
Dependency threads found: YES
Library rt found: YES
Library m found: YES
Library dl found: YES
Library crypt found: YES
Found pkg-config: /usr/bin/pkg-config (0.29)
Native dependency libcap found: YES 2.25
Native dependency polkit-gobject-1 found: YES 0.105
Message: Old polkit detected, will install pkla files
Library acl found: YES
Native dependency audit found: YES 2.8.2
Library pam found: YES
Library pam_misc found: YES
Native dependency glib-2.0 found: YES 2.56.0
Native dependency gobject-2.0 found: YES 2.56.0
Native dependency gio-2.0 found: YES 2.56.0
Native dependency dbus-1 found: YES 1.12.6
Configuring config.h using configuration
Program /home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/meson-symlink_headers.sh found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/meson-symlink_headers.sh)
Program c++ found: YES (/usr/bin/c++)
Program generate-gperfs.py found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/src/basic/generate-gperfs.py)
Program generate-cap-list.sh found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/src/basic/generate-cap-list.sh)
Program generate-errno-list.sh found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/src/basic/generate-errno-list.sh)
Configuring libelogind.pc using configuration
Configuring logind.conf using configuration
Configuring org.freedesktop.login1.service using configuration
Configuring 71-seat.rules using configuration
Configuring 73-seat-late.rules using configuration
Native dependency libudev found: YES 238
Program generate-sym-test.py found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/src/test/generate-sym-test.py)
Message: test-ipcrm is an unsafe test
Message: test-cgroup is a manual test
Message: test-inhibit is a manual test
Program tools/make-directive-index.py found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/make-directive-index.py)
Program tools/make-man-index.py found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/make-man-index.py)
Program tools/xml_helper.py found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/xml_helper.py)
Program xsltproc found: YES (/usr/bin/xsltproc)
Native dependency bash-completion found: YES 2.8
Message: bash completions: /usr/share/bash-completion/completions
Message: zsh completions: /usr/share/zsh/site-functions
Program sh found: YES (/bin/sh)
Program tools/meson-check-help.sh found: YES (/home/ombra/src-nsd/elogind/elogind-236-test/elogind-236-stable/tools/meson-check-help.sh)
Message: elogind 236
rootexeclib dir: /usr/lib/elogind
TTY GID: 5
maximum system UID: 999
maximum system GID: 999
default KillUserProcesses setting: true

     enabled features: PAM, AUDIT, SMACK, ACL, polkit, legacy pkla, dbus, glib, man pages, man page indices, utmp
     
     disabled features: SELinux, html pages, debug elogind, debug hashmap, debug mmap cache

Build targets in project: 412
Found ninja-1.8.2 at /usr/bin/ninja

then the build fails with
$ ninja -C build-test/

ninja: Entering directory `build-test/'
[11/541] Compiling C object 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o'.
FAILED: src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o
cc -Isrc/libelogind/elogind@sta -Isrc/libelogind -I../src/libelogind -I. -I../ -Isrc/update-utmp -I../src/update-utmp -Isrc/sleep -I../src/sleep -I../src/libelogind/sd-id128 -I../src/libelogind/sd-bus -Isrc/core -I../src/core -Isrc/login -I../src/login -Isrc/systemd -I../src/systemd -Isrc/shared -I../src/shared -Isrc/basic -I../src/basic -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Werror=shadow -include config.h -fPIC -pthread -MD -MQ 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o' -MF 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o.d' -o 'src/libelogind/elogind@sta/sd-bus_bus-kernel.c.o' -c ../src/libelogind/sd-bus/bus-kernel.c
In file included from ../src/basic/missing.h:1349:0,
from ../src/basic/util.h:47,
from ../src/basic/hashmap.h:30,
from ../src/libelogind/sd-bus/bus-match.h:25,
from ../src/libelogind/sd-bus/bus-internal.h:30,
from ../src/libelogind/sd-bus/bus-kernel.c:37:
../src/basic/missing_syscall.h:67:19: error: static declaration of ‘memfd_create’ follows non-static declaration
static inline int memfd_create(const char *name, unsigned int flags) {
^~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:115:0,
from /usr/include/x86_64-linux-gnu/bits/mman.h:45,
from /usr/include/x86_64-linux-gnu/sys/mman.h:41,
from ../src/libelogind/sd-bus/bus-kernel.c:27:
/usr/include/x86_64-linux-gnu/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
[15/541] Compiling C object 'src/libelogind/elogind@sta/sd-bus_bus-message.c.o'.
FAILED: src/libelogind/elogind@sta/sd-bus_bus-message.c.o
cc -Isrc/libelogind/elogind@sta -Isrc/libelogind -I../src/libelogind -I. -I../ -Isrc/update-utmp -I../src/update-utmp -Isrc/sleep -I../src/sleep -I../src/libelogind/sd-id128 -I../src/libelogind/sd-bus -Isrc/core -I../src/core -Isrc/login -I../src/login -Isrc/systemd -I../src/systemd -Isrc/shared -I../src/shared -Isrc/basic -I../src/basic -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O0 -g -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Werror=shadow -include config.h -fPIC -pthread -MD -MQ 'src/libelogind/elogind@sta/sd-bus_bus-message.c.o' -MF 'src/libelogind/elogind@sta/sd-bus_bus-message.c.o.d' -o 'src/libelogind/elogind@sta/sd-bus_bus-message.c.o' -c ../src/libelogind/sd-bus/bus-message.c
In file included from ../src/basic/missing.h:1349:0,
from ../src/basic/util.h:47,
from ../src/basic/hashmap.h:30,
from ../src/libelogind/sd-bus/bus-match.h:25,
from ../src/libelogind/sd-bus/bus-internal.h:30,
from ../src/libelogind/sd-bus/bus-message.c:29:
../src/basic/missing_syscall.h:67:19: error: static declaration of ‘memfd_create’ follows non-static declaration
static inline int memfd_create(const char *name, unsigned int flags) {
^~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:115:0,
from /usr/include/x86_64-linux-gnu/bits/mman.h:45,
from /usr/include/x86_64-linux-gnu/sys/mman.h:41,
from ../src/libelogind/sd-bus/bus-message.c:23:
/usr/include/x86_64-linux-gnu/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
[16/541] Compiling C object 'src/libelogind/elogind@sta/sd-bus_bus-objects.c.o'.
ninja: build stopped: subcommand failed.

@ghost
Copy link

ghost commented Apr 8, 2018

As I mentioned before the memfd_create and some more functions have been changed upstream already: src/basic/missing_syscall.h

@Yamakuzure
Copy link
Collaborator

Yamakuzure commented Apr 9, 2018

@selflex : Thank you for clarifying this. The difference between your previous comment is, that they actually map from foo to missing_foo using a #define. Without that, simply changing the names of the functions won't work.

I'll see to it that this is applied.

@Yamakuzure
Copy link
Collaborator

I have ported the missing_syscall.h fix to both v235-stable and v236-stable.

I'd appreciate if someone could be so kind and test whether both now compile successfully against glibc-2.27. Thank you very much!

@perfect7gentleman
Copy link

v236

[539/539] /usr/bin/xsltproc -o man/elogind.index.7 --nonet --xinclude --maxdepth 9000 --stringparam man.output.quietly 1 --stringparam funcsynopsis.style ansi --stringparam man.authors.section.enabled 0 --stringparam man.copyright.section.enabled 0 --stringparam elogind.version 236 --path /tmp/portage/sys-auth/elogind-236/work/elogind-236-build/man:/tmp/portage/sys-auth/elogind-236/work/elogind-236-stable/man ../elogind-236-stable/man/custom-man.xsl man/elogind.index.xml
>>> Source compiled.

@plorenzo19
Copy link
Contributor

tested v235.4 and v236.1, I confirm both now compile successfully.
Thanks

@Yamakuzure
Copy link
Collaborator

Cool!
I have to tackle, or at least get some feedback, on some other issues, and can then release both.

Thank you all very much for your patience and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants