Skip to contentSkip to conversation

Fix ia64 tools build

PATCH In review KUWAMURA Shin'ya 3 participants 9 messages Sep 2, 2010 – Nov 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix ia64 tools build

Hi,

22066:eccfdeb41b80 replaced tools/libxc/ia64/aclinux.h with xen/include/acpi/platform/aclinux.h.

In fact, the former differs from the latter: the former supports non-kernel codes, but the latter does not support it because 17814:9af7a535225f removed it.

Thus tools cannot be built on ia64.

This patch adds #ifdef __XEN__ and copies non-kernel support codes in the former.

Signature · 1 line
  KUWAMURA Shin'ya

# HG changeset patch
# User KUWAMURA Shin'ya <[email protected]> # Date 1283396295 -32400
# Node ID 6367f64a1c3529ac2702bfa498cc2500db39ec65 # Parent c7405a5e2d6df9dcc9c0344da47f45ea8c884b23 Fix ia64 tools build

22066:eccfdeb41b80 replaced tools/libxc/ia64/aclinux.h with xen/include/acpi/platform/aclinux.h.

In fact, the former differs from the latter: the former supports non-kernel codes, but the latter does not support it because 17814:9af7a535225f removed it.

Thus tools cannot be built on ia64.

This patch adds #ifdef __XEN__ and copies non-kernel support codes in the former.

xen/include/acpi/platform/aclinux.h +46 -0
diff -r c7405a5e2d6d -r 6367f64a1c35 xen/include/acpi/platform/aclinux.h
@@ -47,6 +47,8 @@
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
 
+#ifdef __XEN__
+
 #include <xen/config.h>
 #include <xen/cache.h>
 #include <xen/string.h>
@@ -70,6 +72,50 @@
 /* Full namespace pathname length limit - arbitrary */
 #define ACPI_PATHNAME_MAX              256
 
+#else /* !__XEN__ */
+
+#include <stdarg.h>
+#include <string.h>
+//#include <stdlib.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#if defined(__ia64__) || defined(__x86_64__)
+#define ACPI_MACHINE_WIDTH          64
+#define COMPILER_DEPENDENT_INT64    long
+#define COMPILER_DEPENDENT_UINT64   unsigned long
+#else
+#define ACPI_MACHINE_WIDTH          32
+#define COMPILER_DEPENDENT_INT64    long long
+#define COMPILER_DEPENDENT_UINT64   unsigned long long
+#define ACPI_USE_NATIVE_DIVIDE
+#endif
+
+typedef int8_t		s8;
+typedef uint8_t		u8;
+typedef int16_t		s16;
+typedef uint16_t	u16;
+typedef int32_t		s32;
+typedef uint32_t	u32;
+typedef int64_t		s64;
+typedef uint64_t	u64;
+#define __iomem
+#ifdef __ia64__
+#ifdef __cplusplus
+#define CPP_ASMLINKAGE extern "C"
+#else
+#define CPP_ASMLINKAGE
+#endif
+#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
+#endif
+#define CONFIG_ACPI_BOOT	1
+
+#define __cdecl
+#define ACPI_FLUSH_CPU_CACHE()
+#endif /* __XEN__ */
+
+/* Linux uses GCC */
+
 #include "acgcc.h"
 
 #define acpi_cpu_flags unsigned long

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Ping?

This patch is still required for ia64 tools.

Best regards,

Signature · 3 lines
  KUWAMURA Shin'ya

On <[email protected]>
Quoted 18 lines · KUWAMURA Shin'ya

Hi,

22066:eccfdeb41b80 replaced tools/libxc/ia64/aclinux.h with xen/include/acpi/platform/aclinux.h.

In fact, the former differs from the latter: the former supports non-kernel codes, but the latter does not support it because 17814:9af7a535225f removed it.

Thus tools cannot be built on ia64.

This patch adds #ifdef __XEN__ and copies non-kernel support codes in the former.

Signature · 1 line
  KUWAMURA Shin'ya
Signature · 1 line
  KUWAMURA Shin'ya

# HG changeset patch
# User KUWAMURA Shin'ya <[email protected]> # Date 1283396295 -32400
# Node ID 6367f64a1c3529ac2702bfa498cc2500db39ec65 # Parent c7405a5e2d6df9dcc9c0344da47f45ea8c884b23 Fix ia64 tools build

22066:eccfdeb41b80 replaced tools/libxc/ia64/aclinux.h with xen/include/acpi/platform/aclinux.h.

In fact, the former differs from the latter: the former supports non-kernel codes, but the latter does not support it because 17814:9af7a535225f removed it.

Thus tools cannot be built on ia64.

This patch adds #ifdef __XEN__ and copies non-kernel support codes in the former.

xen/include/acpi/platform/aclinux.h +46 -0
diff -r c7405a5e2d6d -r 6367f64a1c35 xen/include/acpi/platform/aclinux.h
@@ -47,6 +47,8 @@
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
 
+#ifdef __XEN__
+
 #include <xen/config.h>
 #include <xen/cache.h>
 #include <xen/string.h>
