Closed radosroka closed 6 months ago
On almalinux8 and rockylinux8 the error was fixed but there is another 'undefined reference to `gettid''
This looks bogus. gcc 13/14 is not complaining. The gettid needs to have _GNU_SOURCE passed which is in the Makefile.am fapolicyd_CFLAGS. Hmm...
/bin/sh ../libtool --tag=CC --mode=link gcc -fPIE -DPIE -pthread -g -W -Wall -Wshadow -Wundef -Wno-unused-result -Wno-unused-parameter -D_GNU_SOURCE -g -O2 -pie -Wl,-z,relro -Wl,-z,now -static -o fapolicyd daemon/fapolicyd-fapolicyd.o daemon/fapolicyd-mounts.o daemon/fapolicyd-notify.o libfapolicyd.la -llmdb -lseccomp -lcap-ng -lmagic -lcrypto -ludev -lrpmio -lrpm
libtool: link: gcc -fPIE -DPIE -pthread -g -W -Wall -Wshadow -Wundef -Wno-unused-result -Wno-unused-parameter -D_GNU_SOURCE -g -O2 -pie -Wl,-z -Wl,relro -Wl,-z -Wl,now -o fapolicyd daemon/fapolicyd-fapolicyd.o daemon/fapolicyd-mounts.o daemon/fapolicyd-notify.o ./.libs/libfapolicyd.a -lpthread -llmdb -lseccomp -lcap-ng -lmagic -lcrypto -ludev -lrpmio -lrpm -pthread
daemon/fapolicyd-fapolicyd.o: In function `coredump_handler':
/__w/fapolicyd/fapolicyd/src/daemon/fapolicyd.c:213: undefined reference to `gettid'
collect2: error: ld returned 1 exit status
Hmm...RHEL 8 man page says: Note: There is no glibc wrapper for this system call; see NOTES.
I guess we need to use syscall and add a configure test to detect if gettid is available and call it via syscall if not.
I pushed commit 8567a53 that works around a missing gettid.
OK, I understand the warning now. You have to compile with -Wpedantic to reproduce. The cause is a goto label with no statement afterwards. There are 2 fixes: 1) The code you have supplied. 2) goto rewind_out instead. Either way fixes it.