All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] tools/configure: generate stubs and long-double 32-bit headers if needed
@ 2020-02-10  4:35 Christopher Clark
  2020-02-10  4:35 ` [Xen-devel] [PATCH 1/2] pygrub: fix python3 cross-compile: install with INSTALL_PYTHON_PROG Christopher Clark
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Christopher Clark @ 2020-02-10  4:35 UTC (permalink / raw)
  To: xen-devel; +Cc: Rich Persaud, Ian Jackson, Wei Liu

The gnu/stubs-32.h and bits/long-double-32.h headers are required to
build hvmloader but are not always available in 64-bit build
environments. To avoid introducing a build requirement on 32-bit
multilib generate versions of them from the 64-bit equivalent header.

This patch enables the removal of downstream patching that has been
carried in the Yocto/OpenEmbedded meta-virtualization layer since 2012.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 tools/configure    | 48 ++++++++++++++++++++++++++++++++++++++++++++++
 tools/configure.ac | 24 +++++++++++++++++++++++
 2 files changed, 72 insertions(+)

diff --git a/tools/configure b/tools/configure
index 977a8837c3..29cca6267a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9769,7 +9769,55 @@ else
   systemd=n
 fi
 
+# If 32-bit stubs header is not already available, check for the 64-bit one
+# and generate a 32-bit stubs header
+ac_fn_c_check_header_mongrel "$LINENO" "gnu/stubs-32.h" "ac_cv_header_gnu_stubs_32_h" "$ac_includes_default"
+if test "x$ac_cv_header_gnu_stubs_32_h" = xyes; then :
 
+else
+
+    ac_fn_c_check_header_mongrel "$LINENO" "gnu/stubs-64.h" "ac_cv_header_gnu_stubs_64_h" "$ac_includes_default"
+if test "x$ac_cv_header_gnu_stubs_64_h" = xyes; then :
+
+        echo '#include <gnu/stubs-64.h>' >conf-stubs.c
+        SIXTY_FOUR_HDR=`$CC -M conf-stubs.c | grep '/stubs-64.h$'`
+        rm conf-stubs.c
+        mkdir -p include/gnu
+        cat "${SIXTY_FOUR_HDR}" | \
+            grep -v 'stub_bdflush\|stub_getmsg\|stub_putmsg' >include/gnu/stubs-32.h
+        echo \#define __stub___kernel_cosl >> include/gnu/stubs-32.h
+        echo \#define __stub___kernel_sinl >> include/gnu/stubs-32.h
+        echo \#define __stub___kernel_tanl >> include/gnu/stubs-32.h
+
+else
+  as_fn_error $? "" "$LINENO" 5No gnu stubs headers found
+fi
+
+
+fi
+
+# If 32-bit long-double header is not already available, check for the 64-bit
+# one and copy it
+ac_fn_c_check_header_mongrel "$LINENO" "bits/long-double-32.h" "ac_cv_header_bits_long_double_32_h" "$ac_includes_default"
+if test "x$ac_cv_header_bits_long_double_32_h" = xyes; then :
+
+else
+
+     ac_fn_c_check_header_mongrel "$LINENO" "bits/long-double-64.h" "ac_cv_header_bits_long_double_64_h" "$ac_includes_default"
+if test "x$ac_cv_header_bits_long_double_64_h" = xyes; then :
+
+        echo '#include <bits/long-double-64.h>' >conf-double.c
+        SIXTY_FOUR_HDR=`$CC -M conf-double.c | grep '/long-double-64.h$'`
+        rm conf-double.c
+        mkdir -p include/bits
+        cat "${SIXTY_FOUR_HDR}" >include/bits/long-double-32.h
+
+else
+  as_fn_error $? "" "$LINENO" 5No long-double headers found
+fi
+
+
+fi
 
 if test "x$systemd" = "xy"; then :
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 8d86c42de8..769406e9ca 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -488,4 +488,28 @@ AC_ARG_ENABLE([pvshim],
 ])
 AC_SUBST(pvshim)
 
+# If 32-bit stubs header is not already available, check for the 64-bit one
+# and generate a 32-bit stubs header
+AC_CHECK_HEADER([gnu/stubs-32.h], [], [
+    AC_CHECK_HEADER([gnu/stubs-64.h], [
+        echo '#include <gnu/stubs-64.h>' >conf-stubs.c
+        SIXTY_FOUR_HDR=`$CC -M conf-stubs.c | grep '/stubs-64.h$'`
+        rm conf-stubs.c
+        mkdir -p include/gnu
+        cat "${SIXTY_FOUR_HDR}" | \
+            grep -v 'stub_bdflush\|stub_getmsg\|stub_putmsg' >include/gnu/stubs-32.h
+        echo \#define __stub___kernel_cosl >> include/gnu/stubs-32.h
+        echo \#define __stub___kernel_sinl >> include/gnu/stubs-32.h
+        echo \#define __stub___kernel_tanl >> include/gnu/stubs-32.h
+    ], [AC_MSG_ERROR[No gnu stubs headers found]], []) ], [])
+
+AC_CHECK_HEADER([bits/long-double-32.h], [], [
+     AC_CHECK_HEADER([bits/long-double-64.h], [
+        echo '#include <bits/long-double-64.h>' >conf-double.c
+        SIXTY_FOUR_HDR=`$CC -M conf-double.c | grep '/long-double-64.h$'`
+        rm conf-double.c
+        mkdir -p include/bits
+        cat "${SIXTY_FOUR_HDR}" >include/bits/long-double-32.h
+    ], [AC_MSG_ERROR[No long-double headers found]], []) ], [])
+
 AC_OUTPUT()
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2020-02-24  5:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-10  4:35 [Xen-devel] [PATCH] tools/configure: generate stubs and long-double 32-bit headers if needed Christopher Clark
2020-02-10  4:35 ` [Xen-devel] [PATCH 1/2] pygrub: fix python3 cross-compile: install with INSTALL_PYTHON_PROG Christopher Clark
2020-02-10 16:16   ` Ian Jackson
2020-02-10  4:35 ` [Xen-devel] [PATCH 2/2] python, pygrub: pass DISTUTILS env vars as setup.py args Christopher Clark
2020-02-10 16:10   ` Ian Jackson
2020-02-10 12:42 ` [Xen-devel] [PATCH] tools/configure: generate stubs and long-double 32-bit headers if needed Roger Pau Monné
2020-02-10 16:21 ` Ian Jackson
2020-02-24  5:37   ` Christopher Clark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.