Skip to contentSkip to conversation

libxl/arm: Fix build on arm64 + acpi

PATCH In review Daniel Sabogal 2 participants 4 messages Aug 25, 2017 – Aug 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl/arm: Fix build on arm64 + acpi

With musl, the build fails with the following errors:

actypes.h:202:2: error: #error unknown ACPI_MACHINE_WIDTH
#error unknown ACPI_MACHINE_WIDTH

    ^~~~~
  actypes.h:207:9: error: unknown type name ‘acpi_native_uint’
   typedef acpi_native_uint acpi_size;
           ^~~~~~~~~~~~~~~~
  actypes.h:617:3: error: unknown type name ‘acpi_io_address’
     acpi_io_address pblk_address;
     ^~~~~~~~~~~~~~~

This likely went undetected with glibc builds since glibc indirectly pulls __BITS_PER_LONG from the linux headers through a standard header. For musl, this is not the case.

Instead, use BITS_PER_LONG to fix the build.

---
 tools/libxl/libxl_arm_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_arm_acpi.c +1 -1
index a6456be662..636f724039 100644
@@ -37,7 +37,7 @@ typedef int64_t s64;
 #define BITS_PER_LONG 32
 #endif
 #endif
-#define ACPI_MACHINE_WIDTH __BITS_PER_LONG
+#define ACPI_MACHINE_WIDTH BITS_PER_LONG
 #define COMPILER_DEPENDENT_INT64 int64_t
 #define COMPILER_DEPENDENT_UINT64 uint64_t
 
Signature · 7 lines
2.14.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Daniel Sabogal

With musl, the build fails with the following errors:

actypes.h:202:2: error: #error unknown ACPI_MACHINE_WIDTH
#error unknown ACPI_MACHINE_WIDTH

    ^~~~~
  actypes.h:207:9: error: unknown type name ‘acpi_native_uint’
   typedef acpi_native_uint acpi_size;
           ^~~~~~~~~~~~~~~~
  actypes.h:617:3: error: unknown type name ‘acpi_io_address’
     acpi_io_address pblk_address;
     ^~~~~~~~~~~~~~~
Quoted 7 lines

This likely went undetected with glibc builds since glibc indirectly pulls __BITS_PER_LONG from the linux headers through a standard header. For musl, this is not the case.

Instead, use BITS_PER_LONG to fix the build.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 17 lines · Wei Liu
Quoted 16 lines · Daniel Sabogal

With musl, the build fails with the following errors:

actypes.h:202:2: error: #error unknown ACPI_MACHINE_WIDTH
#error unknown ACPI_MACHINE_WIDTH

    ^~~~~
  actypes.h:207:9: error: unknown type name ‘acpi_native_uint’
   typedef acpi_native_uint acpi_size;
           ^~~~~~~~~~~~~~~~
  actypes.h:617:3: error: unknown type name ‘acpi_io_address’
     acpi_io_address pblk_address;
     ^~~~~~~~~~~~~~~

This likely went undetected with glibc builds since glibc indirectly pulls __BITS_PER_LONG from the linux headers through a standard header. For musl, this is not the case.

Quoted 5 lines
Quoted 3 lines

Instead, use BITS_PER_LONG to fix the build.

Now applied.

Ian, please backport this.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw

CC Ian

Quoted 20 lines · Wei Liu
Quoted 19 lines · Wei Liu
Quoted 18 lines · Daniel Sabogal

With musl, the build fails with the following errors:

actypes.h:202:2: error: #error unknown ACPI_MACHINE_WIDTH
#error unknown ACPI_MACHINE_WIDTH

    ^~~~~
  actypes.h:207:9: error: unknown type name ‘acpi_native_uint’
   typedef acpi_native_uint acpi_size;
           ^~~~~~~~~~~~~~~~
  actypes.h:617:3: error: unknown type name ‘acpi_io_address’
     acpi_io_address pblk_address;
     ^~~~~~~~~~~~~~~

This likely went undetected with glibc builds since glibc indirectly pulls __BITS_PER_LONG from the linux headers through a standard header. For musl, this is not the case.

Instead, use BITS_PER_LONG to fix the build.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Now applied.

Ian, please backport this.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel