Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xrootd: update to 5.5.1
@ 2023-02-04 16:55 dkwo
  2023-02-06 13:10 ` amadio
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: dkwo @ 2023-02-04 16:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

There is a new pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages O3xr
https://github.com/void-linux/void-packages/pull/42076

xrootd: update to 5.5.1
- I tested the changes in this PR: no
- I built this PR locally for my native architecture, (x86_64-musl)

Builds fine with openssl3 #37681 but note https://github.com/xrootd/xrootd/issues/1877
It performs no tests, so it is hard to tell @BenJarg 

A patch file from https://github.com/void-linux/void-packages/pull/42076.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-O3xr-42076.patch --]
[-- Type: text/x-diff, Size: 1105 bytes --]

From 39714f9489c3078c61af578232ea46a30d4e19b2 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Sat, 4 Feb 2023 11:51:41 -0500
Subject: [PATCH] xrootd: update to 5.5.1

---
 srcpkgs/xrootd/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/xrootd/template b/srcpkgs/xrootd/template
index 2bd0b59714c2..3973741d0e3e 100644
--- a/srcpkgs/xrootd/template
+++ b/srcpkgs/xrootd/template
@@ -1,6 +1,6 @@
 # Template file for 'xrootd'
 pkgname=xrootd
-version=5.4.2
+version=5.5.1
 revision=1
 build_style=cmake
 makedepends="zlib-devel openssl-devel libuuid-devel readline-devel"
@@ -9,7 +9,7 @@ maintainer="Ben Jargowsky <benjar63@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://xrootd.slac.stanford.edu"
 distfiles="http://xrootd.org/download/v${version}/xrootd-${version}.tar.gz"
-checksum=d868ba5d8b71ec38f7a113d2d8f3e25bbcedc1bc23d21bba1686ddfdb2b900c1
+checksum=3556d5afcae20ed9a12c89229d515492f6c6f94f829a3d537f5880fcd2fa77e4
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-lexecinfo"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
@ 2023-02-06 13:10 ` amadio
  2023-02-06 19:27 ` dkwo
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-02-06 13:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1419055643

Comment:
Please wait for 5.5.2 which will be released shortly with a fix for issue 1877 and many others. Cheers.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
  2023-02-06 13:10 ` amadio
@ 2023-02-06 19:27 ` dkwo
  2023-02-14 21:10 ` dkwo
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-02-06 19:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1419630259

Comment:
Thanks! Converting to draft for now.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
  2023-02-06 13:10 ` amadio
  2023-02-06 19:27 ` dkwo
@ 2023-02-14 21:10 ` dkwo
  2023-02-14 21:27 ` [PR PATCH] [Updated] " dkwo
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-02-14 21:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2617 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1430382513

Comment:
@amadio If I try to build 5.5.2 with the present template on `x86_64-musl` (and openssl1.1 series), I encounter the error
```
[492/583] Building CXX object src/CMakeFiles/XrdOssCsi-5.dir/XrdOssCsi/XrdOssCsiFile.cc.o
FAILED: src/CMakeFiles/XrdOssCsi-5.dir/XrdOssCsi/XrdOssCsiFile.cc.o 
/usr/bin/g++ -DHAVE_ATOMICS -DHAVE_CRYPT -DHAVE_DH_PADDED -DHAVE_FSTATAT -DHAVE_GETHBYXR -DHAVE_GETIFADDRS -DHAVE_LIBZ -DHAVE_NAMEINFO -DHAVE_READLINE -DHAVE_SENDFILE -DHAVE_SETRESUID -DHAVE_SHADOWPW -DHAVE_SIGWTI -DHAVE_SSL -DHAVE_STRLCPY -DHAVE_XRDCRYPTO -DXRDPLUGIN_SOVERSION=\"5\" -DXrdOssCsi_5_EXPORTS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/builddir/xrootd-5.5.2/src/.. -I/builddir/xrootd-5.5.2/src/. -I/builddir/xrootd-5.5.2/src -I/builddir/xrootd-5.5.2/build/src -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2    -ffile-prefix-map=/builddir/xrootd-5.5.2/build=. -Wall -Wextra -Wno-unused-parameter -fPIC -std=gnu++14 -MD -MT src/CMakeFiles/XrdOssCsi-5.dir/XrdOssCsi/XrdOssCsiFile.cc.o -MF src/CMakeFiles/XrdOssCsi-5.dir/XrdOssCsi/XrdOssCsiFile.cc.o.d -o src/CMakeFiles/XrdOssCsi-5.dir/XrdOssCsi/XrdOssCsiFile.cc.o -c /builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiFile.cc
In file included from /builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiFile.cc:34:
/builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh: In member function 'int XrdOssCsiTagstoreFile::MarshallAndWriteHeader()':
/builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh:176:46: error: 'bswap_32' was not declared in this scope
  176 |       if (fileIsBige_ != machineIsBige_) y = bswap_32(y);
      |                                              ^~~~~~~~
/builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh:180:46: error: 'bswap_64' was not declared in this scope
  180 |       if (fileIsBige_ != machineIsBige_) x = bswap_64(x);
      |                                              ^~~~~~~~
/builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh:184:46: error: 'bswap_32' was not declared in this scope
  184 |       if (fileIsBige_ != machineIsBige_) y = bswap_32(y);
      |                                              ^~~~~~~~
/builddir/xrootd-5.5.2/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh:188:47: error: 'bswap_32' was not declared in this scope
  188 |       if (machineIsBige_ != fileIsBige_) cv = bswap_32(cv);
      |                                               ^~~~~~~~
```
Do you know how to fix this?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (2 preceding siblings ...)
  2023-02-14 21:10 ` dkwo
@ 2023-02-14 21:27 ` dkwo
  2023-02-14 21:30 ` BenJarg
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-02-14 21:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages O3xr
https://github.com/void-linux/void-packages/pull/42076

xrootd: update to 5.5.1
- I tested the changes in this PR: no
- I built this PR locally for my native architecture, (x86_64-musl)

Builds fine with openssl3 #37681 but note https://github.com/xrootd/xrootd/issues/1877
It performs no tests, so it is hard to tell @BenJarg 

A patch file from https://github.com/void-linux/void-packages/pull/42076.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-O3xr-42076.patch --]
[-- Type: text/x-diff, Size: 2551 bytes --]

From f858072782056d2ce444bccdfe0c7452fb48c4eb Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Sat, 4 Feb 2023 11:51:41 -0500
Subject: [PATCH 1/2] xrootd: update to 5.5.1

---
 srcpkgs/xrootd/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/xrootd/template b/srcpkgs/xrootd/template
index 2bd0b59714c2..3973741d0e3e 100644
--- a/srcpkgs/xrootd/template
+++ b/srcpkgs/xrootd/template
@@ -1,6 +1,6 @@
 # Template file for 'xrootd'
 pkgname=xrootd
-version=5.4.2
+version=5.5.1
 revision=1
 build_style=cmake
 makedepends="zlib-devel openssl-devel libuuid-devel readline-devel"
@@ -9,7 +9,7 @@ maintainer="Ben Jargowsky <benjar63@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://xrootd.slac.stanford.edu"
 distfiles="http://xrootd.org/download/v${version}/xrootd-${version}.tar.gz"
-checksum=d868ba5d8b71ec38f7a113d2d8f3e25bbcedc1bc23d21bba1686ddfdb2b900c1
+checksum=3556d5afcae20ed9a12c89229d515492f6c6f94f829a3d537f5880fcd2fa77e4
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-lexecinfo"

From 815f4fd827b9df0af918b72ccd6ce4d97eede237 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 14 Feb 2023 16:25:45 -0500
Subject: [PATCH 2/2] xrootd: update 5.5.2 (broken)

---
 srcpkgs/xrootd/template | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/xrootd/template b/srcpkgs/xrootd/template
index 3973741d0e3e..fa62e7c908ba 100644
--- a/srcpkgs/xrootd/template
+++ b/srcpkgs/xrootd/template
@@ -1,15 +1,19 @@
 # Template file for 'xrootd'
 pkgname=xrootd
-version=5.5.1
+version=5.5.2
 revision=1
 build_style=cmake
-makedepends="zlib-devel openssl-devel libuuid-devel readline-devel"
+configure_args="-DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release"
+hostmakedepends="pkgconf"
+makedepends="zlib-devel openssl-devel libuuid-devel readline-devel
+ libcurl-devel mit-krb5-devel libxml2-devel tinyxml-devel libcppunit-devel
+ fuse-devel json-c-devel"
 short_desc="Low latency, scalable and fault tolerant access to data"
 maintainer="Ben Jargowsky <benjar63@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://xrootd.slac.stanford.edu"
 distfiles="http://xrootd.org/download/v${version}/xrootd-${version}.tar.gz"
-checksum=3556d5afcae20ed9a12c89229d515492f6c6f94f829a3d537f5880fcd2fa77e4
+checksum=ec4e0490b8ee6a3254a4ea4449342aa364bc95b78dc9a8669151be30353863c6
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-lexecinfo"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (3 preceding siblings ...)
  2023-02-14 21:27 ` [PR PATCH] [Updated] " dkwo
@ 2023-02-14 21:30 ` BenJarg
  2023-02-14 21:31 ` BenJarg
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: BenJarg @ 2023-02-14 21:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

New comment by BenJarg on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1430404894

Comment:
@dkwo That should compile with the more up to date musl patch from xrootd/xrootd#1632, or the reworked PR xrootd/xrootd#1908 (the latter should be preferred, but I haven't tested applying it to 5.5.2 yet)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (4 preceding siblings ...)
  2023-02-14 21:30 ` BenJarg
@ 2023-02-14 21:31 ` BenJarg
  2023-02-14 21:46 ` [PR PATCH] [Updated] " dkwo
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: BenJarg @ 2023-02-14 21:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

New comment by BenJarg on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1430404894

Comment:
@dkwo It should compile with the more up to date musl patch from xrootd/xrootd#1632, or the reworked PR xrootd/xrootd#1908 (the latter should be preferred, but I haven't tested applying it to 5.5.2 yet)

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (5 preceding siblings ...)
  2023-02-14 21:31 ` BenJarg
@ 2023-02-14 21:46 ` dkwo
  2023-02-14 21:47 ` dkwo
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-02-14 21:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages O3xr
https://github.com/void-linux/void-packages/pull/42076

xrootd: update to 5.5.1
- I tested the changes in this PR: no
- I built this PR locally for my native architecture, (x86_64-musl)

Builds fine with openssl3 #37681 but note https://github.com/xrootd/xrootd/issues/1877
It performs no tests, so it is hard to tell @BenJarg 

A patch file from https://github.com/void-linux/void-packages/pull/42076.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-O3xr-42076.patch --]
[-- Type: text/x-diff, Size: 25535 bytes --]

From 91c7031dabb0bd3190b89170092372fee894ea9c Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Sat, 4 Feb 2023 11:51:41 -0500
Subject: [PATCH] xrootd: update to 5.5.2, add musl patch (upstream pr #1908),
 enable tests

---
 srcpkgs/xrootd/patches/musl.patch | 642 +++++++++++++++++++++++-------
 srcpkgs/xrootd/template           |  10 +-
 2 files changed, 503 insertions(+), 149 deletions(-)

diff --git a/srcpkgs/xrootd/patches/musl.patch b/srcpkgs/xrootd/patches/musl.patch
index 7dccd97d6c45..1071a6495ff3 100644
--- a/srcpkgs/xrootd/patches/musl.patch
+++ b/srcpkgs/xrootd/patches/musl.patch
@@ -1,133 +1,144 @@
-diff --git a/src/Xrd/XrdConfig.hh b/src/Xrd/XrdConfig.hh
-index a06ad462f..702403d82 100644
---- a/src/Xrd/XrdConfig.hh
-+++ b/src/Xrd/XrdConfig.hh
-@@ -34,6 +34,11 @@
- #include "Xrd/XrdProtLoad.hh"
- #include "Xrd/XrdProtocol.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_mode_t
-+#include <bits/alltypes.h>
-+#endif
+From 154d6eac0045c77e1225b21da6273fa54d177374 Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 16:48:58 +0100
+Subject: [PATCH 1/9] [CMake] Add check for musl libc
+
+Out of principle musl libc provides no means for detecting it, leaving
+developers to figure it out for themselves. The choice here is to use
+the compiler to print the target triple, which contains the libc
+implementation as the last part. On Voidlinux it's x86_64-linux-musl,
+and on Alpine it's x86_64-alpine-linux-musl. This should be reliable
+enough to not wrongly detect other libc implementations as musl (and
+failure to detect will only affect platforms based on musl as well).
+
+See https://wiki.musl-libc.org/faq.html for more information.
+---
+ cmake/XRootDOSDefs.cmake | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/cmake/XRootDOSDefs.cmake b/cmake/XRootDOSDefs.cmake
+index 8b182e61ea1..9f7c9aa5940 100644
+--- a/cmake/XRootDOSDefs.cmake
++++ b/cmake/XRootDOSDefs.cmake
+@@ -70,6 +70,21 @@ if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
+   set( LINUX TRUE )
+   include( GNUInstallDirs )
+   set( EXTRA_LIBS rt )
 +
- class XrdSysError;
- class XrdTcpMonInfo;
- class XrdNetSecurity;
-diff --git a/src/XrdAcc/XrdAccGroups.cc b/src/XrdAcc/XrdAccGroups.cc
-index e663fdd35..14c3b19d6 100644
---- a/src/XrdAcc/XrdAccGroups.cc
-+++ b/src/XrdAcc/XrdAccGroups.cc
-@@ -46,6 +46,14 @@
- #include "XrdAcc/XrdAccGroups.hh"
- #include "XrdAcc/XrdAccPrivs.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+int innetgr(const char *netgroup, const char *host, const char *user,
-+             const char *domain)
-+{
-+   return 0;
-+}
-+#endif
++  # Check for musl libc with the compiler, since it provides way to detect it
++  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
++    OUTPUT_VARIABLE TARGET_TRIPLE ERROR_VARIABLE TARGET_ERROR)
 +
- // Additionally, this routine does not support a user in more than
- // NGROUPS_MAX groups. This is a standard unix limit defined in limits.h.
-   
-diff --git a/src/XrdCl/XrdClFileStateHandler.hh b/src/XrdCl/XrdClFileStateHandler.hh
-index 9f9d8b91f..5ff49cbbc 100644
---- a/src/XrdCl/XrdClFileStateHandler.hh
-+++ b/src/XrdCl/XrdClFileStateHandler.hh
-@@ -42,6 +42,12 @@
- #include <sys/uio.h>
- #include <cstdint>
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_suseconds_t
-+#define __NEED_struct_timeval
-+#include <bits/alltypes.h>
-+#endif
++  if (NOT TARGET_ERROR)
++    if ("${TARGET_TRIPLE}" MATCHES "musl")
++      message(STATUS "Detected musl libc")
++      add_definitions(-DMUSL=1)
++    endif()
++  else()
++    message(WARNING "Could not detect system information!")
++  endif()
 +
