mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
filearch: Add s390 and s390x detection and tests.
Unfortunately I was unable to build s390 binaries since multilib was dropped in Fedora 24 on s390x. Going from the source of the 'file' command it seems as if it prints "32-bit" (the architecture is really 31 bit).
This commit is contained in:
@@ -797,6 +797,8 @@ to specify the QEMU interface emulation to use at run time." };
|
||||
[["file_architecture"; "/bin-ppc64le-dynamic"]], "ppc64le"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
[["file_architecture"; "/bin-riscv64-dynamic"]], "riscv64"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
[["file_architecture"; "/bin-s390x-dynamic"]], "s390x"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
[["file_architecture"; "/bin-sparc-dynamic"]], "sparc"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
@@ -817,6 +819,8 @@ to specify the QEMU interface emulation to use at run time." };
|
||||
[["file_architecture"; "/lib-ppc64le.so"]], "ppc64le"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
[["file_architecture"; "/lib-riscv64.so"]], "riscv64"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
[["file_architecture"; "/lib-s390x.so"]], "s390x"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
[["file_architecture"; "/lib-sparc.so"]], "sparc"), [];
|
||||
InitISOFS, Always, TestResultString (
|
||||
@@ -880,6 +884,14 @@ Intel Itanium.
|
||||
|
||||
RISC-V 32-, 64- or 128-bit variants.
|
||||
|
||||
=item \"s390\"
|
||||
|
||||
31 bit IBM S/390.
|
||||
|
||||
=item \"s390x\"
|
||||
|
||||
64 bit IBM S/390.
|
||||
|
||||
=item \"sparc\"
|
||||
|
||||
32 bit SPARC.
|
||||
|
||||
@@ -102,6 +102,16 @@ canonical_elf_arch (guestfs_h *g,
|
||||
ret = safe_asprintf (g, "riscv%s", bits);
|
||||
goto no_strdup;
|
||||
}
|
||||
else if (strstr (elf_arch, "IBM S/390")) {
|
||||
if (STREQ (bits, "32"))
|
||||
r = "s390";
|
||||
else if (STREQ (bits, "64"))
|
||||
r = "s390x";
|
||||
else {
|
||||
error (g, "file_architecture: unknown S/390 bit size: %s", bits);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
r = elf_arch;
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ image_files = \
|
||||
$(srcdir)/binaries/bin-ppc64-dynamic \
|
||||
$(srcdir)/binaries/bin-ppc64le-dynamic \
|
||||
$(srcdir)/binaries/bin-riscv64-dynamic \
|
||||
$(srcdir)/binaries/bin-s390x-dynamic \
|
||||
$(srcdir)/binaries/bin-sparc-dynamic \
|
||||
$(srcdir)/binaries/bin-win32.exe \
|
||||
$(srcdir)/binaries/bin-win64.exe \
|
||||
@@ -54,6 +55,7 @@ image_files = \
|
||||
$(srcdir)/binaries/lib-ppc64.so \
|
||||
$(srcdir)/binaries/lib-ppc64le.so \
|
||||
$(srcdir)/binaries/lib-riscv64.so \
|
||||
$(srcdir)/binaries/lib-s390x.so \
|
||||
$(srcdir)/binaries/lib-sparc.so \
|
||||
$(srcdir)/binaries/lib-win32.dll \
|
||||
$(srcdir)/binaries/lib-win64.dll \
|
||||
|
||||
@@ -27,6 +27,7 @@ EXTRA_DIST = \
|
||||
bin-ppc64-dynamic \
|
||||
bin-ppc64le-dynamic \
|
||||
bin-riscv64-dynamic \
|
||||
bin-s390x-dynamic \
|
||||
bin-sparc-dynamic \
|
||||
bin-win32.exe \
|
||||
bin-win64.exe \
|
||||
@@ -39,6 +40,7 @@ EXTRA_DIST = \
|
||||
lib-ppc64le.so \
|
||||
lib-mipsel.so \
|
||||
lib-riscv64.so \
|
||||
lib-s390x.so \
|
||||
lib-sparc.so \
|
||||
lib-win32.dll \
|
||||
lib-win64.dll \
|
||||
|
||||
BIN
test-data/binaries/bin-s390x-dynamic
Executable file
BIN
test-data/binaries/bin-s390x-dynamic
Executable file
Binary file not shown.
BIN
test-data/binaries/lib-s390x.so
Executable file
BIN
test-data/binaries/lib-s390x.so
Executable file
Binary file not shown.
Reference in New Issue
Block a user