浏览代码

The following fixes a couple GCC specifics for the ARM platform,
that MSVC compilers will complain about (such as Visual Studio
2015 with ARM target).

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 年之前
父节点
当前提交
58e6955b44
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 2 0
      inc/arm/efibind.h
  2. 2 1
      lib/arm/initplat.c

+ 2 - 0
inc/arm/efibind.h

@@ -36,7 +36,9 @@ typedef signed char         int8_t;   // unqualified 'char' is unsigned on ARM
  * This prevents GCC from emitting GOT based relocations, and use R_ARM_REL32
  * relative relocations instead, which are more suitable for static binaries.
  */
+#ifdef __GNUC__
 #pragma GCC visibility push (hidden)
+#endif
 
 //
 // Basic EFI types of various widths

+ 2 - 1
lib/arm/initplat.c

@@ -25,6 +25,7 @@ InitializeLibPlatform (
 {
 }
 
+#ifdef __GNUC__
 /*
  * Calls to these functions may be emitted implicitly by GCC even when
  * -ffreestanding is in effect.
@@ -55,4 +56,4 @@ void __div0(void)
 	// TODO handle divide by zero fault
 	while (1);
 }
-
+#endif