- namespace
- {
-   class PgReadHandler;
-diff --git a/src/XrdCl/XrdClMonitor.hh b/src/XrdCl/XrdClMonitor.hh
-index 2fc753777..d22c3c275 100644
---- a/src/XrdCl/XrdClMonitor.hh
-+++ b/src/XrdCl/XrdClMonitor.hh
-@@ -43,6 +43,12 @@
++  unset(TARGET_ERROR)
+ endif()
  
- #include "XrdCl/XrdClFileSystem.hh"
+ #-------------------------------------------------------------------------------
+
+From 41b7fe772c4e55928bbc6d1bc3c5d90ca43947dc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
+Date: Sat, 23 Jul 2022 21:37:47 +0200
+Subject: [PATCH 2/9] Use standard poll.h, errno.h in place of sys/*.h
+
+---
+ src/Xrd/XrdPoll.hh            | 2 +-
+ src/XrdNet/XrdNetMsg.cc       | 2 +-
+ src/XrdOfs/XrdOfsHandle.cc    | 2 +-
+ src/XrdTls/XrdTlsTempCA.cc    | 2 +-
+ src/XrdVoms/XrdVomsMapfile.cc | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/Xrd/XrdPoll.hh b/src/Xrd/XrdPoll.hh
+index 3790b03b080..d9bda5d6277 100644
+--- a/src/Xrd/XrdPoll.hh
++++ b/src/Xrd/XrdPoll.hh
+@@ -29,7 +29,7 @@
+ /* specific prior written permission of the institution or contributor.       */
+ /******************************************************************************/
  
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_suseconds_t
-+#define __NEED_struct_timeval
-+#include <bits/alltypes.h>
-+#endif
-+
- namespace XrdCl
- {
-   class URL;
-diff --git a/src/XrdNet/XrdNetSecurity.cc b/src/XrdNet/XrdNetSecurity.cc
-index 0f8451127..e39b1ef4b 100644
---- a/src/XrdNet/XrdNetSecurity.cc
-+++ b/src/XrdNet/XrdNetSecurity.cc
-@@ -40,12 +40,14 @@
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "XrdSys/XrdSysPthread.hh"
+ 
+ #define XRD_NUMPOLLERS 3
+diff --git a/src/XrdNet/XrdNetMsg.cc b/src/XrdNet/XrdNetMsg.cc
+index fa6c16f872a..f97e1af0996 100644
+--- a/src/XrdNet/XrdNetMsg.cc
++++ b/src/XrdNet/XrdNetMsg.cc
+@@ -29,7 +29,7 @@
+ /******************************************************************************/
+ 
+ #include <cerrno>
+-#include <sys/poll.h>
++#include <poll.h>
+ 
+ #include "XrdNet/XrdNet.hh"
+ #include "XrdNet/XrdNetMsg.hh"
+diff --git a/src/XrdOfs/XrdOfsHandle.cc b/src/XrdOfs/XrdOfsHandle.cc
+index 963f17a5a6a..26b40ce0887 100644
+--- a/src/XrdOfs/XrdOfsHandle.cc
++++ b/src/XrdOfs/XrdOfsHandle.cc
+@@ -30,7 +30,7 @@
+ 
+ #include <cstdio>
+ #include <ctime>
+-#include <sys/errno.h>
++#include <errno.h>
  #include <sys/types.h>
- #include <Winsock2.h>
- #include <io.h>
-+#include "XrdSys/XrdWin32.hh"
-+#endif
-+#if WIN32 || defined(__linux__) && !defined(__GLIBC__)
- int innetgr(const char *netgroup, const char *host, const char *user,
-              const char *domain)
- {
-    return 0;
- }
--#include "XrdSys/XrdWin32.hh"
- #endif
  
- #include "XrdNet/XrdNetAddr.hh"
-diff --git a/src/XrdPosix/XrdPosix.cc b/src/XrdPosix/XrdPosix.cc
-index 0f32dc2ee..b6dea957f 100644
---- a/src/XrdPosix/XrdPosix.cc
-+++ b/src/XrdPosix/XrdPosix.cc
-@@ -37,6 +37,9 @@
+ #include "XrdOfs/XrdOfsHandle.hh"
+diff --git a/src/XrdTls/XrdTlsTempCA.cc b/src/XrdTls/XrdTlsTempCA.cc
+index faf69785ffc..37431dee9f3 100644
+--- a/src/XrdTls/XrdTlsTempCA.cc
++++ b/src/XrdTls/XrdTlsTempCA.cc
+@@ -30,7 +30,7 @@
+ #include <cstdlib>
  #include <fcntl.h>
- #include <unistd.h>
- #include <sys/uio.h>
-+#if defined(__linux__) && !defined(_IO_ERR_SEEN)
-+#include <stdio_ext.h>
-+#endif
+ #include <dirent.h>
+-#include <sys/poll.h>
++#include <poll.h>
  
- #include "XrdSys/XrdSysHeaders.hh"
- #include "XrdPosix/XrdPosixLinkage.hh"
-@@ -311,8 +314,12 @@ size_t XrdPosix_Fread(void *ptr, size_t size, size_t nitems, FILE *stream)
-         if (bytes > 0 && size) rc = bytes/size;
- #ifndef SUNX86
- #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
-+#ifdef _IO_ERR_SEEN
-    else if (bytes < 0) stream->_flags |= _IO_ERR_SEEN;
-    else                stream->_flags |= _IO_EOF_SEEN;
-+#else
-+   else if (bytes < 0) __fseterr(stream);
-+#endif
- #elif defined(__APPLE__) || defined(__FreeBSD__)
-    else if (bytes < 0) stream->_flags |= __SEOF;
-    else                stream->_flags |= __SERR;
-@@ -482,7 +489,11 @@ size_t XrdPosix_Fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream
-    if (bytes > 0 && size) rc = bytes/size;
- #ifndef SUNX86
- #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
-+#ifdef _IO_ERR_SEEN
-       else stream->_flags |= _IO_ERR_SEEN;
-+#else
-+      else  __fseterr(stream);
-+#endif
- #elif defined(__APPLE__) || defined(__FreeBSD__)
-       else stream->_flags |= __SERR;
- #else
+ #include <unordered_set>
+ #include <memory>
+diff --git a/src/XrdVoms/XrdVomsMapfile.cc b/src/XrdVoms/XrdVomsMapfile.cc
+index 8ffbe921875..fddbfdc06fb 100644
+--- a/src/XrdVoms/XrdVomsMapfile.cc
++++ b/src/XrdVoms/XrdVomsMapfile.cc
+@@ -40,7 +40,7 @@
+ #include <vector>
+ #include <string>
+ #include <fcntl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ 
+ bool XrdVomsMapfile::tried_configure = false;
+ std::unique_ptr<XrdVomsMapfile> XrdVomsMapfile::mapper;
+
+From 29b96ccb34d628daa9d3caac538700909f284061 Mon Sep 17 00:00:00 2001
+From: Ben Jargowsky <benjar63@gmail.com>
+Date: Tue, 14 Feb 2023 17:02:09 +0100
+Subject: [PATCH 3/9] Add (partial) support for musl libc
+
+Based on work from pull request #1632.
+
+Co-authored-by: Guilherme Amadio <amadio@cern.ch>
+---
+ src/XrdPosix/XrdPosixLinkage.hh |  1 +
+ src/XrdPosix/XrdPosixPreload.cc | 16 ++++++++++++++++
+ src/XrdSys/XrdSysPlatform.hh    | 10 +---------
+ src/XrdSys/XrdSysPthread.hh     |  4 ++--
+ 4 files changed, 20 insertions(+), 11 deletions(-)
+
 diff --git a/src/XrdPosix/XrdPosixLinkage.hh b/src/XrdPosix/XrdPosixLinkage.hh
-index 903153252..b5cc6d4b4 100644
+index 9031532524c..b5cc6d4b469 100644
 --- a/src/XrdPosix/XrdPosixLinkage.hh
 +++ b/src/XrdPosix/XrdPosixLinkage.hh
 @@ -40,6 +40,7 @@
@@ -138,31 +149,16 @@ index 903153252..b5cc6d4b4 100644
  #include "XrdSys/XrdSysPlatform.hh"
  
  /******************************************************************************/
-diff --git a/src/XrdPosix/XrdPosixMap.hh b/src/XrdPosix/XrdPosixMap.hh
-index ac2da483a..a15602787 100644
---- a/src/XrdPosix/XrdPosixMap.hh
-+++ b/src/XrdPosix/XrdPosixMap.hh
-@@ -36,6 +36,11 @@
- #include "XrdCl/XrdClFileSystem.hh"
- #include "XrdCl/XrdClXRootDResponses.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_dev_t
-+#include <bits/alltypes.h>
-+#endif
-+
- class XrdPosixMap
- {
- public:
 diff --git a/src/XrdPosix/XrdPosixPreload.cc b/src/XrdPosix/XrdPosixPreload.cc
-index 867b73479..d967c53b3 100644
+index 867b7347985..e01bc8a2301 100644
 --- a/src/XrdPosix/XrdPosixPreload.cc
 +++ b/src/XrdPosix/XrdPosixPreload.cc
-@@ -42,6 +42,22 @@
+@@ -41,6 +41,22 @@
+ /******************************************************************************/
  
  #include "XrdPosix/XrdPosixExtern.hh"
-  
-+#ifdef creat64
++
++#ifdef MUSL
 +#undef creat64
 +#undef fseeko64
 +#undef ftello64
@@ -177,12 +173,11 @@ index 867b73479..d967c53b3 100644
 +#undef statvfs64
 +#undef truncate64
 +#endif
-+
+  
  /******************************************************************************/
  /*                   G l o b a l   D e c l a r a t i o n s                    */
- /******************************************************************************/
 diff --git a/src/XrdSys/XrdSysPlatform.hh b/src/XrdSys/XrdSysPlatform.hh
-index a1ac544ad..eaeaeabac 100644
+index a1ac544ad93..eaeaeabac58 100644
 --- a/src/XrdSys/XrdSysPlatform.hh
 +++ b/src/XrdSys/XrdSysPlatform.hh
 @@ -241,16 +241,8 @@ extern "C"
@@ -204,7 +199,7 @@ index a1ac544ad..eaeaeabac 100644
  
  #ifdef _LP64
 diff --git a/src/XrdSys/XrdSysPthread.hh b/src/XrdSys/XrdSysPthread.hh
-index 17f8fd0be..78741a7dc 100644
+index 17f8fd0bec8..185ad311014 100644
 --- a/src/XrdSys/XrdSysPthread.hh
 +++ b/src/XrdSys/XrdSysPthread.hh
 @@ -351,7 +351,7 @@ enum PrefType {prefWR=1};
@@ -212,7 +207,7 @@ index 17f8fd0be..78741a7dc 100644
          XrdSysRWLock(PrefType ptype)
                      {
 -#ifdef __linux__
-+#ifdef __GLIBC__
++#if defined(__linux__) && !defined(MUSL)
                       pthread_rwlockattr_t attr;
                       pthread_rwlockattr_setkind_np(&attr,
                               PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
@@ -221,7 +216,362 @@ index 17f8fd0be..78741a7dc 100644
  {
    pthread_rwlock_destroy(&lock);
 -#ifdef __linux__
-+#ifdef __GLIBC__
++#if defined(__linux__) && !defined(MUSL)
    pthread_rwlockattr_t attr;
    pthread_rwlockattr_setkind_np(&attr,
                       PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+
+From 279c5ae3902e1fd94c0e784b85e4c3909bb0afcf Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 13:12:19 +0100
+Subject: [PATCH 4/9] Provide dummy implementation of innetgr() when compiling
+ with musl
+
+---
+ src/XrdAcc/XrdAccGroups.cc   |  8 ++++++++
+ src/XrdNet/XrdNetSecurity.cc | 13 ++++++++-----
+ 2 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/src/XrdAcc/XrdAccGroups.cc b/src/XrdAcc/XrdAccGroups.cc
+index e663fdd35aa..94b8edbc75e 100644
+--- a/src/XrdAcc/XrdAccGroups.cc
++++ b/src/XrdAcc/XrdAccGroups.cc
+@@ -46,6 +46,14 @@
+ #include "XrdAcc/XrdAccGroups.hh"
+ #include "XrdAcc/XrdAccPrivs.hh"
+ 
++#ifdef MUSL
++int innetgr(const char *netgroup, const char *host, const char *user,
++             const char *domain)
++{
++   return 0;
++}
++#endif
++
+ // Additionally, this routine does not support a user in more than
+ // NGROUPS_MAX groups. This is a standard unix limit defined in limits.h.
+   
+diff --git a/src/XrdNet/XrdNetSecurity.cc b/src/XrdNet/XrdNetSecurity.cc
+index 0f8451127ce..0faf563dd2e 100644
+--- a/src/XrdNet/XrdNetSecurity.cc
++++ b/src/XrdNet/XrdNetSecurity.cc
+@@ -40,11 +40,6 @@
+ #include <sys/types.h>
+ #include <Winsock2.h>
+ #include <io.h>
+-int innetgr(const char *netgroup, const char *host, const char *user,
+-             const char *domain)
+-{
+-   return 0;
+-}
+ #include "XrdSys/XrdWin32.hh"
+ #endif
+ 
+@@ -53,6 +48,14 @@ int innetgr(const char *netgroup, const char *host, const char *user,
+ #include "XrdNet/XrdNetUtils.hh"
+ #include "XrdSys/XrdSysTrace.hh"
+ 
++#if defined(MUSL) || defined(WIN32)
++int innetgr(const char *netgroup, const char *host, const char *user,
++             const char *domain)
++{
++   return 0;
++}
++#endif
++
+ /******************************************************************************/
+ /*                         L o c a l   C l a s s e s                          */
+ /******************************************************************************/
+
+From 5e7adb0de32a1395955469e7ac2eef39aae072f4 Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 17:12:11 +0100
+Subject: [PATCH 5/9] [XrdOssCsi] Include byteswap.h everywhere except on macOS
+
+---
+ src/XrdOssCsi/XrdOssCsiTagstoreFile.hh | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh b/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
+index b1a94acd668..0202579ccb4 100644
+--- a/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
++++ b/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
+@@ -38,9 +38,7 @@
+ #include <memory>
+ #include <mutex>
+ 
+-#if defined(__GLIBC__) || defined(__BIONIC__) || defined(__CYGWIN__)
+-#include <byteswap.h>
+-#elif defined(__APPLE__)
++#if defined(__APPLE__)
+ // Make sure that byte swap functions are not already defined.
+ #if !defined(bswap_16)
+ // Mac OS X / Darwin features
+@@ -49,6 +47,8 @@
+ #define bswap_32(x) OSSwapInt32(x)
+ #define bswap_64(x) OSSwapInt64(x)
+ #endif
++#else
++#include <byteswap.h>
+ #endif
+ 
+ class XrdOssCsiTagstoreFile : public XrdOssCsiTagstore
+
+From 2b0ed5fe4b264c3ab63f4b170d8398242fa6808f Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 17:16:03 +0100
+Subject: [PATCH 6/9] Include missing sys/types.h where needed to support musl
+
+---
+ src/Xrd/XrdConfig.hh         | 2 ++
+ src/XrdPosix/XrdPosixFile.hh | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/src/Xrd/XrdConfig.hh b/src/Xrd/XrdConfig.hh
+index a06ad462f4e..2d1403a5e10 100644
+--- a/src/Xrd/XrdConfig.hh
++++ b/src/Xrd/XrdConfig.hh
+@@ -34,6 +34,8 @@
+ #include "Xrd/XrdProtLoad.hh"
+ #include "Xrd/XrdProtocol.hh"
+ 
++#include <sys/types.h>
++
+ class XrdSysError;
+ class XrdTcpMonInfo;
+ class XrdNetSecurity;
+diff --git a/src/XrdPosix/XrdPosixFile.hh b/src/XrdPosix/XrdPosixFile.hh
+index e5cc6b1bda5..4ca9679f233 100644
+--- a/src/XrdPosix/XrdPosixFile.hh
++++ b/src/XrdPosix/XrdPosixFile.hh
+@@ -35,6 +35,7 @@
+ #include <sys/time.h>
+ #include <sys/param.h>
+ #include <sys/resource.h>
++#include <sys/types.h>
+ #include <sys/uio.h>
+ 
+ #include "XrdCl/XrdClFileSystem.hh"
+
+From 8364c6802c2151c6711eea51e079e9855c5c15c3 Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 17:16:24 +0100
+Subject: [PATCH 7/9] Include missing sys/time.h where needed to support musl
+
+---
+ src/XrdCl/XrdClFileStateHandler.hh | 1 +
+ src/XrdCl/XrdClMonitor.hh          | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/src/XrdCl/XrdClFileStateHandler.hh b/src/XrdCl/XrdClFileStateHandler.hh
+index 197151321f8..f8353881950 100644
+--- a/src/XrdCl/XrdClFileStateHandler.hh
++++ b/src/XrdCl/XrdClFileStateHandler.hh
+@@ -39,6 +39,7 @@
+ #include <set>
+ #include <vector>
+ 
++#include <sys/time.h>
+ #include <sys/uio.h>
+ #include <cstdint>
+ 
+diff --git a/src/XrdCl/XrdClMonitor.hh b/src/XrdCl/XrdClMonitor.hh
+index 2fc7537776a..2b3a96c46fa 100644
+--- a/src/XrdCl/XrdClMonitor.hh
++++ b/src/XrdCl/XrdClMonitor.hh
+@@ -43,6 +43,8 @@
+ 
+ #include "XrdCl/XrdClFileSystem.hh"
+ 
++#include <sys/time.h>
++
+ namespace XrdCl
+ {
+   class URL;
+
+From d7667f94d14e3a38fd5094f952695be529793f46 Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 11:08:00 +0100
+Subject: [PATCH 8/9] [XrdOuc] Adapt XrdOucBackTrace.cc to support musl
+
+The header execinfo.h is not available on musl, so the #ifdefs
+needed to be adjusted accordingly. This header is available on
+macOS, and with both glibc and uclibc on Linux, though.
+---
+ src/XrdOuc/XrdOucBackTrace.cc | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/src/XrdOuc/XrdOucBackTrace.cc b/src/XrdOuc/XrdOucBackTrace.cc
+index 813183c3228..c61a89b633d 100644
+--- a/src/XrdOuc/XrdOucBackTrace.cc
++++ b/src/XrdOuc/XrdOucBackTrace.cc
+@@ -34,7 +34,7 @@
+ #include <vector>
+ #include <sys/syscall.h>
+ 
+-#ifdef __GNUC__
++#ifndef MUSL /* glibc, uclibc, and macOS all have execinfo.h */
+ #include <execinfo.h>
+ #include <cxxabi.h>
+ #endif
+@@ -176,13 +176,11 @@ XrdInfo *CvtRsp(const char *name, int snum)
+ /*                              D e m a n g l e                               */
+ /******************************************************************************/
+   
++#ifndef MUSL
+ namespace
+ {
+ int Demangle(char *cSym, char *buff, int blen)
+ {
+-#ifndef __GNUC__
+-   return -1;
+-#else
+    int   status;
+    char *plus = index(cSym, '+');
+    char *brak = (plus ? index(plus, '[') : 0);
+@@ -201,7 +199,6 @@ int Demangle(char *cSym, char *buff, int blen)
+    status = snprintf(buff, blen, "%s %s+%s\n", brak, realname, plus+1);
+    free(realname);
+    return status;
+-#endif
+ }
+ }
+ 
+@@ -221,6 +218,7 @@ int DumpDepth()
+    return (depth <= maxDepth ? depth : maxDepth);
+ }
+ }
++#endif
+ 
+ /******************************************************************************/
+ /*                             D u m p S t a c k                              */
+@@ -230,8 +228,8 @@ namespace
+ {
+ void DumpStack(char *bP, int bL, TidType tid)
+ {
+-#ifndef __GNUC__
+-   snprintf(bP, bL, "TBT " TidFmt " No stack information available, not gnuc.", tid);
++#ifdef MUSL
++   snprintf(bP, bL, "TBT " TidFmt " No stack information available with musl libc.", tid);
+    return;
+ #else
+    static int btDepth = DumpDepth(); // One time MT-safe call
+
+From 4e7ad13df203427cff73e192df4e984e0c954e5b Mon Sep 17 00:00:00 2001
+From: Guilherme Amadio <amadio@cern.ch>
+Date: Tue, 14 Feb 2023 17:35:56 +0100
+Subject: [PATCH 9/9] [XrdPosix] Add utility functions fseterr/fseteof with
+ musl support
+
+---
+ src/XrdPosix/XrdPosix.cc | 80 ++++++++++++++++++++++++++++------------
+ 1 file changed, 57 insertions(+), 23 deletions(-)
+
+diff --git a/src/XrdPosix/XrdPosix.cc b/src/XrdPosix/XrdPosix.cc
+index 0f32dc2eed5..e4f020c09bf 100644
+--- a/src/XrdPosix/XrdPosix.cc
++++ b/src/XrdPosix/XrdPosix.cc
+@@ -53,6 +53,58 @@
+   
+ extern XrdPosixLinkage   Xunix;
+ 
++/******************************************************************************/
++/*                      U t i l i t y  F u n c t i o n s                      */
++/******************************************************************************/
++
++#ifdef MUSL
++#include <stdio_ext.h>
++#endif
++
++static inline void fseterr(FILE *fp)
++{
++  /* Most systems provide FILE as a struct and the necessary bitmask in
++     <stdio.h>, because they need it for implementing getc() and putc() as
++     fast macros. This function is based on gnulib's fseterr.c */
++#if defined _IO_ERR_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
++  /* GNU libc, BeOS, Haiku, Linux libc5 */
++  fp->_flags |= _IO_ERR_SEEN;
++#elif defined __sferror || defined __APPLE__ || defined __DragonFly__ || defined __ANDROID__
++  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
++  fp->_flags |= __SERR;
++#elif defined _IOERR
++  /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
++  fp->_flag |= _IOERR;
++#elif defined __UCLIBC__            /* uClibc */
++  fp->__modeflags |= __FLAG_ERROR;
++#elif defined MUSL /* musl libc */
++  __fseterr(fp);
++#else
++ #error "Unsupported platform! Please report it as a bug."
++#endif
++}
++
++static inline void fseteof(FILE *fp)
++{
++  /* Most systems provide FILE as a struct and the necessary bitmask in
++     <stdio.h>, because they need it for implementing getc() and putc() as
++     fast macros.  */
++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
++  /* GNU libc, BeOS, Haiku, Linux libc5 */
++  fp->_flags |= _IO_EOF_SEEN;
++#elif defined __sferror || defined __APPLE__ || defined __DragonFly__ || defined __ANDROID__
++  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
++  fp->_flags |= __SEOF;
++#elif defined _IOEOF
++  /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
++  fp->_flag |= _IOEOF;
++#elif defined __UCLIBC__            /* uClibc */
++  fp->__modeflags |= __FLAG_EOF;
++#else
++  (void) fseek(fp, 0L, SEEK_END);
++#endif
++}
++
+ /******************************************************************************/
+ /*                       X r d P o s i x _ A c c e s s                        */
+ /******************************************************************************/
+@@ -308,19 +360,9 @@ size_t XrdPosix_Fread(void *ptr, size_t size, size_t nitems, FILE *stream)
+ 
+ // Get the right return code. Note that we cannot emulate the flags in sunx86
+ //
+-        if (bytes > 0 && size) rc = bytes/size;
+-#ifndef SUNX86
+-#if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
+-   else if (bytes < 0) stream->_flags |= _IO_ERR_SEEN;
+-   else                stream->_flags |= _IO_EOF_SEEN;
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
+-   else if (bytes < 0) stream->_flags |= __SEOF;
+-   else                stream->_flags |= __SERR;
+-#else
+-   else if (bytes < 0) stream->_flag  |= _IOERR;
+-   else                stream->_flag  |= _IOEOF;
+-#endif
+-#endif
++   if (bytes > 0 && size) rc = bytes/size;
++   else if (bytes < 0) fseterr(stream);
++   else                fseteof(stream);
+ 
+    return rc;
+ }
+@@ -477,18 +519,10 @@ size_t XrdPosix_Fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream
+ 
+    bytes = Xroot.Write(fd, ptr, size*nitems);
+ 
+-// Get the right return code. Note that we cannot emulate the flags in sunx86
++// Get the right return code.
+ //
+    if (bytes > 0 && size) rc = bytes/size;
+-#ifndef SUNX86
+-#if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
+-      else stream->_flags |= _IO_ERR_SEEN;
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
+-      else stream->_flags |= __SERR;
+-#else
+-      else stream->_flag  |= _IOERR;
+-#endif
+-#endif
++   else fseterr(stream);
+ 
+    return rc;
+ }
+
diff --git a/srcpkgs/xrootd/template b/srcpkgs/xrootd/template
index 2bd0b59714c2..fa62e7c908ba 100644
--- a/srcpkgs/xrootd/template
+++ b/srcpkgs/xrootd/template
@@ -1,15 +1,19 @@
 # Template file for 'xrootd'
 pkgname=xrootd
-version=5.4.2
+version=5.5.2
 revision=1
 build_style=cmake
-makedepends="zlib-devel openssl-devel libuuid-devel readline-devel"
+configure_args="-DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release"
+hostmakedepends="pkgconf"
+makedepends="zlib-devel openssl-devel libuuid-devel readline-devel
+ libcurl-devel mit-krb5-devel libxml2-devel tinyxml-devel libcppunit-devel
+ fuse-devel json-c-devel"
 short_desc="Low latency, scalable and fault tolerant access to data"
 maintainer="Ben Jargowsky <benjar63@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://xrootd.slac.stanford.edu"
 distfiles="http://xrootd.org/download/v${version}/xrootd-${version}.tar.gz"
-checksum=d868ba5d8b71ec38f7a113d2d8f3e25bbcedc1bc23d21bba1686ddfdb2b900c1
+checksum=ec4e0490b8ee6a3254a4ea4449342aa364bc95b78dc9a8669151be30353863c6
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-lexecinfo"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (6 preceding siblings ...)
  2023-02-14 21:46 ` [PR PATCH] [Updated] " dkwo
@ 2023-02-14 21:47 ` dkwo
  2023-02-15  9:19 ` amadio
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-02-14 21:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1430420263

Comment:
@BenJarg Thanks a lot. Can you give it a try when you have time? I also tried to enable tests, but it just says
```
=> xrootd-5.5.2_1: running do_check ...
[0/1] Running tests...
Test project /builddir/xrootd-5.5.2/build
No tests were found!!!
```

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (7 preceding siblings ...)
  2023-02-14 21:47 ` dkwo
@ 2023-02-15  9:19 ` amadio
  2023-03-02 22:43 ` dkwo
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-02-15  9:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1430997539

Comment:
Running the tests requires setting up multiple containers then launching the test executables to run against them. I hope this year I will convert as many tests as possible to run with a simple call to `ctest`, but for now, we run most tests outside the CI environment (some tests are run in CI, see the GitHub actions on how to run them).

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (8 preceding siblings ...)
  2023-02-15  9:19 ` amadio
@ 2023-03-02 22:43 ` dkwo
  2023-03-03  8:03 ` amadio
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-03-02 22:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2949 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1452664779

Comment:
I tried building 5.5.3, assuming it includes the musl patch, but it fails at
```
[6/617] Building CXX object src/CMakeFiles/XrdUtils.dir/XrdSys/XrdSysE2T.cc.o
FAILED: src/CMakeFiles/XrdUtils.dir/XrdSys/XrdSysE2T.cc.o 
/usr/bin/g++ -DHAVE_ATOMICS -DHAVE_CRYPT -DHAVE_CURL_MULTI_WAIT -DHAVE_DH_PADDED -DHAVE_ET_COM_ERR_H -DHAVE_FSTATAT -DHAVE_FUSE -DHAVE_GETHBYXR -DHAVE_GETIFADDRS -DHAVE_LIBZ -DHAVE_NAMEINFO -DHAVE_READLINE -DHAVE_SENDFILE -DHAVE_SETRESUID -DHAVE_SHADOWPW -DHAVE_SIGWTI -DHAVE_SSL -DHAVE_STRLCPY -DHAVE_XML2 -DHAVE_XRDCRYPTO -DXRDPLUGIN_SOVERSION=\"5\" -DXrdUtils_EXPORTS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/builddir/xrootd-5.5.3/src/.. -I/builddir/xrootd-5.5.3/src/. -I/usr/include/uuid -I/builddir/xrootd-5.5.3/src -I/builddir/xrootd-5.5.3/build/src -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2    -ffile-prefix-map=/builddir/xrootd-5.5.3/build=. -Wall -Wextra -Wno-unused-parameter -O3 -DNDEBUG -fPIC -std=gnu++14 -MD -MT src/CMakeFiles/XrdUtils.dir/XrdSys/XrdSysE2T.cc.o -MF src/CMakeFiles/XrdUtils.dir/XrdSys/XrdSysE2T.cc.o.d -o src/CMakeFiles/XrdUtils.dir/XrdSys/XrdSysE2T.cc.o -c /builddir/xrootd-5.5.3/src/XrdSys/XrdSysE2T.cc
In file included from /builddir/xrootd-5.5.3/src/XrdSys/XrdSysE2T.cc:35:
/builddir/xrootd-5.5.3/src/./XrdSys/XrdSysPthread.hh: In constructor 'XrdSysRWLock::XrdSysRWLock(PrefType)':
/builddir/xrootd-5.5.3/src/./XrdSys/XrdSysPthread.hh:357:30: error: 'PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP' was not declared in this scope
  357 |                              PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/xrootd-5.5.3/src/./XrdSys/XrdSysPthread.hh:356:22: error: 'pthread_rwlockattr_setkind_np' was not declared in this scope; did you mean 'pthread_rwlockattr_setpshared'?
  356 |                      pthread_rwlockattr_setkind_np(&attr,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      pthread_rwlockattr_setpshared
/builddir/xrootd-5.5.3/src/./XrdSys/XrdSysPthread.hh: In member function 'void XrdSysRWLock::ReInitialize(PrefType)':
/builddir/xrootd-5.5.3/src/./XrdSys/XrdSysPthread.hh:373:22: error: 'PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP' was not declared in this scope
  373 |                      PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/xrootd-5.5.3/src/./XrdSys/XrdSysPthread.hh:372:3: error: 'pthread_rwlockattr_setkind_np' was not declared in this scope; did you mean 'pthread_rwlockattr_setpshared'?
  372 |   pthread_rwlockattr_setkind_np(&attr,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   pthread_rwlockattr_setpshared
```

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update to 5.5.1
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (9 preceding siblings ...)
  2023-03-02 22:43 ` dkwo
@ 2023-03-03  8:03 ` amadio
  2023-05-15 15:01 ` xrootd: update dkwo
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-03-03  8:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1453128239

Comment:
Sorry, the musl patches will be part of the 5.6 release, which should come out sometime this month.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (10 preceding siblings ...)
  2023-03-03  8:03 ` amadio
@ 2023-05-15 15:01 ` dkwo
  2023-05-16  6:09 ` amadio
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-05-15 15:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1548036155

Comment:
@amadio Could you please ping me here, after the musl-compatible release is out?

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (11 preceding siblings ...)
  2023-05-15 15:01 ` xrootd: update dkwo
@ 2023-05-16  6:09 ` amadio
  2023-05-16  6:10 ` amadio
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-16  6:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1549048390

Comment:
Sure, no problem. The next feature release will be in June. The patches should apply cleanly to 5.5.5 if you'd like to add that, I can create a sinlge patch file for you to apply to it. Just let me know.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (12 preceding siblings ...)
  2023-05-16  6:09 ` amadio
@ 2023-05-16  6:10 ` amadio
  2023-05-16 14:44 ` dkwo
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-16  6:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1549048390

Comment:
Sure, no problem. The next feature release will be in June. The patches should apply cleanly to 5.5.5. If you'd like to add that, I can create a sinlge patch file for you to apply to it. Just let me know.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (13 preceding siblings ...)
  2023-05-16  6:10 ` amadio
@ 2023-05-16 14:44 ` dkwo
  2023-05-23  8:01 ` amadio
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-05-16 14:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1549818335

Comment:
@amadio Thanks! Sure, if you can create a patch, I'll experiment with that in the meantime.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (14 preceding siblings ...)
  2023-05-16 14:44 ` dkwo
@ 2023-05-23  8:01 ` amadio
  2023-05-23 11:31 ` dkwo
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-23  8:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1558740918

Comment:
Sorry for the delay. I am attaching here the patch: 
[musl.patch.gz](https://github.com/void-linux/void-packages/files/11541047/musl.patch.gz)

I had to use gzip on it, otherwise GitHub says `.patch` file type is not supported.
Let me know if this is enough. XRootD 5.6 is coming next month and will already contain this patch, along with many other improvements. Cheers,

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (15 preceding siblings ...)
  2023-05-23  8:01 ` amadio
@ 2023-05-23 11:31 ` dkwo
  2023-05-23 12:03 ` amadio
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-05-23 11:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1559110556

Comment:
@amadio Thank you. I'm now getting this failure using 5.5.5 and the patch:
```
[92/622] Building CXX object src/CMakeFiles/XrdUtils.dir/XrdNet/XrdNetSecurity.cc.o
FAILED: src/CMakeFiles/XrdUtils.dir/XrdNet/XrdNetSecurity.cc.o 
/usr/bin/g++ -DHAVE_ATOMICS -DHAVE_CRYPT -DHAVE_CURL_MULTI_WAIT -DHAVE_DH_PADDED -DHAVE_ET_COM_ERR_H -DHAVE_FSTATAT -DHAVE_FUSE -DHAVE_GETHBYXR -DHAVE_GETIFADDRS -DHAVE_LIBZ -DHAVE_NAMEINFO -DHAVE_READLINE -DHAVE_SENDFILE -DHAVE_SETRESUID -DHAVE_SHADOWPW -DHAVE_SIGWTI -DHAVE_SSL -DHAVE_STRLCPY -DHAVE_XML2 -DHAVE_XRDCRYPTO -DXRDPLUGIN_SOVERSION=\"5\" -DXrdUtils_EXPORTS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/builddir/xrootd-5.5.5/src/.. -I/builddir/xrootd-5.5.5/src/. -I/usr/include/uuid -I/builddir/xrootd-5.5.5/src -I/builddir/xrootd-5.5.5/build/src -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2    -ffile-prefix-map=/builddir/xrootd-5.5.5/build=. -Wall -Wextra -Wno-unused-parameter -O3 -DNDEBUG -std=gnu++14 -fPIC -MD -MT src/CMakeFiles/XrdUtils.dir/XrdNet/XrdNetSecurity.cc.o -MF src/CMakeFiles/XrdUtils.dir/XrdNet/XrdNetSecurity.cc.o.d -o src/CMakeFiles/XrdUtils.dir/XrdNet/XrdNetSecurity.cc.o -c /builddir/xrootd-5.5.5/src/XrdNet/XrdNetSecurity.cc
/builddir/xrootd-5.5.5/src/XrdNet/XrdNetSecurity.cc: In member function 'bool XrdNetSecurity::Authorize(XrdNetAddr&)':
/builddir/xrootd-5.5.5/src/XrdNet/XrdNetSecurity.cc:172:15: error: 'innetgr' was not declared in this scope
  172 |       do {if (innetgr(tlp->text, hName, 0, 0))
      |               ^~~~~~~
```

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (16 preceding siblings ...)
  2023-05-23 11:31 ` dkwo
@ 2023-05-23 12:03 ` amadio
  2023-05-23 12:19 ` amadio
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-23 12:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1559152703

Comment:
Do you get this error with the master branch? Maybe I missed a commit in the patch attached above.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (17 preceding siblings ...)
  2023-05-23 12:03 ` amadio
@ 2023-05-23 12:19 ` amadio
  2023-05-23 12:20 ` amadio
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-23 12:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1559188512

Comment:
Indeed, I cherry-picked with a range, and that didn't pick up the first commit in the range. Here's an updated patch: [musl.patch.gz](https://github.com/void-linux/void-packages/files/11543740/musl.patch.gz)


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (18 preceding siblings ...)
  2023-05-23 12:19 ` amadio
@ 2023-05-23 12:20 ` amadio
  2023-05-23 12:21 ` amadio
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-23 12:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1559188512

Comment:
Indeed, I cherry-picked with a range, and that didn't pick up the first commit in the range. Here's an updated patch: [musl.patch.gz](https://github.com/void-linux/void-packages/files/11543740/musl.patch.gz)

I compiled inside an Alpine Linux container with this patch and it went ok.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (19 preceding siblings ...)
  2023-05-23 12:20 ` amadio
@ 2023-05-23 12:21 ` amadio
  2023-05-23 14:49 ` dkwo
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: amadio @ 2023-05-23 12:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

New comment by amadio on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1559188512

Comment:
Indeed, I cherry-picked with a range, and that didn't pick up the first commit in the range. Here's an updated patch: [musl.patch.gz](https://github.com/void-linux/void-packages/files/11543740/musl.patch.gz)

I compiled inside an Alpine Linux container with this patch and it went ok. I also pushed a branch to https://github.com/amadio/xrootd/tree/v5.5.5-musl.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (20 preceding siblings ...)
  2023-05-23 12:21 ` amadio
@ 2023-05-23 14:49 ` dkwo
  2023-05-23 14:53 ` [PR PATCH] [Updated] " dkwo
  2023-06-24 14:45 ` [PR PATCH] [Merged]: " Duncaen
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-05-23 14:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/42076#issuecomment-1559586850

Comment:
Now it works, thanks.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (21 preceding siblings ...)
  2023-05-23 14:49 ` dkwo
@ 2023-05-23 14:53 ` dkwo
  2023-06-24 14:45 ` [PR PATCH] [Merged]: " Duncaen
  23 siblings, 0 replies; 25+ messages in thread
From: dkwo @ 2023-05-23 14:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages O3xr
https://github.com/void-linux/void-packages/pull/42076

xrootd: update
- I tested the changes in this PR: no
- I built this PR locally for my native architecture, (x86_64-musl)

Builds fine with openssl3 #37681 but note https://github.com/xrootd/xrootd/issues/1877
It performs no tests, so it is hard to tell @BenJarg 

A patch file from https://github.com/void-linux/void-packages/pull/42076.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-O3xr-42076.patch --]
[-- Type: text/x-diff, Size: 25881 bytes --]

From 370757c0890391e66128894d2ce399050c0b6e42 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Sat, 4 Feb 2023 11:51:41 -0500
Subject: [PATCH 1/2] xrootd: update to 5.5.4

---
 srcpkgs/xrootd/patches/musl.patch | 227 ------------------------------
 srcpkgs/xrootd/template           |  10 +-
 2 files changed, 7 insertions(+), 230 deletions(-)
 delete mode 100644 srcpkgs/xrootd/patches/musl.patch

diff --git a/srcpkgs/xrootd/patches/musl.patch b/srcpkgs/xrootd/patches/musl.patch
deleted file mode 100644
index 7dccd97d6c45..000000000000
--- a/srcpkgs/xrootd/patches/musl.patch
+++ /dev/null
@@ -1,227 +0,0 @@
-diff --git a/src/Xrd/XrdConfig.hh b/src/Xrd/XrdConfig.hh
-index a06ad462f..702403d82 100644
---- a/src/Xrd/XrdConfig.hh
-+++ b/src/Xrd/XrdConfig.hh
-@@ -34,6 +34,11 @@
- #include "Xrd/XrdProtLoad.hh"
- #include "Xrd/XrdProtocol.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_mode_t
-+#include <bits/alltypes.h>
-+#endif
-+
- class XrdSysError;
- class XrdTcpMonInfo;
- class XrdNetSecurity;
-diff --git a/src/XrdAcc/XrdAccGroups.cc b/src/XrdAcc/XrdAccGroups.cc
-index e663fdd35..14c3b19d6 100644
---- a/src/XrdAcc/XrdAccGroups.cc
-+++ b/src/XrdAcc/XrdAccGroups.cc
-@@ -46,6 +46,14 @@
- #include "XrdAcc/XrdAccGroups.hh"
- #include "XrdAcc/XrdAccPrivs.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+int innetgr(const char *netgroup, const char *host, const char *user,
-+             const char *domain)
-+{
-+   return 0;
-+}
-+#endif
-+
- // Additionally, this routine does not support a user in more than
- // NGROUPS_MAX groups. This is a standard unix limit defined in limits.h.
-   
-diff --git a/src/XrdCl/XrdClFileStateHandler.hh b/src/XrdCl/XrdClFileStateHandler.hh
-index 9f9d8b91f..5ff49cbbc 100644
---- a/src/XrdCl/XrdClFileStateHandler.hh
-+++ b/src/XrdCl/XrdClFileStateHandler.hh
-@@ -42,6 +42,12 @@
- #include <sys/uio.h>
- #include <cstdint>
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_suseconds_t
-+#define __NEED_struct_timeval
-+#include <bits/alltypes.h>
-+#endif
-+
- namespace
- {
-   class PgReadHandler;
-diff --git a/src/XrdCl/XrdClMonitor.hh b/src/XrdCl/XrdClMonitor.hh
-index 2fc753777..d22c3c275 100644
---- a/src/XrdCl/XrdClMonitor.hh
-+++ b/src/XrdCl/XrdClMonitor.hh
-@@ -43,6 +43,12 @@
- 
- #include "XrdCl/XrdClFileSystem.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_suseconds_t
-+#define __NEED_struct_timeval
-+#include <bits/alltypes.h>
-+#endif
-+
- namespace XrdCl
- {
-   class URL;
-diff --git a/src/XrdNet/XrdNetSecurity.cc b/src/XrdNet/XrdNetSecurity.cc
-index 0f8451127..e39b1ef4b 100644
---- a/src/XrdNet/XrdNetSecurity.cc
-+++ b/src/XrdNet/XrdNetSecurity.cc
-@@ -40,12 +40,14 @@
- #include <sys/types.h>
- #include <Winsock2.h>
- #include <io.h>
-+#include "XrdSys/XrdWin32.hh"
-+#endif
-+#if WIN32 || defined(__linux__) && !defined(__GLIBC__)
- int innetgr(const char *netgroup, const char *host, const char *user,
-              const char *domain)
- {
-    return 0;
- }
--#include "XrdSys/XrdWin32.hh"
- #endif
- 
- #include "XrdNet/XrdNetAddr.hh"
-diff --git a/src/XrdPosix/XrdPosix.cc b/src/XrdPosix/XrdPosix.cc
-index 0f32dc2ee..b6dea957f 100644
---- a/src/XrdPosix/XrdPosix.cc
-+++ b/src/XrdPosix/XrdPosix.cc
-@@ -37,6 +37,9 @@
- #include <fcntl.h>
- #include <unistd.h>
- #include <sys/uio.h>
-+#if defined(__linux__) && !defined(_IO_ERR_SEEN)
-+#include <stdio_ext.h>
-+#endif
- 
- #include "XrdSys/XrdSysHeaders.hh"
- #include "XrdPosix/XrdPosixLinkage.hh"
-@@ -311,8 +314,12 @@ size_t XrdPosix_Fread(void *ptr, size_t size, size_t nitems, FILE *stream)
-         if (bytes > 0 && size) rc = bytes/size;
- #ifndef SUNX86
- #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
-+#ifdef _IO_ERR_SEEN
-    else if (bytes < 0) stream->_flags |= _IO_ERR_SEEN;
-    else                stream->_flags |= _IO_EOF_SEEN;
-+#else
-+   else if (bytes < 0) __fseterr(stream);
-+#endif
- #elif defined(__APPLE__) || defined(__FreeBSD__)
-    else if (bytes < 0) stream->_flags |= __SEOF;
-    else                stream->_flags |= __SERR;
-@@ -482,7 +489,11 @@ size_t XrdPosix_Fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream
-    if (bytes > 0 && size) rc = bytes/size;
- #ifndef SUNX86
- #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
-+#ifdef _IO_ERR_SEEN
-       else stream->_flags |= _IO_ERR_SEEN;
-+#else
-+      else  __fseterr(stream);
-+#endif
- #elif defined(__APPLE__) || defined(__FreeBSD__)
-       else stream->_flags |= __SERR;
- #else
-diff --git a/src/XrdPosix/XrdPosixLinkage.hh b/src/XrdPosix/XrdPosixLinkage.hh
-index 903153252..b5cc6d4b4 100644
---- a/src/XrdPosix/XrdPosixLinkage.hh
-+++ b/src/XrdPosix/XrdPosixLinkage.hh
-@@ -40,6 +40,7 @@
- #include <unistd.h>
- 
- #include "XrdPosix/XrdPosixOsDep.hh"
-+#include "XrdPosix/XrdPosixXrootd.hh"
- #include "XrdSys/XrdSysPlatform.hh"
- 
- /******************************************************************************/
-diff --git a/src/XrdPosix/XrdPosixMap.hh b/src/XrdPosix/XrdPosixMap.hh
-index ac2da483a..a15602787 100644
---- a/src/XrdPosix/XrdPosixMap.hh
-+++ b/src/XrdPosix/XrdPosixMap.hh
-@@ -36,6 +36,11 @@
- #include "XrdCl/XrdClFileSystem.hh"
- #include "XrdCl/XrdClXRootDResponses.hh"
- 
-+#if defined(__linux__) && !defined(__GLIBC__)
-+#define __NEED_dev_t
-+#include <bits/alltypes.h>
-+#endif
-+
- class XrdPosixMap
- {
- public:
-diff --git a/src/XrdPosix/XrdPosixPreload.cc b/src/XrdPosix/XrdPosixPreload.cc
-index 867b73479..d967c53b3 100644
---- a/src/XrdPosix/XrdPosixPreload.cc
-+++ b/src/XrdPosix/XrdPosixPreload.cc
-@@ -42,6 +42,22 @@
- 
- #include "XrdPosix/XrdPosixExtern.hh"
-  
-+#ifdef creat64
-+#undef creat64
-+#undef fseeko64
-+#undef ftello64
-+#undef ftruncate64
-+#undef lseek64
-+#undef open64
-+#undef pread64
-+#undef pwrite64
-+#undef readdir64
-+#undef readdir64_r
-+#undef statfs64
-+#undef statvfs64
-+#undef truncate64
-+#endif
-+
- /******************************************************************************/
- /*                   G l o b a l   D e c l a r a t i o n s                    */
- /******************************************************************************/
-diff --git a/src/XrdSys/XrdSysPlatform.hh b/src/XrdSys/XrdSysPlatform.hh
-index a1ac544ad..eaeaeabac 100644
---- a/src/XrdSys/XrdSysPlatform.hh
-+++ b/src/XrdSys/XrdSysPlatform.hh
-@@ -241,16 +241,8 @@ extern "C"
- #if defined(_AIX) || \
-    (defined(XR__SUNGCC3) && !defined(__arch64__))
- #   define SOCKLEN_t size_t
--#elif defined(XR__GLIBC) || \
--   defined(__FreeBSD__) || \
--   (defined(__FreeBSD_kernel__) && defined(__GLIBC__)) || \
--   (defined(XR__SUNGCC3) && defined(__arch64__)) || defined(__APPLE__) || \
--   (defined(__sun) && defined(_SOCKLEN_T))
--#   ifndef SOCKLEN_t
--#      define SOCKLEN_t socklen_t
--#   endif
- #elif !defined(SOCKLEN_t)
--#   define SOCKLEN_t int
-+#   define SOCKLEN_t socklen_t
- #endif
- 
- #ifdef _LP64
-diff --git a/src/XrdSys/XrdSysPthread.hh b/src/XrdSys/XrdSysPthread.hh
-index 17f8fd0be..78741a7dc 100644
---- a/src/XrdSys/XrdSysPthread.hh
-+++ b/src/XrdSys/XrdSysPthread.hh
-@@ -351,7 +351,7 @@ enum PrefType {prefWR=1};
- 
-         XrdSysRWLock(PrefType ptype)
-                     {
--#ifdef __linux__
-+#ifdef __GLIBC__
-                      pthread_rwlockattr_t attr;
-                      pthread_rwlockattr_setkind_np(&attr,
-                              PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
-@@ -367,7 +367,7 @@ enum PrefType {prefWR=1};
- inline void ReInitialize(PrefType ptype)
- {
-   pthread_rwlock_destroy(&lock);
--#ifdef __linux__
-+#ifdef __GLIBC__
-   pthread_rwlockattr_t attr;
-   pthread_rwlockattr_setkind_np(&attr,
-                      PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
diff --git a/srcpkgs/xrootd/template b/srcpkgs/xrootd/template
index 2bd0b59714c2..8a5358e691aa 100644
--- a/srcpkgs/xrootd/template
+++ b/srcpkgs/xrootd/template
@@ -1,15 +1,19 @@
 # Template file for 'xrootd'
 pkgname=xrootd
-version=5.4.2
+version=5.5.4
 revision=1
 build_style=cmake
-makedepends="zlib-devel openssl-devel libuuid-devel readline-devel"
+configure_args="-DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release"
+hostmakedepends="pkgconf"
+makedepends="zlib-devel openssl-devel libuuid-devel readline-devel
+ libcurl-devel mit-krb5-devel libxml2-devel tinyxml-devel libcppunit-devel
+ fuse-devel json-c-devel"
 short_desc="Low latency, scalable and fault tolerant access to data"
 maintainer="Ben Jargowsky <benjar63@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://xrootd.slac.stanford.edu"
 distfiles="http://xrootd.org/download/v${version}/xrootd-${version}.tar.gz"
-checksum=d868ba5d8b71ec38f7a113d2d8f3e25bbcedc1bc23d21bba1686ddfdb2b900c1
+checksum=41a8557ea2d118b1950282b17abea9230b252aa5ee1a5959173e2534b7d611d3
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-lexecinfo"

From 71f3fc72868b417b77347fd658a327b888bba2ac Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 23 May 2023 07:32:35 -0400
Subject: [PATCH 2/2] xrootd: update to 5.5.5, with musl patch (merged
 upstream)

---
 srcpkgs/xrootd/patches/musl.patch | 460 ++++++++++++++++++++++++++++++
 srcpkgs/xrootd/template           |   4 +-
 2 files changed, 462 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/xrootd/patches/musl.patch

diff --git a/srcpkgs/xrootd/patches/musl.patch b/srcpkgs/xrootd/patches/musl.patch
new file mode 100644
index 000000000000..901970620d8e
--- /dev/null
+++ b/srcpkgs/xrootd/patches/musl.patch
@@ -0,0 +1,460 @@
+diff --git a/cmake/XRootDOSDefs.cmake b/cmake/XRootDOSDefs.cmake
+index 8b182e61e..9f7c9aa59 100644
+--- a/cmake/XRootDOSDefs.cmake
++++ b/cmake/XRootDOSDefs.cmake
+@@ -70,6 +70,21 @@ if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
+   set( LINUX TRUE )
+   include( GNUInstallDirs )
+   set( EXTRA_LIBS rt )
++
++  # Check for musl libc with the compiler, since it provides way to detect it
++  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
++    OUTPUT_VARIABLE TARGET_TRIPLE ERROR_VARIABLE TARGET_ERROR)
++
++  if (NOT TARGET_ERROR)
++    if ("${TARGET_TRIPLE}" MATCHES "musl")
++      message(STATUS "Detected musl libc")
++      add_definitions(-DMUSL=1)
++    endif()
++  else()
++    message(WARNING "Could not detect system information!")
++  endif()
++
++  unset(TARGET_ERROR)
+ endif()
+ 
+ #-------------------------------------------------------------------------------
+diff --git a/src/Xrd/XrdConfig.hh b/src/Xrd/XrdConfig.hh
+index a06ad462f..2d1403a5e 100644
+--- a/src/Xrd/XrdConfig.hh
++++ b/src/Xrd/XrdConfig.hh
+@@ -34,6 +34,8 @@
+ #include "Xrd/XrdProtLoad.hh"
+ #include "Xrd/XrdProtocol.hh"
+ 
++#include <sys/types.h>
++
+ class XrdSysError;
+ class XrdTcpMonInfo;
+ class XrdNetSecurity;
+diff --git a/src/Xrd/XrdPoll.hh b/src/Xrd/XrdPoll.hh
+index 3790b03b0..d9bda5d62 100644
+--- a/src/Xrd/XrdPoll.hh
++++ b/src/Xrd/XrdPoll.hh
+@@ -29,7 +29,7 @@
+ /* specific prior written permission of the institution or contributor.       */
+ /******************************************************************************/
+ 
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "XrdSys/XrdSysPthread.hh"
+ 
+ #define XRD_NUMPOLLERS 3
+diff --git a/src/XrdAcc/XrdAccGroups.cc b/src/XrdAcc/XrdAccGroups.cc
+index e663fdd35..94b8edbc7 100644
+--- a/src/XrdAcc/XrdAccGroups.cc
++++ b/src/XrdAcc/XrdAccGroups.cc
+@@ -46,6 +46,14 @@
+ #include "XrdAcc/XrdAccGroups.hh"
+ #include "XrdAcc/XrdAccPrivs.hh"
+ 
++#ifdef MUSL
++int innetgr(const char *netgroup, const char *host, const char *user,
++             const char *domain)
++{
++   return 0;
++}
++#endif
++
+ // Additionally, this routine does not support a user in more than
+ // NGROUPS_MAX groups. This is a standard unix limit defined in limits.h.
+   
+diff --git a/src/XrdCl/XrdClFileStateHandler.hh b/src/XrdCl/XrdClFileStateHandler.hh
+index 197151321..f83538819 100644
+--- a/src/XrdCl/XrdClFileStateHandler.hh
++++ b/src/XrdCl/XrdClFileStateHandler.hh
+@@ -39,6 +39,7 @@
+ #include <set>
+ #include <vector>
+ 
++#include <sys/time.h>
+ #include <sys/uio.h>
+ #include <cstdint>
+ 
+diff --git a/src/XrdCl/XrdClMonitor.hh b/src/XrdCl/XrdClMonitor.hh
+index 2fc753777..2b3a96c46 100644
+--- a/src/XrdCl/XrdClMonitor.hh
++++ b/src/XrdCl/XrdClMonitor.hh
+@@ -43,6 +43,8 @@
+ 
+ #include "XrdCl/XrdClFileSystem.hh"
+ 
++#include <sys/time.h>
++
+ namespace XrdCl
+ {
+   class URL;
+diff --git a/src/XrdNet/XrdNetMsg.cc b/src/XrdNet/XrdNetMsg.cc
+index fa6c16f87..f97e1af09 100644
+--- a/src/XrdNet/XrdNetMsg.cc
++++ b/src/XrdNet/XrdNetMsg.cc
+@@ -29,7 +29,7 @@
+ /******************************************************************************/
+ 
+ #include <cerrno>
+-#include <sys/poll.h>
++#include <poll.h>
+ 
+ #include "XrdNet/XrdNet.hh"
+ #include "XrdNet/XrdNetMsg.hh"
+diff --git a/src/XrdNet/XrdNetSecurity.cc b/src/XrdNet/XrdNetSecurity.cc
+index 0f8451127..0faf563dd 100644
+--- a/src/XrdNet/XrdNetSecurity.cc
++++ b/src/XrdNet/XrdNetSecurity.cc
+@@ -40,11 +40,6 @@
+ #include <sys/types.h>
+ #include <Winsock2.h>
+ #include <io.h>
+-int innetgr(const char *netgroup, const char *host, const char *user,
+-             const char *domain)
+-{
+-   return 0;
+-}
+ #include "XrdSys/XrdWin32.hh"
+ #endif
+ 
+@@ -53,6 +48,14 @@ int innetgr(const char *netgroup, const char *host, const char *user,
+ #include "XrdNet/XrdNetUtils.hh"
+ #include "XrdSys/XrdSysTrace.hh"
+ 
++#if defined(MUSL) || defined(WIN32)
++int innetgr(const char *netgroup, const char *host, const char *user,
++             const char *domain)
++{
++   return 0;
++}
++#endif
++
+ /******************************************************************************/
+ /*                         L o c a l   C l a s s e s                          */
+ /******************************************************************************/
+diff --git a/src/XrdOfs/XrdOfsHandle.cc b/src/XrdOfs/XrdOfsHandle.cc
+index 963f17a5a..26b40ce08 100644
+--- a/src/XrdOfs/XrdOfsHandle.cc
++++ b/src/XrdOfs/XrdOfsHandle.cc
+@@ -30,7 +30,7 @@
+ 
+ #include <cstdio>
+ #include <ctime>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/types.h>
+ 
+ #include "XrdOfs/XrdOfsHandle.hh"
+diff --git a/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh b/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
+index b1a94acd6..0202579cc 100644
+--- a/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
++++ b/src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
+@@ -38,9 +38,7 @@
+ #include <memory>
+ #include <mutex>
+ 
+-#if defined(__GLIBC__) || defined(__BIONIC__) || defined(__CYGWIN__)
+-#include <byteswap.h>
+-#elif defined(__APPLE__)
++#if defined(__APPLE__)
+ // Make sure that byte swap functions are not already defined.
+ #if !defined(bswap_16)
+ // Mac OS X / Darwin features
+@@ -49,6 +47,8 @@
+ #define bswap_32(x) OSSwapInt32(x)
+ #define bswap_64(x) OSSwapInt64(x)
+ #endif
++#else
++#include <byteswap.h>
+ #endif
+ 
+ class XrdOssCsiTagstoreFile : public XrdOssCsiTagstore
+diff --git a/src/XrdOuc/XrdOucBackTrace.cc b/src/XrdOuc/XrdOucBackTrace.cc
+index 813183c32..c61a89b63 100644
+--- a/src/XrdOuc/XrdOucBackTrace.cc
++++ b/src/XrdOuc/XrdOucBackTrace.cc
+@@ -34,7 +34,7 @@
+ #include <vector>
+ #include <sys/syscall.h>
+ 
+-#ifdef __GNUC__
++#ifndef MUSL /* glibc, uclibc, and macOS all have execinfo.h */
+ #include <execinfo.h>
+ #include <cxxabi.h>
+ #endif
+@@ -176,13 +176,11 @@ XrdInfo *CvtRsp(const char *name, int snum)
+ /*                              D e m a n g l e                               */
+ /******************************************************************************/
+   
++#ifndef MUSL
+ namespace
+ {
+ int Demangle(char *cSym, char *buff, int blen)
+ {
+-#ifndef __GNUC__
+-   return -1;
+-#else
+    int   status;
+    char *plus = index(cSym, '+');
+    char *brak = (plus ? index(plus, '[') : 0);
+@@ -201,7 +199,6 @@ int Demangle(char *cSym, char *buff, int blen)
+    status = snprintf(buff, blen, "%s %s+%s\n", brak, realname, plus+1);
+    free(realname);
+    return status;
+-#endif
+ }
+ }
+ 
+@@ -221,6 +218,7 @@ int DumpDepth()
+    return (depth <= maxDepth ? depth : maxDepth);
+ }
+ }
++#endif
+ 
+ /******************************************************************************/
+ /*                             D u m p S t a c k                              */
+@@ -230,8 +228,8 @@ namespace
+ {
+ void DumpStack(char *bP, int bL, TidType tid)
+ {
+-#ifndef __GNUC__
+-   snprintf(bP, bL, "TBT " TidFmt " No stack information available, not gnuc.", tid);
++#ifdef MUSL
++   snprintf(bP, bL, "TBT " TidFmt " No stack information available with musl libc.", tid);
+    return;
+ #else
+    static int btDepth = DumpDepth(); // One time MT-safe call
+diff --git a/src/XrdPosix/XrdPosix.cc b/src/XrdPosix/XrdPosix.cc
+index 0f32dc2ee..e4f020c09 100644
+--- a/src/XrdPosix/XrdPosix.cc
++++ b/src/XrdPosix/XrdPosix.cc
+@@ -53,6 +53,58 @@
+   
+ extern XrdPosixLinkage   Xunix;
+ 
++/******************************************************************************/
++/*                      U t i l i t y  F u n c t i o n s                      */
++/******************************************************************************/
++
++#ifdef MUSL
++#include <stdio_ext.h>
++#endif
++
++static inline void fseterr(FILE *fp)
++{
++  /* Most systems provide FILE as a struct and the necessary bitmask in
++     <stdio.h>, because they need it for implementing getc() and putc() as
++     fast macros. This function is based on gnulib's fseterr.c */
++#if defined _IO_ERR_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
++  /* GNU libc, BeOS, Haiku, Linux libc5 */
++  fp->_flags |= _IO_ERR_SEEN;
++#elif defined __sferror || defined __APPLE__ || defined __DragonFly__ || defined __ANDROID__
++  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
++  fp->_flags |= __SERR;
++#elif defined _IOERR
++  /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
++  fp->_flag |= _IOERR;
++#elif defined __UCLIBC__            /* uClibc */
++  fp->__modeflags |= __FLAG_ERROR;
++#elif defined MUSL /* musl libc */
++  __fseterr(fp);
++#else
++ #error "Unsupported platform! Please report it as a bug."
++#endif
++}
++
++static inline void fseteof(FILE *fp)
++{
++  /* Most systems provide FILE as a struct and the necessary bitmask in
++     <stdio.h>, because they need it for implementing getc() and putc() as
++     fast macros.  */
++#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
++  /* GNU libc, BeOS, Haiku, Linux libc5 */
++  fp->_flags |= _IO_EOF_SEEN;
++#elif defined __sferror || defined __APPLE__ || defined __DragonFly__ || defined __ANDROID__
++  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
++  fp->_flags |= __SEOF;
++#elif defined _IOEOF
++  /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
++  fp->_flag |= _IOEOF;
++#elif defined __UCLIBC__            /* uClibc */
++  fp->__modeflags |= __FLAG_EOF;
++#else
++  (void) fseek(fp, 0L, SEEK_END);
++#endif
++}
++
+ /******************************************************************************/
+ /*                       X r d P o s i x _ A c c e s s                        */
+ /******************************************************************************/
+@@ -308,19 +360,9 @@ size_t XrdPosix_Fread(void *ptr, size_t size, size_t nitems, FILE *stream)
+ 
+ // Get the right return code. Note that we cannot emulate the flags in sunx86
+ //
+-        if (bytes > 0 && size) rc = bytes/size;
+-#ifndef SUNX86
+-#if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
+-   else if (bytes < 0) stream->_flags |= _IO_ERR_SEEN;
+-   else                stream->_flags |= _IO_EOF_SEEN;
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
+-   else if (bytes < 0) stream->_flags |= __SEOF;
+-   else                stream->_flags |= __SERR;
+-#else
+-   else if (bytes < 0) stream->_flag  |= _IOERR;
+-   else                stream->_flag  |= _IOEOF;
+-#endif
+-#endif
++   if (bytes > 0 && size) rc = bytes/size;
++   else if (bytes < 0) fseterr(stream);
++   else                fseteof(stream);
+ 
+    return rc;
+ }
+@@ -477,18 +519,10 @@ size_t XrdPosix_Fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream
+ 
+    bytes = Xroot.Write(fd, ptr, size*nitems);
+ 
+-// Get the right return code. Note that we cannot emulate the flags in sunx86
++// Get the right return code.
+ //
+    if (bytes > 0 && size) rc = bytes/size;
+-#ifndef SUNX86
+-#if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
+-      else stream->_flags |= _IO_ERR_SEEN;
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
+-      else stream->_flags |= __SERR;
+-#else
+-      else stream->_flag  |= _IOERR;
+-#endif
+-#endif
++   else fseterr(stream);
+ 
+    return rc;
+ }
+diff --git a/src/XrdPosix/XrdPosixFile.hh b/src/XrdPosix/XrdPosixFile.hh
+index 4d77b88d3..6d99cf464 100644
+--- a/src/XrdPosix/XrdPosixFile.hh
++++ b/src/XrdPosix/XrdPosixFile.hh
+@@ -35,6 +35,7 @@
+ #include <sys/time.h>
+ #include <sys/param.h>
+ #include <sys/resource.h>
++#include <sys/types.h>
+ #include <sys/uio.h>
+ 
+ #include "XrdCl/XrdClFileSystem.hh"
+diff --git a/src/XrdPosix/XrdPosixLinkage.hh b/src/XrdPosix/XrdPosixLinkage.hh
+index 903153252..b5cc6d4b4 100644
+--- a/src/XrdPosix/XrdPosixLinkage.hh
++++ b/src/XrdPosix/XrdPosixLinkage.hh
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ 
+ #include "XrdPosix/XrdPosixOsDep.hh"
++#include "XrdPosix/XrdPosixXrootd.hh"
+ #include "XrdSys/XrdSysPlatform.hh"
+ 
+ /******************************************************************************/
+diff --git a/src/XrdPosix/XrdPosixPreload.cc b/src/XrdPosix/XrdPosixPreload.cc
+index a62f0c658..8db1400d4 100644
+--- a/src/XrdPosix/XrdPosixPreload.cc
++++ b/src/XrdPosix/XrdPosixPreload.cc
+@@ -45,6 +45,22 @@
+ /******************************************************************************/
+ 
+ #include "XrdPosix/XrdPosixExtern.hh"
++
++#ifdef MUSL
++#undef creat64
++#undef fseeko64
++#undef ftello64
++#undef ftruncate64
++#undef lseek64
++#undef open64
++#undef pread64
++#undef pwrite64
++#undef readdir64
++#undef readdir64_r
++#undef statfs64
++#undef statvfs64
++#undef truncate64
++#endif
+  
+ /******************************************************************************/
+ /*                   G l o b a l   D e c l a r a t i o n s                    */
+diff --git a/src/XrdSys/XrdSysPlatform.hh b/src/XrdSys/XrdSysPlatform.hh
+index a1ac544ad..eaeaeabac 100644
+--- a/src/XrdSys/XrdSysPlatform.hh
++++ b/src/XrdSys/XrdSysPlatform.hh
+@@ -241,16 +241,8 @@ extern "C"
+ #if defined(_AIX) || \
+    (defined(XR__SUNGCC3) && !defined(__arch64__))
+ #   define SOCKLEN_t size_t
+-#elif defined(XR__GLIBC) || \
+-   defined(__FreeBSD__) || \
+-   (defined(__FreeBSD_kernel__) && defined(__GLIBC__)) || \
+-   (defined(XR__SUNGCC3) && defined(__arch64__)) || defined(__APPLE__) || \
+-   (defined(__sun) && defined(_SOCKLEN_T))
+-#   ifndef SOCKLEN_t
+-#      define SOCKLEN_t socklen_t
+-#   endif
+ #elif !defined(SOCKLEN_t)
+-#   define SOCKLEN_t int
++#   define SOCKLEN_t socklen_t
+ #endif
+ 
+ #ifdef _LP64
+diff --git a/src/XrdSys/XrdSysPthread.hh b/src/XrdSys/XrdSysPthread.hh
+index 17f8fd0be..6d9802460 100644
+--- a/src/XrdSys/XrdSysPthread.hh
++++ b/src/XrdSys/XrdSysPthread.hh
+@@ -351,7 +351,7 @@ enum PrefType {prefWR=1};
+ 
+         XrdSysRWLock(PrefType ptype)
+                     {
+-#ifdef __linux__
++#if defined(__linux__) && (defined(__GLIBC__) || defined(__UCLIBC__))
+                      pthread_rwlockattr_t attr;
+                      pthread_rwlockattr_setkind_np(&attr,
+                              PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+@@ -367,7 +367,7 @@ enum PrefType {prefWR=1};
+ inline void ReInitialize(PrefType ptype)
+ {
+   pthread_rwlock_destroy(&lock);
+-#ifdef __linux__
++#if defined(__linux__) && (defined(__GLIBC__) || defined(__UCLIBC__))
+   pthread_rwlockattr_t attr;
+   pthread_rwlockattr_setkind_np(&attr,
+                      PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+diff --git a/src/XrdTls/XrdTlsTempCA.cc b/src/XrdTls/XrdTlsTempCA.cc
+index faf69785f..37431dee9 100644
+--- a/src/XrdTls/XrdTlsTempCA.cc
++++ b/src/XrdTls/XrdTlsTempCA.cc
+@@ -30,7 +30,7 @@
+ #include <cstdlib>
+ #include <fcntl.h>
+ #include <dirent.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ 
+ #include <unordered_set>
+ #include <memory>
+diff --git a/src/XrdVoms/XrdVomsMapfile.cc b/src/XrdVoms/XrdVomsMapfile.cc
+index 8ffbe9218..fddbfdc06 100644
+--- a/src/XrdVoms/XrdVomsMapfile.cc
++++ b/src/XrdVoms/XrdVomsMapfile.cc
+@@ -40,7 +40,7 @@
+ #include <vector>
+ #include <string>
+ #include <fcntl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ 
+ bool XrdVomsMapfile::tried_configure = false;
+ std::unique_ptr<XrdVomsMapfile> XrdVomsMapfile::mapper;
diff --git a/srcpkgs/xrootd/template b/srcpkgs/xrootd/template
index 8a5358e691aa..10ed861b1391 100644
--- a/srcpkgs/xrootd/template
+++ b/srcpkgs/xrootd/template
@@ -1,6 +1,6 @@
 # Template file for 'xrootd'
 pkgname=xrootd
-version=5.5.4
+version=5.5.5
 revision=1
 build_style=cmake
 configure_args="-DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release"
@@ -13,7 +13,7 @@ maintainer="Ben Jargowsky <benjar63@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://xrootd.slac.stanford.edu"
 distfiles="http://xrootd.org/download/v${version}/xrootd-${version}.tar.gz"
-checksum=41a8557ea2d118b1950282b17abea9230b252aa5ee1a5959173e2534b7d611d3
+checksum=0710caae527082e73d3bf8f9d1dffe95808afd3fcaaaa15ab0b937b8b226bc1f
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-lexecinfo"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Merged]: xrootd: update
  2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
                   ` (22 preceding siblings ...)
  2023-05-23 14:53 ` [PR PATCH] [Updated] " dkwo
@ 2023-06-24 14:45 ` Duncaen
  23 siblings, 0 replies; 25+ messages in thread
From: Duncaen @ 2023-06-24 14:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

There's a merged pull request on the void-packages repository

xrootd: update
https://github.com/void-linux/void-packages/pull/42076

Description:
- I tested the changes in this PR: no
- I built this PR locally for my native architecture, (x86_64-musl)

Builds fine with openssl3 #37681 but note https://github.com/xrootd/xrootd/issues/1877
It performs no tests, so it is hard to tell @BenJarg 

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-06-24 14:45 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 16:55 [PR PATCH] xrootd: update to 5.5.1 dkwo
2023-02-06 13:10 ` amadio
2023-02-06 19:27 ` dkwo
2023-02-14 21:10 ` dkwo
2023-02-14 21:27 ` [PR PATCH] [Updated] " dkwo
2023-02-14 21:30 ` BenJarg
2023-02-14 21:31 ` BenJarg
2023-02-14 21:46 ` [PR PATCH] [Updated] " dkwo
2023-02-14 21:47 ` dkwo
2023-02-15  9:19 ` amadio
2023-03-02 22:43 ` dkwo
2023-03-03  8:03 ` amadio
2023-05-15 15:01 ` xrootd: update dkwo
2023-05-16  6:09 ` amadio
2023-05-16  6:10 ` amadio
2023-05-16 14:44 ` dkwo
2023-05-23  8:01 ` amadio
2023-05-23 11:31 ` dkwo
2023-05-23 12:03 ` amadio
2023-05-23 12:19 ` amadio
2023-05-23 12:20 ` amadio
2023-05-23 12:21 ` amadio
2023-05-23 14:49 ` dkwo
2023-05-23 14:53 ` [PR PATCH] [Updated] " dkwo
2023-06-24 14:45 ` [PR PATCH] [Merged]: " Duncaen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).