Skip to contentSkip to conversation

Handle __mips64 as __mips64__ to avoid build failure

PATCH In review HAGIO KAZUHITO(萩尾 一仁) 1 participant 2 messages Nov 24, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Handle __mips64 as __mips64__ to avoid build failure

From: Fabrice Fontaine <[email protected]>

Handle __mips64 as __mips64__ to avoid the following build failure:

makedumpfile.c: In function 'is_kvaddr':
makedumpfile.c:1613:39: error: 'KVBASE' undeclared (first use in this function)

   return (addr >= (unsigned long long)(KVBASE));
                                        ^~~~~~

Fixes:
- http://autobuild.buildroot.org/results/94824fa8baa8edb99a5ca245e5561e0c4e430638

---
  arch/mips64.c  | 2 +-
  makedumpfile.h | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips64.c +1 -1
index ab45b6e..fd987b0 100644
@@ -16,7 +16,7 @@
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */
-#ifdef __mips64__
+#if defined(__mips64__) || defined(__mips64)
  
  #include "../print_info.h"
  #include "../elf_info.h"
makedumpfile.h +3 -3
index 70a1a91..3842f9c 100644
@@ -963,7 +963,7 @@ typedef unsigned long pgd_t;
  
  #endif          /* sparc64 */
  
-#ifdef __mips64__ /* mips64 */
+#if defined(__mips64__) || defined(__mips64) /* mips64 */
  #define KVBASE			PAGE_OFFSET
  
  #ifndef _XKPHYS_START_ADDR
@@ -1204,7 +1204,7 @@ unsigned long long vaddr_to_paddr_sparc64(unsigned long vaddr);
  #define arch_crashkernel_mem_size()	stub_false()
  #endif		/* sparc64 */
  
-#ifdef __mips64__ /* mips64 */
+#if defined(__mips64__) || defined(__mips64) /* mips64 */
  int get_phys_base_mips64(void);
  int get_machdep_info_mips64(void);
  int get_versiondep_info_mips64(void);
@@ -2364,7 +2364,7 @@ int get_xen_info_ia64(void);
  #define get_xen_info_arch(X) FALSE
  #endif	/* sparc64 */
  
-#ifdef __mips64__ /* mips64 */
+#if defined(__mips64__) || defined(__mips64) /* mips64 */
  #define kvtop_xen(X)	FALSE
  #define get_xen_basic_info_arch(X) FALSE
  #define get_xen_info_arch(X) FALSE

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 11 lines · HAGIO KAZUHITO(萩尾 一仁)

From: Fabrice Fontaine <[email protected]>

Handle __mips64 as __mips64__ to avoid the following build failure:

makedumpfile.c: In function 'is_kvaddr':
makedumpfile.c:1613:39: error: 'KVBASE' undeclared (first use in this function)

    return (addr >= (unsigned long long)(KVBASE));
                                         ^~~~~~

Fixes:
- http://autobuild.buildroot.org/results/94824fa8baa8edb99a5ca245e5561e0c4e430638

makedumpfile has to use only the "__arch__" style to enable TARGET build, e.g. "make TARGET=mips64" on an x86_64 machine.

Your build environment has "-D__mips64el__", so does this work for you?

Makefile +2 -1
@@ -24,7 +24,8 @@ endif
  ARCH := $(shell echo ${TARGET}  | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
  				-e s/arm.*/arm/ -e s/sa110/arm/ \
  				-e s/s390x/s390/ -e s/parisc64/parisc/ \
-				-e s/ppc64/powerpc64/ -e s/ppc/powerpc32/)
+				-e s/ppc64/powerpc64/ -e s/ppc/powerpc32/ \
+				-e s/mips64el/mips64/)
 
  CROSS :=
  ifneq ($(TARGET), $(HOST_ARCH))

Thanks,
Kazu

Quoted 51 lines
---
   arch/mips64.c  | 2 +-
   makedumpfile.h | 6 +++---
   2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips64.c +1 -1
index ab45b6e..fd987b0 100644
@@ -16,7 +16,7 @@
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    */
-#ifdef __mips64__
+#if defined(__mips64__) || defined(__mips64)
 
   #include "../print_info.h"
   #include "../elf_info.h"
makedumpfile.h +3 -3
index 70a1a91..3842f9c 100644
@@ -963,7 +963,7 @@ typedef unsigned long pgd_t;
 
   #endif          /* sparc64 */
 
-#ifdef __mips64__ /* mips64 */
+#if defined(__mips64__) || defined(__mips64) /* mips64 */
   #define KVBASE			PAGE_OFFSET
 
   #ifndef _XKPHYS_START_ADDR
@@ -1204,7 +1204,7 @@ unsigned long long vaddr_to_paddr_sparc64(unsigned long vaddr);
   #define arch_crashkernel_mem_size()	stub_false()
   #endif		/* sparc64 */
 
-#ifdef __mips64__ /* mips64 */
+#if defined(__mips64__) || defined(__mips64) /* mips64 */
   int get_phys_base_mips64(void);
   int get_machdep_info_mips64(void);
   int get_versiondep_info_mips64(void);
@@ -2364,7 +2364,7 @@ int get_xen_info_ia64(void);
   #define get_xen_info_arch(X) FALSE
   #endif	/* sparc64 */
 
-#ifdef __mips64__ /* mips64 */
+#if defined(__mips64__) || defined(__mips64) /* mips64 */
   #define kvtop_xen(X)	FALSE
   #define get_xen_basic_info_arch(X) FALSE
   #define get_xen_info_arch(X) FALSE
Quoted 4 lines

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec