0
0
mirror of https://github.com/openwrt/packages.git synced 2025-10-03 05:50:18 +00:00
Files
packages/net/samba4/patches/102-samba-4.11-unbundle-libbsd.patch
John Audia 192ca00bce samba4: bump to 4.22.2
https://www.samba.org/samba/history/samba-4.22.2.html

Removed upstreamed:
  101-do-not-check-xsltproc-manpages.patch
  105-perl-json-pp.patch

Removed due to build failure:
  104-samba-4.12-unbundle-icu.patch

Added:
  104-fix-build-on-aarch64-and-risc.patch[1]

Makefile:
  Removed section on --accel-aes due to upstream dropping support
  Added line to correct fcntl check in cross-answers.txt

1. For aarch64 and risc64, the discard_const macro is used to remove
const qualifiers from string literals, but casting a string literal’s
address to uintptr_t and then to void * is not a constant expression in
some compilers or environments e.g. the musl libc and aarch64/risc64
combination seems to enforce stricter rules for constant initializers
or pointer/integer size handling compared to glibc-based systems.

Build system: x86/64
Build-tested: x86/64
Run-tested: x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
2025-06-18 17:51:32 +03:00

70 lines
3.0 KiB
Diff

--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -441,33 +441,13 @@ def configure(conf):
conf.CHECK_FUNCS('prctl dirname basename')
- strlcpy_in_bsd = False
+ # Not checking for libbsd
+ conf.CHECK_FUNCS('strlcpy strlcat')
+ conf.CHECK_FUNCS('getpeereid')
+ conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
+ conf.CHECK_FUNCS('setproctitle_init')
- # libbsd on some platforms provides strlcpy and strlcat
- if not conf.CHECK_FUNCS('strlcpy strlcat'):
- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
- checklibc=True):
- strlcpy_in_bsd = True
- elif conf.env.enable_fuzzing:
- # Just to complicate it more, some versions of Honggfuzz have
- # got strlcpy and strlcat in libc, but not in <string.h>
- # (unless it is there coincidentally, on a BSD). Therefore we
- # can't use CHECK_FUNCS alone to decide whether to add the
- # headers to replace.h.
- #
- # As this is only known to happen on a fuzzing compiler, we'll
- # skip the check when not in fuzzing mode.
- conf.CHECK_HEADERS('bsd/string.h')
-
- if not conf.CHECK_FUNCS('getpeereid'):
- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
- if not conf.CHECK_FUNCS('setproctitle_init'):
- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
-
- if not conf.CHECK_FUNCS('closefrom'):
- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+ conf.CHECK_FUNCS('closefrom')
conf.CHECK_CODE('''
struct ucred cred;
@@ -850,9 +830,6 @@ syscall(SYS_copy_file_range,0,NULL,0,NUL
# look for a method of finding the list of network interfaces
for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
- bsd_for_strlcpy = ''
- if strlcpy_in_bsd:
- bsd_for_strlcpy = ' bsd'
if conf.CHECK_CODE('''
#define %s 1
#define NO_CONFIG_H 1
@@ -865,7 +842,7 @@ syscall(SYS_copy_file_range,0,NULL,0,NUL
#include "tests/getifaddrs.c"
''' % method,
method,
- lib='nsl socket' + bsd_for_strlcpy,
+ lib='nsl socket',
addmain=False,
execute=True):
break
@@ -913,7 +890,6 @@ def build(bld):
break
extra_libs = ''
- if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt'
if bld.CONFIG_SET('REPLACE_REQUIRES_LIBSOCKET_LIBNSL'): extra_libs += ' socket nsl'