[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - config_host/config_features.h.in config_host.mk.in configure.ac sal/Library_sal.mk sal/osl

2022-01-06 Thread Ismael Luceno (via logerrit)
 config_host.mk.in|2 ++
 config_host/config_features.h.in |4 
 configure.ac |   14 ++
 sal/Library_sal.mk   |2 ++
 sal/osl/unx/backtrace.c  |   20 +++-
 sal/osl/unx/backtrace.h  |   13 +++--
 sal/osl/unx/signal.cxx   |   32 +++-
 7 files changed, 43 insertions(+), 44 deletions(-)

New commits:
commit 7c0a4e7ca36b93df4968182f92b3d52fd4d1bb01
Author: Ismael Luceno 
AuthorDate: Tue Dec 28 12:12:13 2021 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 6 17:33:15 2022 +0100

Add configure test for the backtrace implementation

Improve robustness by testing explicitly; instead of assuming based on
the OS, test first the libc and then test for libexecinfo.

The assumption was wrong for FreeBSD (included since 2017) and for
musl-based systems (not in libc).

Also, remove INCLUDE_BACKTRACE and clean up a bit.

Ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220271
Change-Id: Ib4b7fd4fe2cdf5f76babe47a21bd2990fcf42649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127538
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 
(cherry picked from commit c1be12396088563ed77ed61e54fd4e153469701d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127767
Reviewed-by: Ismael Luceno 
Reviewed-by: Michael Stahl 

diff --git a/config_host.mk.in b/config_host.mk.in
index e17d3f73cf57..a38458b8c865 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -35,6 +35,8 @@ export AVAHI_CFLAGS=$(gb_SPACE)@AVAHI_CFLAGS@
 export AVAHI_LIBS=$(gb_SPACE)@AVAHI_LIBS@
 export LIBATOMIC_OPS_CFLAGS=$(gb_SPACE)@LIBATOMIC_OPS_CFLAGS@
 export LIBATOMIC_OPS_LIBS=$(gb_SPACE)@LIBATOMIC_OPS_LIBS@
+export BACKTRACE_CFLAGS=@BACKTRACE_CFLAGS@
+export BACKTRACE_LIBS=@BACKTRACE_LIBS@
 export BINDIR=@BINDIR@
 export BISON=@BISON@
 export BOOST_CPPFLAGS=@BOOST_CPPFLAGS@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index e38e46386d83..0f610a5646bc 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -99,6 +99,10 @@
  */
 #define HAVE_FEATURE_BREAKPAD 0
 
+/* BACKTRACE - whether a GNU backtrace implementation is available.
+ */
+#define HAVE_FEATURE_BACKTRACE 0
+
 /*
  *  Whether OpenGL is enabled
  */
diff --git a/configure.ac b/configure.ac
index e1b75d2c10ad..aca958768d0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1334,6 +1334,20 @@ if test $_os != "WINNT"; then
 fi
 AC_SUBST(DLOPEN_LIBS)
 
+# Check for a (GNU) backtrace implementation
+AC_ARG_VAR([BACKTRACE_CFLAGS], [Compiler flags needed to use backtrace(3)])
+AC_ARG_VAR([BACKTRACE_LIBS], [Linker flags needed to use backtrace(3)])
+AS_IF([test "x$BACKTRACE_LIBS$BACKTRACE_CFLAGS" = x], [
+save_LIBS="$LIBS"
+AC_SEARCH_LIBS([backtrace], [libexecinfo],
+[case "$ac_cv_search_backtrace" in -l*) 
BACKTRACE_LIBS="$ac_cv_search_backtrace";; esac],
+[PKG_CHECK_MODULES([BACKTRACE], [libexecinfo], 
[ac_cv_search_backtrace=], [:])])
+LIBS="$save_LIBS"
+])
+AS_IF([test "x$ac_cv_search_backtrace" != xno ], [
+AC_DEFINE([HAVE_FEATURE_BACKTRACE])
+])
+
 dnl ===
 dnl Sanity checks for Emscripten SDK setup
 dnl ===
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index f7c7b3ab1764..03ca93f673b8 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_Library_set_is_ure_library,sal))
 $(eval $(call gb_Library_set_include,sal,\
$$(INCLUDE) \
-I$(SRCDIR)/sal/inc \
+   $(BACKTRACE_CFLAGS) \
 ))
 
 $(eval $(call gb_Library_add_defs,sal,\
@@ -71,6 +72,7 @@ $(eval $(call gb_Library_add_libs,sal,\
$(if $(filter HAIKU,$(OS)), \
-lnetwork \
) \
+   $(BACKTRACE_LIBS) \
 ))
 
 ifeq ($(OS),MACOSX)
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index 26005f7715af..f7bd01c334aa 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -17,16 +17,19 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "backtrace.h"
+
+#if ! HAVE_FEATURE_BACKTRACE /* no GNU backtrace implementation available */
+
 #include 
 
-#ifdef __sun
+#ifdef __sun /* Solaris */
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include "backtrace.h"
 
 #if defined(SPARC)
 
@@ -140,7 +143,12 @@ void backtrace_symbols_fd( void **buffer, int size, int fd 
)
 #include 
 #include 
 #include 
-#include "backtrace.h"
+
+/* no frame.h on FreeBSD */
+struct frame {
+struct frame *fr_savfp;
+longfr_savpc;
+};
 
 #if defined(POWERPC) || defined(POWERPC64)
 
@@ -212,7 +220,7 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
 }
 }
 
