Refreshed patches. Reworked several of them as musl has changed. Removed several upstreamed ones. Added musl 1.2.0 patch which uses 64-bit time_t. Removed -Werror as there's a redefinition warning caused by nls.mk. Replaced glib2/host dependency with rpcsvc-proto. Fixed compilation with full NLS. Fixed compilation with musl 1.2.0 Signed-off-by: Rosen Penev <rosenp@gmail.com>lilik-openwrt-22.03
@ -1,13 +0,0 @@ | |||
diff -urN a/configure.ac b/configure.ac | |||
--- a/configure.ac | |||
+++ b/configure.ac | |||
@@ -949,7 +949,7 @@ | |||
AC_VMW_CHECK_LIB([dnet], | |||
[DNET], | |||
[], | |||
- [dnet-config], | |||
+ [], | |||
[], | |||
[dnet.h], | |||
[intf_open], | |||
@ -1,13 +0,0 @@ | |||
diff -urN a/lib/wiper/wiperPosix.c b/lib/wiper/wiperPosix.c | |||
--- a/lib/wiper/wiperPosix.c | |||
+++ b/lib/wiper/wiperPosix.c | |||
@@ -43,6 +43,9 @@ | |||
# include <libgen.h> | |||
# endif /* __FreeBSD_version >= 500000 */ | |||
#endif | |||
+#if defined(__linux__) | |||
+#include <sys/sysmacros.h> | |||
+#endif | |||
#include <unistd.h> | |||
#include "vmware.h" |
@ -1,28 +1,17 @@ | |||
diff -urN a/lib/err/errPosix.c b/lib/err/errPosix.c | |||
--- a/lib/err/errPosix.c | |||
+++ b/lib/err/errPosix.c | |||
@@ -31,6 +31,7 @@ | |||
#include <errno.h> | |||
#include <string.h> | |||
#include <locale.h> | |||
+#include <stdio.h> | |||
#include "vmware.h" | |||
#include "errInt.h" | |||
@@ -63,11 +64,13 @@ | |||
@@ -61,13 +61,7 @@ ErrErrno2String(Err_Number errorNumber, // IN | |||
char *buf, // OUT: return buffer | |||
size_t bufSize) // IN: size of buffer | |||
{ | |||
char *p; | |||
- char *p; | |||
- | |||
-#if defined(__linux__) && !defined(__ANDROID__) | |||
+#if defined(__GLIBC__) && !defined(__ANDROID__) | |||
p = strerror_r(errorNumber, buf, bufSize); | |||
#else | |||
- p = strerror_r(errorNumber, buf, bufSize); | |||
-#else | |||
- p = strerror(errorNumber); | |||
-#endif | |||
+ if (strerror_r(errorNumber, buf, bufSize) != 0) | |||
+ snprintf(buf, bufSize, "unknown error %i", errorNumber); | |||
+ p = buf; | |||
+#endif /* defined __GLIBC__ */ | |||
+ char *p = strerror(errorNumber); | |||
ASSERT(p != NULL); | |||
return p; | |||
} |
@ -1,14 +0,0 @@ | |||
diff -urN a/lib/hgfsServer/hgfsServerLinux.c b/lib/hgfsServer/hgfsServerLinux.c | |||
--- a/lib/hgfsServer/hgfsServerLinux.c | |||
+++ b/lib/hgfsServer/hgfsServerLinux.c | |||
@@ -5295,8 +5295,8 @@ | |||
goto exit; | |||
} | |||
- LOG(6, "%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n", | |||
- __FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max); | |||
+ LOG(6, "%s: File Size limits: 0x%jx 0x%jx\n", | |||
+ __FUNCTION__, (uintmax_t)fileSize.rlim_cur, (uintmax_t)fileSize.rlim_max); | |||
/* | |||
* Check the offset is within the file size range. |
@ -1,16 +1,11 @@ | |||
diff -urN a/lib/file/fileIOPosix.c b/lib/file/fileIOPosix.c | |||
--- a/lib/file/fileIOPosix.c | |||
+++ b/lib/file/fileIOPosix.c | |||
@@ -206,10 +206,10 @@ | |||
* the symbols (and anyone building XOPEN<700 gets nothing). | |||
*/ | |||
extern ssize_t preadv64(int fd, const struct iovec *iov, int iovcnt, | |||
- __off64_t offset) __attribute__ ((weak)); | |||
+ off64_t offset) __attribute__ ((weak)); | |||
@@ -198,7 +198,7 @@ static AlignedPool alignedPool; | |||
* are not available in any header file. | |||
*/ | |||
extern ssize_t pwritev64(int fd, const struct iovec *iov, int iovcnt, | |||
- __off64_t offset) __attribute__ ((weak)); | |||
+ off64_t offset) __attribute__ ((weak)); | |||
#else | |||
#error "Large file support unavailable. Aborting." | |||
#endif | |||
-#if defined(__linux__) && !defined(__ANDROID__) | |||
+#if 0 | |||
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) | |||
/* | |||
* We want preadv/pwritev. But due to FOB=64, the symbols are -64. |
@ -1,12 +1,12 @@ | |||
--- a/vmhgfs-fuse/fsutil.h | |||
+++ b/vmhgfs-fuse/fsutil.h | |||
@@ -32,9 +32,7 @@ | |||
@@ -29,6 +29,9 @@ | |||
#include "request.h" | |||
#include "vm_basic_types.h" | |||
+#ifndef _GNU_SOURCE | |||
+#define _GNU_SOURCE | |||
+#endif | |||
#include "hgfsProto.h" | |||
#include <fuse.h> | |||
-#if defined(__FreeBSD__) || defined(__SOLARIS__) || defined(__APPLE__) | |||
typedef long long loff_t; | |||
-#endif | |||
/* | |||
* Struct used to pass around attributes. |
@ -0,0 +1,34 @@ | |||
--- a/lib/hgfs/hgfsUtil.c | |||
+++ b/lib/hgfs/hgfsUtil.c | |||
@@ -109,7 +109,7 @@ int | |||
HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format | |||
uint64 ntTime) // IN: Time in Windows NT format | |||
{ | |||
-#ifdef __i386__ | |||
+#if defined(__i386__) && !__USE_TIME_BITS64 | |||
uint32 sec; | |||
uint32 nsec; | |||
@@ -134,7 +134,7 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format | |||
return -1; | |||
} | |||
-#ifdef __i386__ | |||
+#if defined(__i386__) && !__USE_TIME_BITS64 | |||
Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); | |||
unixTime->tv_sec = sec; | |||
unixTime->tv_nsec = nsec * 100; | |||
--- a/lib/hgfsServer/hgfsServerLinux.c | |||
+++ b/lib/hgfsServer/hgfsServerLinux.c | |||
@@ -2569,7 +2569,11 @@ HgfsStatToFileAttr(struct stat *stats, // IN: stat information | |||
# define FMTTIMET "l" | |||
# endif | |||
#else | |||
+#ifdef __USE_TIME_BITS64 | |||
+# define FMTTIMET __PRI64 | |||
+#else | |||
# define FMTTIMET "l" | |||
+#endif | |||
#endif | |||
LOG(4, "access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n" | |||
"attr: %"FMTTIMET"d/%"FMT64"u\n", |
@ -0,0 +1,10 @@ | |||
--- a/configure.ac | |||
+++ b/configure.ac | |||
@@ -1199,7 +1199,6 @@ AC_C_VOLATILE | |||
### General flags / actions | |||
CFLAGS="$CFLAGS -Wall" | |||
-CFLAGS="$CFLAGS -Werror" | |||
# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' | |||
# in Xlib.h on OpenSolaris. |