[PATCH] libgpg-error: fix for Solaris
NIIBE Yutaka
gniibe at fsij.org
Thu Feb 4 04:01:57 CET 2016
Hello,
Here is a possible patch for Solaris. No, I can't test on Solaris.
Issue 1671:
https://bugs.gnupg.org/gnupg/issue1671
diff --git a/configure.ac b/configure.ac
index aec3685..a501c9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -416,6 +416,25 @@ else
fi
fi
+# Default value for GPG_ERROR_CONFIG_LIBS
+config_libs="-lgpg-error"
+
+#
+# Check for other libraries (now only for -lrt).
+#
+# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
+# programs in the package would end up linked with that potentially-shared
+# library, inducing unnecessary run-time overhead.
+LIB_SCHED_YIELD=
+AC_SUBST([LIB_SCHED_YIELD])
+gl_saved_libs=$LIBS
+AC_SEARCH_LIBS([sched_yield], [rt posix4],
+ [if test "$ac_cv_search_sched_yield" != "none required";
then
+ LIB_SCHED_YIELD=$ac_cv_search_sched_yield
+ config_libs="$config_libs $LIB_SCHED_YIELD"
+ fi])
+LIBS=$gl_saved_libs
+
#
# Prepare building of estream
#
@@ -424,7 +443,7 @@ estream_INIT
#
# Substitution used for gpg-error-config
#
-GPG_ERROR_CONFIG_LIBS="-lgpg-error"
+GPG_ERROR_CONFIG_LIBS="$config_libs"
if test "x$LIBTHREAD" != x; then
GPG_ERROR_CONFIG_LIBS="${GPG_ERROR_CONFIG_LIBS} ${LIBTHREAD}"
fi
diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
index 595d379..3453106 100644
--- a/src/gen-posix-lock-obj.c
+++ b/src/gen-posix-lock-obj.c
@@ -49,6 +49,11 @@
# define USE_16BYTE_ALIGNMENT 0
#endif
+#if (defined (__ILP32__) || defined(_ILP32)) && defined(__solaris__)
+# define USE_DOUBLE_FOR_ALIGNMENT 1
+#else
+# define USE_DOUBLE_FOR_ALIGNMENT 0
+#endif
#if USE_16BYTE_ALIGNMENT && !HAVE_GCC_ATTRIBUTE_ALIGNED
# error compiler is not able to enforce a 16 byte alignment
@@ -118,6 +123,8 @@ main (void)
SIZEOF_PTHREAD_MUTEX_T,
# if USE_16BYTE_ALIGNMENT
" int _x16_align __attribute__ ((aligned (16)));\n",
+# elif USE_DOUBLE_FOR_ALIGNMENT
+ " double _xd_align;\n",
# else
"",
# endif
--
More information about the Gnupg-devel
mailing list