-#elif !defined LINUX && !defined MACOSX && !defined IOS
+#else /* not 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - desktop/unx vcl/headless vcl/unx

2022-01-04 Thread Ismael Luceno (via logerrit)
 desktop/unx/source/start.c   |2 +-
 vcl/headless/svpinst.cxx |2 +-
 vcl/unx/generic/dtrans/X11_selection.cxx |4 
 3 files changed, 2 insertions(+), 6 deletions(-)

New commits:
commit e57376c4ccf40bac3c284bd9a04000f0fd5ed360
Author: Ismael Luceno 
AuthorDate: Tue Dec 28 23:24:08 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jan 4 10:49:11 2022 +0100

Always use , no modern system needs 

This was standardized in IEEE 1003.1-2001, so more than 20 years old.

Verified following systems using online resources:
- FreeBSD 3.0 (1998)
- NetBSD 1.3 (1998)
- OpenBSD 2.0 (1996)
- CentOS 5.0 (2007)
- Debian 4.0 (2007)
- IRIX 6.5.30 (2006)
- SunOS 4.1.3 (1992)
- SUSE 10.2 (2008)
- Red Hat 5.0 (1998)

So the check used for BSDs on vcl/unx/generic/dtrans/X11_selection.cxx
was never correct.

On GNU/Linux specifically,  is provided since glibc 2.0 (1997).

musl libc produces the following warning if the non-standard header is
included:

/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect 
#include  to  [-Wcpp]

Change-Id: Ia8f4b9e1ee069f86abe03140c18a77d17336d09c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127666
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 
(cherry picked from commit 4242c7b91887236375e08e2b6b24de0cecbf1626)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127586
Reviewed-by: Ismael Luceno 
Reviewed-by: Xisco Fauli 

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 385761a81230..a83db69e5c66 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index b573f756f411..ec7463756aef 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx 
b/vcl/unx/generic/dtrans/X11_selection.cxx
index 8d3298aead3a..1c6ec92f1b87 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -34,11 +34,7 @@
 #include 
 #include 
 
-#if defined(NETBSD) || defined (FREEBSD) || defined(OPENBSD)
-#include 
-#else
 #include 
-#endif
 
 #include 
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - idlc/source

2022-01-04 Thread Ismael Luceno (via logerrit)
 idlc/source/idlccompile.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit c9d0f66fef3123f76954fa7549d0a6ec5dd549f8
Author: Ismael Luceno 
AuthorDate: Sun Dec 26 22:19:39 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jan 4 10:48:18 2022 +0100

idlc: Always use sys/wait.h on UNIX

According to (and since) POSIX.1-1988 it's always ; and all
supported systems include it, back to 1995.

