Package: libaudit-dev
Version: 1:3.0-1
Severity: normal
Control: affects aide
Control: block 978245 -1

Dear Maintainer,

static linking fails with libaudit-dev 1:3.0-1, due to
"undefined reference to `audit_strsplit_r'".

Minimal example:

$ cat main.c
#include <stdio.h>
#include <libaudit.h>

int main() {
    audit_log_user_message(0, AUDIT_USER_LOGIN, "test", NULL, NULL, NULL, 0);
    return 0;
}

$ gcc -static -o /tmp/main main.c -laudit -lcap-ng
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libcap-ng.a(cap-ng.o):
 in function `capng_change_id':
(.text+0x18df): warning: Using 'initgroups' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libaudit.a(libaudit.o):
 in function `audit_rule_fieldpair_data':
(.text+0x2324): warning: Using 'getgrnam' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: (.text+0x2988): warning: Using 'getpwnam' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libcap-ng.a(cap-ng.o):
 in function `capng_change_id':
(.text+0x18c3): warning: Using 'getpwuid' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libaudit.a(audit_logging.o):
 in function `_resolve_addr.constprop.0':
(.text+0x246): warning: Using 'getaddrinfo' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libaudit.a(libaudit.o):
 in function `load_libaudit_config.constprop.0':
(.text+0x23a): undefined reference to `audit_strsplit_r'
/usr/bin/ld: (.text+0x25a): undefined reference to `audit_strsplit_r'
/usr/bin/ld: (.text+0x280): undefined reference to `audit_strsplit_r'
/usr/bin/ld: (.text+0x298): undefined reference to `audit_strsplit_r'
/usr/bin/ld: /tmp/main: hidden symbol `audit_strsplit_r' isn't defined
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Best regards

Hannes

Reply via email to