This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8503

-- gerrit

commit a8130fcb9322993f3b117086d57cfb1c3986cdc7
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sun Sep 22 18:32:21 2024 +0200

    openocd: build: allow more socket connections on Windows
    
    Cross compiling OpenOCD for Windows forces the maximum number of
    open files (including sockets) to 64. See in include file
    psdk_inc/_fd_types.h:
            #ifndef FD_SETSIZE
            #define FD_SETSIZE 64
            #endif
    
    This limit is far lower than the default value 1024 used by Linux.
    
    In pull request #644 [1] in risc-v fork it's reported that:
    - each socket server of OpenOCD (GDB, telnet, ...) uses one FD;
    - each active connection to a socket server uses another FD;
    - multi-core devices with 32 or more cores, each having a GDB
      connection, already saturates the 64 available FD at the 26th
      GDB connection.
    
    The patch [2] proposed and merged in risc-v fork adds the compile
    flag
            -DFD_SETSIZE=128
    to all the host types. While this looks fine for Windows, it
    reduces the default value for Linux and other OS.
    
    Add the compile flag FD_SETSIZE only to cross compile for Windows.
    
    Link: [1] https://github.com/riscv-collab/riscv-openocd/pull/644
    Link: [2] 
https://github.com/riscv-collab/riscv-openocd/pull/644/commits/1bab4cfbc4f4
    Change-Id: Ie43a792ac11a5e63e0407b68e3f270efea0c87be
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/configure.ac b/configure.ac
index b7aed245e6..07e06551f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -435,7 +435,7 @@ AS_CASE([$host],
     # In case enable_buspirate=auto, make sure it will not be built.
     enable_buspirate=no
 
-    AC_SUBST([HOST_CPPFLAGS], [-D__USE_MINGW_ANSI_STDIO])
+    AC_SUBST([HOST_CPPFLAGS], ["-D__USE_MINGW_ANSI_STDIO -DFD_SETSIZE=128"])
   ],
   [*darwin*], [
     is_darwin=yes

-- 

Reply via email to