BuddiesOfBudgie / budgie-screensaver

Budgie Screensaver is a fork of old gnome screensaver for purposes of providing an authentication prompt on wake.
GNU General Public License v2.0
15 stars 2 forks source link

Build failing on clang-16 #21

Open tmkcell opened 1 year ago

tmkcell commented 1 year ago

I'm trying to get budgie-desktop on chimera linux, but budgie-screensaver does not build.

the relevant section with errors:

[96/116] Compiling C object src/budgie-screensaver-dialog.p/gs-debug.c.o
FAILED: src/budgie-screensaver-dialog.p/gs-debug.c.o 
clang -Isrc/budgie-screensaver-dialog.p -Isrc -I../src -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/at-spi-2.0 -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/fribidi -I/usr/include/libpng16 -I/usr/include/gnome-desktop-3.0 -I/usr/include/gsettings-desktop-schemas -I/usr/include/libxml2 -flto=thin -fcolor-diagnostics -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c11 -fstack-clash-protection -fsanitize=signed-integer-overflow,integer-divide-by-zero -fsanitize-trap=signed-integer-overflow,integer-divide-by-zero -fno-sanitize-recover -flto=thin -O2 -ffile-prefix-map=/builddir/budgie-screensaver-5.1.0=. -g2 -pthread -MD -MQ src/budgie-screensaver-dialog.p/gs-debug.c.o -MF src/budgie-screensaver-dialog.p/gs-debug.c.o.d -o src/budgie-screensaver-dialog.p/gs-debug.c.o -c ../src/gs-debug.c
../src/gs-debug.c:102:16: error: call to undeclared function 'fdopen'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                        debug_out = fdopen (fd, "a");
                                    ^
../src/gs-debug.c:102:16: note: did you mean 'fopen'?
/usr/include/stdio.h:70:7: note: 'fopen' declared here
FILE *fopen(const char *__restrict, const char *__restrict);
      ^
../src/gs-debug.c:102:14: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct _IO_FILE *') from 'int' [-Wint-conversion]
                        debug_out = fdopen (fd, "a");
                                  ^ ~~~~~~~~~~~~~~~~
2 errors generated.
[97/116] Compiling C object src/budgie-screensaver-dialog.p/gs-auth-pam.c.o
FAILED: src/budgie-screensaver-dialog.p/gs-auth-pam.c.o 
clang -Isrc/budgie-screensaver-dialog.p -Isrc -I../src -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/at-spi-2.0 -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/fribidi -I/usr/include/libpng16 -I/usr/include/gnome-desktop-3.0 -I/usr/include/gsettings-desktop-schemas -I/usr/include/libxml2 -flto=thin -fcolor-diagnostics -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c11 -fstack-clash-protection -fsanitize=signed-integer-overflow,integer-divide-by-zero -fsanitize-trap=signed-integer-overflow,integer-divide-by-zero -fno-sanitize-recover -flto=thin -O2 -ffile-prefix-map=/builddir/budgie-screensaver-5.1.0=. -g2 -pthread -MD -MQ src/budgie-screensaver-dialog.p/gs-auth-pam.c.o -MF src/budgie-screensaver-dialog.p/gs-auth-pam.c.o.d -o src/budgie-screensaver-dialog.p/gs-auth-pam.c.o -c ../src/gs-auth-pam.c
../src/gs-auth-pam.c:480:2: error: call to undeclared function 'sigtimedwait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        sigtimedwait (&set, NULL, &timeout);
        ^
1 error generated.
tmkcell commented 1 year ago

config:

The Meson build system
Version: 1.1.0
Source dir: /builddir/budgie-screensaver-5.1.0
Build dir: /builddir/budgie-screensaver-5.1.0/build
Build type: native build
Project name: budgie-screensaver
Project version: 5.1.0
C compiler for the host machine: clang (clang 16.0.3 "clang version 16.0.3")
C linker for the host machine: clang ld.lld 16.0.3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program git found: NO
Found pkg-config: /usr/bin/pkg-config (1.9.4)
Run-time dependency x11 found: YES 1.8.4
Run-time dependency glib-2.0 found: YES 2.76.2
Run-time dependency gio-2.0 found: YES 2.76.2
Run-time dependency gthread-2.0 found: YES 2.76.2
Run-time dependency dbus-glib-1 found: YES 0.112
Run-time dependency gtk+-3.0 found: YES 3.24.37
Run-time dependency gnome-desktop-3.0 found: YES 44.0
Run-time dependency gsettings-desktop-schemas found: YES 44.0
Run-time dependency libgnomekbdui found: YES 3.28.1
Run-time dependency xxf86vm found: YES 1.1.5
Library pam found: YES
Configuring config.h using configuration
Program intltool-merge found: YES (/usr/bin/intltool-merge)
Program msgfmt found: YES (/usr/bin/msgfmt)
Program msginit found: NO
po/meson.build:100: WARNING: 'msginit' not found, maintainer targets will not work
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Found pkg-config: /usr/bin/pkg-config (1.9.4)
Program glib-genmarshal found: YES (/usr/bin/glib-genmarshal)
Build targets in project: 100

budgie-screensaver 5.1.0

  User defined options
    auto_features  : auto
    bindir         : /usr/bin
    buildtype      : plain
    datadir        : /usr/share
    default_library: both
    includedir     : /usr/include
    infodir        : /usr/share/info
    libdir         : /usr/lib
    libexecdir     : /usr/libexec
    localstatedir  : /var
    mandir         : /usr/share/man
    prefix         : /usr
    sbindir        : /usr/bin
    sharedstatedir : /var/lib
    sysconfdir     : /etc
    wrap_mode      : nodownload
    b_lto          : true
    b_lto_mode     : thin
    b_ndebug       : true
    b_staticpic    : true
    with-systemd   : false
EbonJaeger commented 1 year ago

Chimera uses musl C, and in order to have fdopen, one of these must be defined.

We currently define _POSIX_SOURCE in subprocs.c, but perhaps that's farther on in the build than the fdopen call.

Should we add another define guard in gs-debug.c where fdopen is used, or should the define in subprocs.c be moved to a better location?

*EDIT: It looks like the same story for the second error for sigtimedwait.

tmkcell commented 1 year ago

It might be better if the define was defined somewhere else since the error is both in gs-debug.c, gs-auth-pam.c and probably other files later on in the build. But I don't really know much about C to say for sure.