From 9b699d3fb122c135a85d64c8e0235b7a110903f1 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Mon, 24 Mar 2014 17:15:40 -0600 Subject: [PATCH] linux: build with thread safety and REENTRANT enabled. There was a check in linux.cf for the Linux libc version that didn't work, since these were never set anywhere. Presumably current Xorg imake sets these, but since we aren't using that... (yet) As a result, the build assumed that thread-safe API's were not supported. Setting the default libc major version to '6' allows the proper build to take place. libc5 was never threadsafe and no one has probably used it in over 10 years. As a result, some earlier porting fixes that referenced '__fds_bits' on linux systems had to be reverted as these are not valid in an MT environment. They are also not neccessary when building in such an environment, as the normal 'fds_bits' works fine. This patch defintely needs testing on many linux systems. --- cde/config/cf/linux.cf | 20 ++++++++++++++++---- cde/lib/csa/xtclient.c | 5 +---- cde/programs/dtspcd/spcd_event.c | 5 ----- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index 9cd89336..f55779e1 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -34,17 +34,29 @@ XCOMM platform: $TOG: linux.cf /main/47 1998/04/17 11:32:51 mgreess $ LinuxYggdrasil (12) */ #endif + +#ifndef DefaultLinuxCLibMajorVersion +# define DefaultLinuxCLibMajorVersion 6 +#endif +#ifndef DefaultLinuxCLibMinorVersion +# define DefaultLinuxCLibMinorVersion 0 +#endif +#ifndef DefaultLinuxCLibTeenyVersion +# define DefaultLinuxCLibTeenyVersion 0 +#endif + #ifndef LinuxCLibMajorVersion -# define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion +# define LinuxCLibMajorVersion DefaultLinuxCLibMajorVersion #endif #ifndef LinuxCLibMinorVersion -# define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion +# define LinuxCLibMinorVersion DefaultLinuxCLibMinorVersion #endif #ifndef LinuxCLibTeenyVersion -# define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion +# define LinuxCLibTeenyVersion DefaultLinuxCLibTeenyVersion #endif + #ifndef LinuxBinUtilsMajorVersion -# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion +# define LinuxBinUtilsMajorVersion DefaultLinuxBinUtilsMajorVersion #endif XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion) diff --git a/cde/lib/csa/xtclient.c b/cde/lib/csa/xtclient.c index b42b5efc..aff5b03a 100644 --- a/cde/lib/csa/xtclient.c +++ b/cde/lib/csa/xtclient.c @@ -69,11 +69,8 @@ _DtCm_register_xtcallback(XtAppContext appct) return; /* assuming only 1 bit is set */ -#if defined(linux) - bits = fdset.__fds_bits; -#else bits = fdset.fds_bits; -#endif + for (i = 0; i < FD_SETSIZE; i += NFDBITS) { fmask = *bits; for (j = 0; fmask != 0; j++, fmask >>= 1) { diff --git a/cde/programs/dtspcd/spcd_event.c b/cde/programs/dtspcd/spcd_event.c index 2a30c7fc..01fdf28b 100644 --- a/cde/programs/dtspcd/spcd_event.c +++ b/cde/programs/dtspcd/spcd_event.c @@ -86,13 +86,8 @@ void SPCD_MainLoopUntil(Boolean *flag) int result; do { for (n=0; n