Skip to contentSkip to conversation

mkelf32: fix compilation on 32 bit build host

PATCH In review Wei Liu 3 participants 4 messages Apr 29, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 mkelf32: fix compilation on 32 bit build host

When cross-compiling xen on a 32 bit build host:

boot/mkelf32.c: In function 'main':
boot/mkelf32.c:360:21: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'Elf64_Off' [-Werror=format]
cc1: all warnings being treated as errors

Fix that by using PRId64 in format string.

---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/boot/mkelf32.c +1 -1
index 8c51990..6cfa312 100644
@@ -356,7 +356,7 @@ int main(int argc, char **argv)
         if ( in64_phdr.p_offset > dat_siz || offset > in64_phdr.p_offset )
         {
             fprintf(stderr, "Expected .note section within .text section!\n" \
-                    "Offset %ld not within %d!\n",
+                    "Offset %"PRId64" not within %d!\n",
                     in64_phdr.p_offset, dat_siz);
             return 1;
         }
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Wei Liu

When cross-compiling xen on a 32 bit build host:

boot/mkelf32.c: In function 'main':
boot/mkelf32.c:360:21: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'Elf64_Off' [-Werror=format]
cc1: all warnings being treated as errors

Fix that by using PRId64 in format string.

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

Tested-by on v1 1/1
#2 lore raw
In reply to Wei Liu
Quoted 9 lines · Wei Liu

When cross-compiling xen on a 32 bit build host:

boot/mkelf32.c: In function 'main':
boot/mkelf32.c:360:21: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'Elf64_Off' [-Werror=format]
cc1: all warnings being treated as errors

Fix that by using PRId64 in format string.

and Reviewed-by too if you want that.

Quoted 20 lines
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/boot/mkelf32.c +1 -1
index 8c51990..6cfa312 100644
@@ -356,7 +356,7 @@ int main(int argc, char **argv)
         if ( in64_phdr.p_offset > dat_siz || offset > in64_phdr.p_offset )
         {
             fprintf(stderr, "Expected .note section within .text section!\n" \
-                    "Offset %ld not within %d!\n",
+                    "Offset %"PRId64" not within %d!\n",
                     in64_phdr.p_offset, dat_siz);
             return 1;
         }
Signature · 1 line
2.1.4

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

author
#3 lore raw
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Wei Liu

When cross-compiling xen on a 32 bit build host:

boot/mkelf32.c: In function 'main':
boot/mkelf32.c:360:21: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'Elf64_Off' [-Werror=format]
cc1: all warnings being treated as errors

Quoted 7 lines
Quoted 3 lines

Fix that by using PRId64 in format string.

and Reviewed-by too if you want that.

(Feel a bit silly to do this to my own patch)

Please push it when convenient.

Quoted 4 lines
Quoted 4 lines
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 16 lines
xen/arch/x86/boot/mkelf32.c +1 -1
index 8c51990..6cfa312 100644
@@ -356,7 +356,7 @@ int main(int argc, char **argv)
         if ( in64_phdr.p_offset > dat_siz || offset > in64_phdr.p_offset )
         {
             fprintf(stderr, "Expected .note section within .text section!\n" \
-                    "Offset %ld not within %d!\n",
+                    "Offset %"PRId64" not within %d!\n",
                     in64_phdr.p_offset, dat_siz);
             return 1;
         }
Signature · 1 line
2.1.4

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