@@ -70,6 +72,50 @@
 /* Full namespace pathname length limit - arbitrary */
 #define ACPI_PATHNAME_MAX              256
 
+#else /* !__XEN__ */
+
+#include <stdarg.h>
+#include <string.h>
+//#include <stdlib.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#if defined(__ia64__) || defined(__x86_64__)
+#define ACPI_MACHINE_WIDTH          64
+#define COMPILER_DEPENDENT_INT64    long
+#define COMPILER_DEPENDENT_UINT64   unsigned long
+#else
+#define ACPI_MACHINE_WIDTH          32
+#define COMPILER_DEPENDENT_INT64    long long
+#define COMPILER_DEPENDENT_UINT64   unsigned long long
+#define ACPI_USE_NATIVE_DIVIDE
+#endif
+
+typedef int8_t		s8;
+typedef uint8_t		u8;
+typedef int16_t		s16;
+typedef uint16_t	u16;
+typedef int32_t		s32;
+typedef uint32_t	u32;
+typedef int64_t		s64;
+typedef uint64_t	u64;
+#define __iomem
+#ifdef __ia64__
+#ifdef __cplusplus
+#define CPP_ASMLINKAGE extern "C"
+#else
+#define CPP_ASMLINKAGE
+#endif
+#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
+#endif
+#define CONFIG_ACPI_BOOT	1
+
+#define __cdecl
+#define ACPI_FLUSH_CPU_CACHE()
+#endif /* __XEN__ */
+
+/* Linux uses GCC */
+
 #include "acgcc.h"
 
 #define acpi_cpu_flags unsigned long

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 5 lines · KUWAMURA Shin'ya

Ping?

This patch is still required for ia64 tools.

Best regards,

I think it would ne neater to have your own tools/libxc/ia64/ac_ia64_tools.h, and then conditionally include that from Xen's acenv.h (e.g., dependent on __XEN_TOOLS__). Or revert the bits of c/s 22066 that broke the ia64 build in the first place -- possibly the changes were based on a false assumption? Cc'ing the author of that patch, Ian Campbell. In any case, ifdef'ing the bulk of aclinux.h is just gross, I don't like that fix.

-- Keir

#3 lore raw
Quoted 6 lines · Keir Fraser
Quoted 4 lines · KUWAMURA Shin'ya

Ping?

This patch is still required for ia64 tools.

Quoted 7 lines
Quoted 1 line

Best regards,

I think it would ne neater to have your own tools/libxc/ia64/ac_ia64_tools.h, and then conditionally include that from Xen's acenv.h (e.g., dependent on __XEN_TOOLS__). Or revert the bits of c/s 22066 that broke the ia64 build in the first place -- possibly the changes were based on a false assumption?

Yeah, I thought it was unused. I may have confused it with tools/libxc/ia64/acpi/platform/aclinux.h which is in fact just a symlink to xen/include/acpi/platform/aclinux.h.

Note that tools/libxc is now licensed as LGPL so before simply reinstating the old file it probably needs to be confirmed that it is ok to license that way. (that said the contents of the file don't seem particularly exciting, a cleanroom rewrite based on compiling and observing the errors would be pretty trivial)

Quoted 3 lines

Cc'ing the author of that patch, Ian
Campbell. In any case, ifdef'ing the bulk of aclinux.h is just gross, I don't like that fix.

Why do we even need what appears to be a simplistic OS abstraction layer in the tools first place?

Ian.

#4 lore raw
In reply to Keir Fraser

Hi Keir and Ian,

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On Fri, 29 Oct 2010 08:55:31 +0100
[email protected](Keir Fraser) said:

I think it would ne neater to have your own tools/libxc/ia64/ac_ia64_tools.h, and then conditionally include that from Xen's acenv.h (e.g., dependent on __XEN_TOOLS__).

I created a patch for Keir's first advice.

This patch introduces ac_ia64_tools.h and it only defines identifiers in order to avoid compilation errors.

Because all identifiers can be easily led from the error message, it is trivial.

Any comments?

Best regards,

Signature · 1 line
  KUWAMURA Shin'ya
tools/libxc/ia64/ac_ia64_tools.h new file +17 -0
diff -r bbffb400f507 tools/libxc/ia64/ac_ia64_tools.h
@@ -0,0 +1,17 @@
+#ifndef AC_IA64_TOOLS_H
+#define AC_IA64_TOOLS_H
+
+#define ACPI_MACHINE_WIDTH 64
+#define COMPILER_DEPENDENT_UINT64 unsigned long long
+#define COMPILER_DEPENDENT_INT64 long long
+typedef unsigned long long u64;
+typedef long long s64;
+typedef unsigned u32;
+typedef int s32;
+typedef unsigned char u8;
+typedef unsigned short u16;
+#define __iomem
+#define asmlinkage
+#define CONFIG_ACPI_BOOT
+
+#endif /* AC_IA64_TOOLS_H */
xen/include/acpi/platform/acenv.h +3 -1
diff -r bbffb400f507 xen/include/acpi/platform/acenv.h
@@ -136,7 +136,9 @@
 
 /*! [Begin] no source code translation */
 
-#if 1/*defined(_LINUX) || defined(__linux__)*/
+#if defined(__XEN_TOOLS__) && defined(__ia64__)
+#include "ac_ia64_tools.h"
+#elif 1 /*defined(_LINUX) || defined(__linux__)*/
 #include "aclinux.h"
 
 #elif defined(_AED_EFI)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
Quoted 11 lines · KUWAMURA Shin'ya

Hi Keir and Ian,

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On Fri, 29 Oct 2010 08:55:31 +0100
[email protected](Keir Fraser) said:

I think it would ne neater to have your own tools/libxc/ia64/ac_ia64_tools.h, and then conditionally include that from Xen's acenv.h (e.g., dependent on __XEN_TOOLS__).

I created a patch for Keir's first advice.

Quoted 7 lines

This patch introduces ac_ia64_tools.h and it only defines identifiers in order to avoid compilation errors.

Because all identifiers can be easily led from the error message, it is trivial.

Any comments?

I'll apply this if IanC finds it acceptable.

-- Keir

Quoted 1 line

Best regards,

#6 lore raw
Quoted 16 lines · Keir Fraser
Quoted 14 lines · KUWAMURA Shin'ya

Hi Keir and Ian,

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On Fri, 29 Oct 2010 08:55:31 +0100
[email protected](Keir Fraser) said:

I think it would ne neater to have your own tools/libxc/ia64/ac_ia64_tools.h, and then conditionally include that from Xen's acenv.h (e.g., dependent on __XEN_TOOLS__).

I created a patch for Keir's first advice.

This patch introduces ac_ia64_tools.h and it only defines identifiers in order to avoid compilation errors.

Quoted 6 lines
Quoted 4 lines

Because all identifiers can be easily led from the error message, it is trivial.

Any comments?

I'll apply this if IanC finds it acceptable.

Subject to the addition of a license boiler plate at the top of ltools/libxc/ia64/ac_ia64_tools.h, either the LGPLv2 one used through out libxc or something compatible, it is fine with me.

Ian.

Quoted 6 lines

-- Keir

Quoted 1 line

Best regards,

#7 lore raw
Quoted 5 lines · Ian Campbell
Quoted 1 line

I'll apply this if IanC finds it acceptable.

Subject to the addition of a license boiler plate at the top of ltools/libxc/ia64/ac_ia64_tools.h, either the LGPLv2 one used through out libxc or something compatible, it is fine with me.

Kuwamura,

Please fix that and then I will apply the patch.

Thanks,
Keir

#8 lore raw

Hi,

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On Mon, 01 Nov 2010 09:48:41 +0000
[email protected](Keir Fraser) said:

On 01/11/2010 09:28, "Ian Campbell" <[email protected]> wrote:

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

I'll apply this if IanC finds it acceptable.

Subject to the addition of a license boiler plate at the top of ltools/libxc/ia64/ac_ia64_tools.h, either the LGPLv2 one used through out libxc or something compatible, it is fine with me.

Please fix that and then I will apply the patch.

I added LGPLv2 license boiler plate.

Best regards,

Signature · 1 line
  KUWAMURA Shin'ya

# HG changeset patch
# User KUWAMURA Shin'ya <[email protected]> # Date 1288657800 -32400
# Node ID 6f6ab71e600e48ed5bfc05c313cef1a7263e1e83 # Parent bbffb400f50787e334ed11301119f702fa146e12 Fix ia64 tools build

22066:eccfdeb41b80 replaced tools/libxc/ia64/aclinux.h with xen/include/acpi/platform/aclinux.h.
Because both are incompatible, tools cannot be built on ia64.

This patch fixes compilation errors by defining identifiers at ac_ia64_tools.h.

tools/libxc/ia64/ac_ia64_tools.h new file +46 -0
diff -r bbffb400f507 -r 6f6ab71e600e tools/libxc/ia64/ac_ia64_tools.h
@@ -0,0 +1,46 @@
+/*
+ * ac_ia64_tools.h
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef AC_IA64_TOOLS_H
+#define AC_IA64_TOOLS_H
+
+#define ACPI_MACHINE_WIDTH 64
+#define COMPILER_DEPENDENT_UINT64 unsigned long long
+#define COMPILER_DEPENDENT_INT64 long long
+typedef unsigned long long u64;
+typedef long long s64;
+typedef unsigned u32;
+typedef int s32;
+typedef unsigned char u8;
+typedef unsigned short u16;
+#define __iomem
+#define asmlinkage
+#define CONFIG_ACPI_BOOT
+
+#endif /* AC_IA64_TOOLS_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
xen/include/acpi/platform/acenv.h +3 -1
diff -r bbffb400f507 -r 6f6ab71e600e xen/include/acpi/platform/acenv.h
@@ -136,7 +136,9 @@
 
 /*! [Begin] no source code translation */
 
-#if 1/*defined(_LINUX) || defined(__linux__)*/
+#if defined(__XEN_TOOLS__) && defined(__ia64__)
+#include "ac_ia64_tools.h"
+#elif 1 /*defined(_LINUX) || defined(__linux__)*/
 #include "aclinux.h"
 
 #elif defined(_AED_EFI)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel