Support uClibc for the tests compilations
There are two issues that don't allow ZFS to be compiled using uClibc. `backtrace()`, and `program_invocation_short_name` as a `const`. This patch adds uClibc to the conditionals in the same way there are already for Glibc for `backtrace()`; and removes the external param `program_invocation_short_name` because its only used here for the whole project. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com> Closes #11600
This commit is contained in:
parent
73e26fdc09
commit
62f9691e10
|
@ -132,7 +132,7 @@
|
||||||
#include <libnvpair.h>
|
#include <libnvpair.h>
|
||||||
#include <libzutil.h>
|
#include <libzutil.h>
|
||||||
#include <sys/crypto/icp.h>
|
#include <sys/crypto/icp.h>
|
||||||
#ifdef __GLIBC__
|
#if (__GLIBC__ && !__UCLIBC__)
|
||||||
#include <execinfo.h> /* for backtrace() */
|
#include <execinfo.h> /* for backtrace() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ dump_debug_buffer(void)
|
||||||
static void sig_handler(int signo)
|
static void sig_handler(int signo)
|
||||||
{
|
{
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
#ifdef __GLIBC__ /* backtrace() is a GNU extension */
|
#if (__GLIBC__ && !__UCLIBC__) /* backtrace() is a GNU extension */
|
||||||
int nptrs;
|
int nptrs;
|
||||||
void *buffer[BACKTRACE_SZ];
|
void *buffer[BACKTRACE_SZ];
|
||||||
|
|
||||||
|
|
|
@ -44,11 +44,9 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
|
|
||||||
extern char *program_invocation_short_name;
|
|
||||||
|
|
||||||
#define ERROR(fmt, ...) \
|
#define ERROR(fmt, ...) \
|
||||||
fprintf(stderr, "%s: %s:%d: %s: " fmt "\n", \
|
fprintf(stderr, "xattrtest: %s:%d: %s: " fmt "\n", \
|
||||||
program_invocation_short_name, __FILE__, __LINE__, \
|
__FILE__, __LINE__, \
|
||||||
__func__, ## __VA_ARGS__);
|
__func__, ## __VA_ARGS__);
|
||||||
|
|
||||||
static const char shortopts[] = "hvycdn:f:x:s:p:t:e:rRko:";
|
static const char shortopts[] = "hvycdn:f:x:s:p:t:e:rRko:";
|
||||||
|
|
Loading…
Reference in New Issue