AFAICT, none of the systems mention  in their manual pages.

musl libc produces the following warning if the non-standard header is
included:

/usr/include/wait.h:1:2: warning: #warning redirecting incorrect 
#include  to  [-Wcpp]

Change-Id: Iff1293a08ad080fdc987770596b10ef08cc145a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127537
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 
(cherry picked from commit 9d0568609be69a2b533d9a4bf4d03c37c15e779d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127585
Reviewed-by: Ismael Luceno 
Reviewed-by: Xisco Fauli 

diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 6db9a615d316..0d06ea59cdbe 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -35,12 +35,7 @@
 #ifdef  SAL_UNX
 #include 
 #include 
-#if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
-defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(HAIKU)
 #include 
-#else
-#include 
-#endif
 #endif
 
 #include 


[Libreoffice-commits] core.git: config_host/config_features.h.in config_host.mk.in configure.ac sal/Library_sal.mk sal/osl

2021-12-30 Thread Ismael Luceno (via logerrit)
 config_host.mk.in|2 ++
 config_host/config_features.h.in |4 
 configure.ac |   14 ++
 sal/Library_sal.mk   |2 ++
 sal/osl/unx/backtrace.c  |   20 +++-
 sal/osl/unx/backtrace.h  |   13 +++--
 sal/osl/unx/signal.cxx   |   32 +++-
 7 files changed, 43 insertions(+), 44 deletions(-)

New commits:
commit c1be12396088563ed77ed61e54fd4e153469701d
Author: Ismael Luceno 
AuthorDate: Tue Dec 28 12:12:13 2021 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Thu Dec 30 11:04:11 2021 +0100

Add configure test for the backtrace implementation

Improve robustness by testing explicitly; instead of assuming based on
the OS, test first the libc and then test for libexecinfo.

The assumption was wrong for FreeBSD (included since 2017) and for
musl-based systems (not in libc).

Also, remove INCLUDE_BACKTRACE and clean up a bit.

Ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220271
Change-Id: Ib4b7fd4fe2cdf5f76babe47a21bd2990fcf42649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127538
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/config_host.mk.in b/config_host.mk.in
index 7a4bf2cdcce0..1025ee4805f9 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -33,6 +33,8 @@ export AVAHI_CFLAGS=$(gb_SPACE)@AVAHI_CFLAGS@
 export AVAHI_LIBS=$(gb_SPACE)@AVAHI_LIBS@
 export LIBATOMIC_OPS_CFLAGS=$(gb_SPACE)@LIBATOMIC_OPS_CFLAGS@
 export LIBATOMIC_OPS_LIBS=$(gb_SPACE)@LIBATOMIC_OPS_LIBS@
+export BACKTRACE_CFLAGS=@BACKTRACE_CFLAGS@
+export BACKTRACE_LIBS=@BACKTRACE_LIBS@
 export BINDIR=@BINDIR@
 export BISON=@BISON@
 export BOOST_CPPFLAGS=@BOOST_CPPFLAGS@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index e38e46386d83..0f610a5646bc 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -99,6 +99,10 @@
  */
 #define HAVE_FEATURE_BREAKPAD 0
 
+/* BACKTRACE - whether a GNU backtrace implementation is available.
+ */
+#define HAVE_FEATURE_BACKTRACE 0
+
 /*
  *  Whether OpenGL is enabled
  */
diff --git a/configure.ac b/configure.ac
index ee16840053ca..825482217b26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1343,6 +1343,20 @@ if test $_os != "WINNT"; then
 fi
 AC_SUBST(DLOPEN_LIBS)
 
+# Check for a (GNU) backtrace implementation
+AC_ARG_VAR([BACKTRACE_CFLAGS], [Compiler flags needed to use backtrace(3)])
+AC_ARG_VAR([BACKTRACE_LIBS], [Linker flags needed to use backtrace(3)])
+AS_IF([test "x$BACKTRACE_LIBS$BACKTRACE_CFLAGS" = x], [
+save_LIBS="$LIBS"
+AC_SEARCH_LIBS([backtrace], [libexecinfo],
+[case "$ac_cv_search_backtrace" in -l*) 
BACKTRACE_LIBS="$ac_cv_search_backtrace";; esac],
+[PKG_CHECK_MODULES([BACKTRACE], [libexecinfo], 
[ac_cv_search_backtrace=], [:])])
+LIBS="$save_LIBS"
+])
+AS_IF([test "x$ac_cv_search_backtrace" != xno ], [
+AC_DEFINE([HAVE_FEATURE_BACKTRACE])
+])
+
 dnl ===
 dnl Sanity checks for Emscripten SDK setup
 dnl ===
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index ac121098273f..30af237cd546 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -19,6 +19,7 @@ $(eval $(call 
gb_Library_set_is_ure_library_or_dependency,sal))
 $(eval $(call gb_Library_set_include,sal,\
$$(INCLUDE) \
-I$(SRCDIR)/sal/inc \
+   $(BACKTRACE_CFLAGS) \
 ))
 
 $(eval $(call gb_Library_add_defs,sal,\
@@ -71,6 +72,7 @@ $(eval $(call gb_Library_add_libs,sal,\
$(if $(filter HAIKU,$(OS)), \
-lnetwork \
) \
+   $(BACKTRACE_LIBS) \
 ))
 
 ifeq ($(OS),MACOSX)
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index 26005f7715af..f7bd01c334aa 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -17,16 +17,19 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "backtrace.h"
+
+#if ! HAVE_FEATURE_BACKTRACE /* no GNU backtrace implementation available */
+
 #include 
 
-#ifdef __sun
+#ifdef __sun /* Solaris */
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include "backtrace.h"
 
 #if defined(SPARC)
 
@@ -140,7 +143,12 @@ void backtrace_symbols_fd( void **buffer, int size, int fd 
)
 #include 
 #include 
 #include 
-#include "backtrace.h"
+
+/* no frame.h on FreeBSD */
+struct frame {
+struct frame *fr_savfp;
+longfr_savpc;
+};
 
 #if defined(POWERPC) || defined(POWERPC64)
 
@@ -212,7 +220,7 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
 }
 }
 
