From 578b96abd0dd448a75024765fca87a21c2298e68 Mon Sep 17 00:00:00 2001 From: Thomas Batten Date: Fri, 22 Jan 2021 20:33:17 +1030 Subject: [PATCH 1/5] configure.ac: fix autogen warning about non-POSIX archiver --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index abbb7f1..b790012 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,7 @@ dnl kdrive-config.h covers the kdrive DDX AC_CONFIG_HEADERS(include/kdrive-config.h) AC_PROG_CC +AM_PROG_AR AM_PROG_AS AC_PROG_INSTALL AC_PROG_LN_S From 46f08a0b96962a7df669bc6dbd689a333962ea20 Mon Sep 17 00:00:00 2001 From: Thomas Batten Date: Fri, 22 Jan 2021 20:35:20 +1030 Subject: [PATCH 2/5] extern definitions to fix build with gcc 10 --- include/dixstruct.h | 6 +++--- include/os.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/dixstruct.h b/include/dixstruct.h index 87527f2..5aa89e0 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -181,11 +181,11 @@ typedef struct _CallbackList { /* proc vectors */ -int (* InitialVector[3]) (ClientPtr /*client*/); +extern int (* InitialVector[3]) (ClientPtr /*client*/); -int (* ProcVector[256]) (ClientPtr /*client*/); +extern int (* ProcVector[256]) (ClientPtr /*client*/); -int (* SwappedProcVector[256]) (ClientPtr /*client*/); +extern int (* SwappedProcVector[256]) (ClientPtr /*client*/); extern const ReplySwapPtr ReplySwapVector[256]; diff --git a/include/os.h b/include/os.h index 2b354ba..f4bba97 100644 --- a/include/os.h +++ b/include/os.h @@ -90,7 +90,7 @@ typedef struct _NewClientRec *NewClientPtr; #define SIGVAL void #endif -void (*OsVendorVErrorFProc)(const char *, va_list args); +extern void (*OsVendorVErrorFProc)(const char *, va_list args); int WaitForSomething( int* /*pClientsReady*/ From fad566e010dfe4d28183adbd79a355a66e663571 Mon Sep 17 00:00:00 2001 From: Thomas Batten Date: Fri, 22 Jan 2021 20:42:49 +1030 Subject: [PATCH 3/5] Makefile.am: fix autogen warning about subdir objects --- Makefile.am | 2 ++ kdrive/src/Makefile.am | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index ad1e3e4..38b689e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +AUTOMAKE_OPTIONS = subdir-objects + ACLOCAL_AMFLAGS=-I m4 if DBE diff --git a/kdrive/src/Makefile.am b/kdrive/src/Makefile.am index 8c0ac65..ff1458d 100644 --- a/kdrive/src/Makefile.am +++ b/kdrive/src/Makefile.am @@ -1,3 +1,5 @@ +AUTOMAKE_OPTIONS = subdir-objects + AM_CPPFLAGS = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ From 85e8af0e0d1748691e1e9acb310d3815e8e5994d Mon Sep 17 00:00:00 2001 From: Thomas Batten Date: Fri, 22 Jan 2021 22:38:23 +1030 Subject: [PATCH 4/5] fix build on musl, require automake 2.60 --- Xext/xf86bigfont.c | 14 ++++++++------ configure.ac | 10 ++-------- kdrive/linux/linux.c | 6 ++++++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index c3a04f3..b9fe1bf 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -39,13 +39,15 @@ #endif #include -#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2) -/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */ -/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers): - Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define - PAGE_SIZE. It is defined in . */ -#include + +#ifdef __linux__ +# ifdef __GNU_LIBRARY__ +# if __GNU_LIBRARY__ < 2 /* libc5 */ +# include +# endif +# endif #endif + #include #include #include diff --git a/configure.ac b/configure.ac index b790012..4a5ede3 100644 --- a/configure.ac +++ b/configure.ac @@ -23,8 +23,10 @@ dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) AC_INIT([tinyx], 1.3) +AC_PREREQ([2.60]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) +AC_USE_SYSTEM_EXTENSIONS AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign -Wall]) dnl this gets generated by autoheader, and thus contains all the defines. we @@ -574,14 +576,6 @@ AM_CONDITIONAL(KDRIVEFBDEV, [test x"$ac_cv_header_linux_fb_h" = xyes]) dnl and the rest of these are generic, so they're in config.h AC_DEFINE(XResExtension, 1, [Build XRes extension]) -AC_TRY_COMPILE([ -#include -#ifndef __GLIBC__ -#error not glibc -#endif -], [], [AC_DEFINE(_GNU_SOURCE, 1, - [ Enable GNU and other extensions to the C environment for glibc])]) - dnl ---------- Compiler arguments AX_CHECK_COMPILE_FLAG([-flto], diff --git a/kdrive/linux/linux.c b/kdrive/linux/linux.c index 7a589cd..ad61310 100644 --- a/kdrive/linux/linux.c +++ b/kdrive/linux/linux.c @@ -34,6 +34,12 @@ #include #include +/* These symbols are not defined on musl */ +#if !defined(__uid_t) && !defined(__gid_t) +#define __uid_t uid_t +#define __gid_t gid_t +#endif + static int vtno; int LinuxConsoleFd; static int LinuxApmFd; From 0644c074e443969eec920a586905d34599080680 Mon Sep 17 00:00:00 2001 From: Thomas Batten Date: Fri, 22 Jan 2021 22:48:17 +1030 Subject: [PATCH 5/5] mark functions that LTO breaks on musl --- include/input.h | 2 +- include/os.h | 6 +++--- include/scrnintstr.h | 2 +- kdrive/src/kdrive.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/input.h b/include/input.h index 297f5fc..93e1f61 100644 --- a/include/input.h +++ b/include/input.h @@ -328,6 +328,6 @@ void ProcessInputEvents(void); void InitInput( int /*argc*/, - char ** /*argv*/); + char ** /*argv*/) XFONT_LTO; #endif /* INPUT_H */ diff --git a/include/os.h b/include/os.h index f4bba97..253bd8b 100644 --- a/include/os.h +++ b/include/os.h @@ -231,7 +231,7 @@ void OsCleanup(Bool); void OsVendorFatalError(void); -void OsVendorInit(void); +void OsVendorInit(void) XFONT_LTO; void OsBlockSignals (void); @@ -320,9 +320,9 @@ XID GenerateAuthorization( char ** /* data_return */); -int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /*i*/); +XFONT_LTO int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /*i*/); -void ddxUseMsg(void); +void ddxUseMsg(void) XFONT_LTO; /* int ReqLen(xReq *req, ClientPtr client) * Given a pointer to a *complete* request, return its length in bytes. diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 3058b70..bf725e5 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -527,6 +527,6 @@ extern ScreenInfo screenInfo; void InitOutput( ScreenInfo * /*pScreenInfo*/, int /*argc*/, - char ** /*argv*/); + char ** /*argv*/) XFONT_LTO; #endif /* SCREENINTSTRUCT_H */ diff --git a/kdrive/src/kdrive.h b/kdrive/src/kdrive.h index f4313ed..a13ffa6 100644 --- a/kdrive/src/kdrive.h +++ b/kdrive/src/kdrive.h @@ -414,6 +414,6 @@ KdShadowSet(ScreenPtr pScreen, int randr, ShadowUpdateProc update, void KdShadowUnset(ScreenPtr pScreen); /* function prototypes to be implemented by the drivers */ -void InitCard(char *name); +void InitCard(char *name) XFONT_LTO; #endif /* _KDRIVE_H_ */