[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/7] mkimage: make it easier to run syntax checkers on grub-mk
From: |
Peter Jones |
Subject: |
[PATCH v3 2/7] mkimage: make it easier to run syntax checkers on grub-mkimagexx.c |
Date: |
Wed, 21 Feb 2018 15:20:24 -0500 |
This makes it so you can treat grub-mkimagexx.c as a file you can build
directly, so syntax checkers like vim's "syntastic" plugin, which uses
"gcc -x c -fsyntax-only" to build it, will work.
One still has to do whatever setup is required to make it pick the right
include dirs, which -W options we use, etc., but this makes it so you
can do the checking on the file you're editing, rather than on a
different file.
Signed-off-by: Peter Jones <address@hidden>
---
util/grub-mkimage32.c | 2 ++
util/grub-mkimage64.c | 2 ++
util/grub-mkimagexx.c | 9 +++++++++
3 files changed, 13 insertions(+)
diff --git a/util/grub-mkimage32.c b/util/grub-mkimage32.c
index 9b31397bc40..1f2ccccd225 100644
--- a/util/grub-mkimage32.c
+++ b/util/grub-mkimage32.c
@@ -19,4 +19,6 @@
# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val)
#define XEN_NOTE_SIZE 132
+#ifndef GRUB_MKIMAGEXX
#include "grub-mkimagexx.c"
+#endif
diff --git a/util/grub-mkimage64.c b/util/grub-mkimage64.c
index d8334592470..4ff72a625e0 100644
--- a/util/grub-mkimage64.c
+++ b/util/grub-mkimage64.c
@@ -19,4 +19,6 @@
# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val)
#define XEN_NOTE_SIZE 120
+#ifndef GRUB_MKIMAGEXX
#include "grub-mkimagexx.c"
+#endif
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index a2bb05439f0..10d7b41e3bf 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -50,6 +50,15 @@
#pragma GCC diagnostic ignored "-Wcast-align"
+#define GRUB_MKIMAGEXX
+#if !defined(MKIMAGE_ELF32) && !defined(MKIMAGE_ELF64)
+#if __SIZEOF_POINTER__ == 8
+#include "grub-mkimage64.c"
+#else
+#include "grub-mkimage32.c"
+#endif
+#endif
+
/* These structures are defined according to the CHRP binding to IEEE1275,
"Client Program Format" section. */
--
2.15.0
- [PATCH v2 2/3] mkimage: avoid copying relocations for sections that won't be copied., (continued)
- Re: [PATCH v2 1/3] mkimage: refactor a bunch of section data into a struct., Daniel Kiper, 2018/02/21
- Re: [PATCH v2 1/3] mkimage: refactor a bunch of section data into a struct., Peter Jones, 2018/02/21
- [PATCH v3 1/7] aout.h: Fix missing include., Peter Jones, 2018/02/21
- [PATCH v3 7/7] .mod files: Strip annobin annotations and .eh_frame, and their relocations, Peter Jones, 2018/02/21
- Re: [PATCH v3 7/7] .mod files: Strip annobin annotations and .eh_frame, and their relocations, Daniel Kiper, 2018/02/23
- Re: [PATCH v3 7/7] .mod files: Strip annobin annotations and .eh_frame, and their relocations, Daniel Kiper, 2018/02/23
- [PATCH v3 3/7] mkimage: rename a couple of things to be less confusing later., Peter Jones, 2018/02/21
- Re: [PATCH v3 3/7] mkimage: rename a couple of things to be less confusing later., Daniel Kiper, 2018/02/23
- [PATCH v3 2/7] mkimage: make it easier to run syntax checkers on grub-mkimagexx.c,
Peter Jones <=
- Re: [PATCH v3 2/7] mkimage: make it easier to run syntax checkers on grub-mkimagexx.c, Daniel Kiper, 2018/02/23
- [PATCH v3 4/7] mkimage: make locate_sections() set up vaddresses as well., Peter Jones, 2018/02/21
- Re: [PATCH v3 4/7] mkimage: make locate_sections() set up vaddresses as well., Daniel Kiper, 2018/02/23
- [PATCH v3 5/7] mkimage: refactor a bunch of section data into a struct., Peter Jones, 2018/02/21
- Re: [PATCH v3 5/7] mkimage: refactor a bunch of section data into a struct., Daniel Kiper, 2018/02/23
- Re: [PATCH v3 5/7] mkimage: refactor a bunch of section data into a struct., Peter Jones, 2018/02/23
- [PATCH v3 6/7] mkimage: avoid copying relocations for sections that won't be copied., Peter Jones, 2018/02/21
- Re: [PATCH v3 6/7] mkimage: avoid copying relocations for sections that won't be copied., Daniel Kiper, 2018/02/23
- Re: [PATCH v3 1/7] aout.h: Fix missing include., Daniel Kiper, 2018/02/23
Re: [PATCH 1/2] mkimage: avoid copying relocations for sections that won't be copied., Peter Jones, 2018/02/20