-#elif !defined LINUX && !defined MACOSX && !defined IOS
+#else /* not GNU/BSD/Solaris */
 
 int backtrace( void **buffer, int max_frames )
 {
@@ -231,6 +239,8 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
 (void)buffer; (void)size; 

[Libreoffice-commits] core.git: desktop/unx vcl/headless vcl/unx

2021-12-29 Thread Ismael Luceno (via logerrit)
 desktop/unx/source/start.c   |2 +-
 vcl/headless/svpinst.cxx |2 +-
 vcl/unx/generic/dtrans/X11_selection.cxx |4 
 3 files changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 4242c7b91887236375e08e2b6b24de0cecbf1626
Author: Ismael Luceno 
AuthorDate: Tue Dec 28 23:24:08 2021 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Wed Dec 29 13:05:46 2021 +0100

Always use , no modern system needs 

This was standardized in IEEE 1003.1-2001, so more than 20 years old.

Verified following systems using online resources:
- FreeBSD 3.0 (1998)
- NetBSD 1.3 (1998)
- OpenBSD 2.0 (1996)
- CentOS 5.0 (2007)
- Debian 4.0 (2007)
- IRIX 6.5.30 (2006)
- SunOS 4.1.3 (1992)
- SUSE 10.2 (2008)
- Red Hat 5.0 (1998)

So the check used for BSDs on vcl/unx/generic/dtrans/X11_selection.cxx
was never correct.

On GNU/Linux specifically,  is provided since glibc 2.0 (1997).

musl libc produces the following warning if the non-standard header is
included:

/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect 
#include  to  [-Wcpp]

Change-Id: Ia8f4b9e1ee069f86abe03140c18a77d17336d09c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127666
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 385761a81230..a83db69e5c66 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index a42b788a8249..181e01782214 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx 
b/vcl/unx/generic/dtrans/X11_selection.cxx
index 8d3298aead3a..1c6ec92f1b87 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -34,11 +34,7 @@
 #include 
 #include 
 
-#if defined(NETBSD) || defined (FREEBSD) || defined(OPENBSD)
-#include 
-#else
 #include 
-#endif
 
 #include 
 


[Libreoffice-commits] core.git: idlc/source

2021-12-28 Thread Ismael Luceno (via logerrit)
 idlc/source/idlccompile.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 9d0568609be69a2b533d9a4bf4d03c37c15e779d
Author: Ismael Luceno 
AuthorDate: Sun Dec 26 22:19:39 2021 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Tue Dec 28 14:55:02 2021 +0100

idlc: Always use sys/wait.h on UNIX

According to (and since) POSIX.1-1988 it's always ; and all
supported systems include it, back to 1995.

AFAICT, none of the systems mention  in their manual pages.

musl libc produces the following warning if the non-standard header is
included:

/usr/include/wait.h:1:2: warning: #warning redirecting incorrect 
#include  to  [-Wcpp]

Change-Id: Iff1293a08ad080fdc987770596b10ef08cc145a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127537
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 6db9a615d316..0d06ea59cdbe 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -35,12 +35,7 @@
 #ifdef  SAL_UNX
 #include 
 #include 
-#if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
-defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(HAIKU)
 #include 
-#else
-#include 
-#endif
 #endif
 
 #include 


[Libreoffice-commits] core.git: configure.ac

2021-10-05 Thread Ismael Luceno (via logerrit)
 configure.ac |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit dd855b9af9b180e878c5cffa881f4f68cff4afb8
Author: Ismael Luceno 
AuthorDate: Wed Sep 29 21:16:32 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Oct 5 10:38:12 2021 +0200

configure: Allow building on musl-based systems

Signed-off-by: Ismael Luceno 
Change-Id: I64e9dea846f3753a91d87bb664af30d0790b5159
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123005
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/configure.ac b/configure.ac
index 346a01168b52..0dcd4f283330 100644
--- a/configure.ac
+++ b/configure.ac
@@ -878,7 +878,7 @@ solaris*)
 fi
 ;;
 
-linux-gnu*|k*bsd*-gnu*)
+linux-gnu*|k*bsd*-gnu*|linux-musl*)
 using_freetype_fontconfig=yes
 using_x11=yes
 build_skia=yes
@@ -4950,7 +4950,7 @@ kfreebsd*)
 esac
 ;;
 
-linux-gnu*)
+linux-gnu*|linux-musl*)
 COM=GCC
 OS=LINUX
 RTL_OS=Linux


[Libreoffice-commits] core.git: configure.ac

2021-10-05 Thread Ismael Luceno (via logerrit)
 configure.ac |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 19d85ff18f3f27d68908091242eb7e22b85f9e7c
Author: Ismael Luceno 
AuthorDate: Thu Sep 30 02:07:59 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Oct 5 10:40:46 2021 +0200

configure: Fix libc version check

Testing for gnu_get_libc_version isn't quite right (available before
2.1), and the feature macros were already present.

The new test at least will fail for glibc < 2.1, but will pass on
non-glibc systems.

The buildsystem should be actually checking for some sort of compliance
barrier instead, but this is a start.

Signed-off-by: Ismael Luceno 
Change-Id: I879278c2946c1fa5416da0407a949c8c4b2a8bf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123006
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/configure.ac b/configure.ac
index 0dcd4f283330..c0713a64df5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11327,15 +11327,13 @@ dnl ***
 dnl testing libc version for Linux...
 dnl ***
 if test "$_os" = "Linux"; then
-AC_MSG_CHECKING([whether libc is >= 2.1.1])
-exec 6>/dev/null # no output
-AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
-exec 6>&1 # output on again
-if test "$HAVE_LIBC"; then
-AC_MSG_RESULT([yes])
-else
-AC_MSG_ERROR([no, upgrade libc])
-fi
+AC_MSG_CHECKING([whether the libc is recent enough])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include 
+#if defined(__GNU_LIBRARY__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && 
__GLIBC_MINOR__ < 1))
+#error glibc >= 2.1 is required
+#endif
+]])],, [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, upgrade libc])])
 fi
 
 dnl =