]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure
authorMichael D Kinney <michael.d.kinney@intel.com>
Fri, 2 Aug 2019 00:55:26 +0000 (17:55 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Tue, 6 Aug 2019 16:29:32 +0000 (09:29 -0700)
https://bugzilla.tianocore.org/show_bug.cgi?id=2046

* Clean up XCODE5 IA32 [BuildOptions] and fix IA32
  X11 include path.
* Add -DEFIAPI=__attribute__((ms_abi)) to X64 XCODE5
  [BuildOptions]
* Use -target x86_64-apple-darwin for X64 XCODE5
  [BuildOptions]
* Add Wl,-no_pie to X64 XCODE5 [BuildOptions]
* Address function type mismatch reported by XCODE5
  in reverse gasket callback between UEFI ABI and
  MacOS ABI.  Use a UINTN to pass function address
  to assembly code.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
EmulatorPkg/Unix/Host/EmuThunk.c
EmulatorPkg/Unix/Host/Gasket.h
EmulatorPkg/Unix/Host/Host.inf
EmulatorPkg/Unix/Host/Pthreads.c

index 1c261a63cc4800d1a0ad35b475656660b2e68056..1e9dc99187dbced7555ae801b0b7ec8d7f953370 100644 (file)
@@ -30,7 +30,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 \r
 int settimer_initialized;\r
 struct timeval settimer_timeval;\r
-void (*settimer_callback)(UINT64 delta);\r
+UINTN  settimer_callback = 0;\r
 \r
 BOOLEAN gEmulatorInterruptEnabled = FALSE;\r
 \r
@@ -194,7 +194,7 @@ SecSetTimer (
   if (setitimer (ITIMER_REAL, &timerval, NULL) != 0) {\r
     printf ("SetTimer: setitimer error %s\n", strerror (errno));\r
   }\r
-  settimer_callback = CallBack;\r
+  settimer_callback = (UINTN)CallBack;\r
 }\r
 \r
 \r
index e66f33496028114a7a66e4a51c78947eebb845e5..e082397d23fbd92e2861603e9abc8214a6e6f186 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
-  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -195,7 +195,7 @@ void
 \r
 UINTN\r
 ReverseGasketUint64 (\r
-  CALL_BACK CallBack,\r
+  UINTN  CallBack,\r
   UINT64 a\r
   );\r
 \r
index efe8a2b5e53d1b8db07a057cecceae147bbdd5bc..ca4294249bf617dc758a5b47883545121c930654 100644 (file)
@@ -2,7 +2,7 @@
 # Entry Point of Emu Emulator\r
 #\r
 # Main executable file of Unix Emulator that loads PEI core after initialization finished.\r
-# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>\r
 # Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 # Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version\r
 #\r
    XCODE:*_*_IA32_DLINK_PATH == gcc\r
-   XCODE:*_*_IA32_CC_FLAGS == -arch i386 -O0 -g -include $(DEST_DIR_DEBUG)/AutoGen.h -c -fshort-wchar -fno-strict-aliasing\r
+   XCODE:*_*_IA32_CC_FLAGS = -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack\r
    XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/Host -L/usr/X11R6/lib -lXext -lX11 -framework Carbon\r
    XCODE:*_*_IA32_ASM_FLAGS == -arch i386 -g\r
 \r
    XCODE:*_*_X64_DLINK_PATH == gcc\r
-   XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/Host -L/usr/X11R6/lib -lXext -lX11 -framework Carbon\r
+   XCODE:*_*_X64_DLINK_FLAGS == -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie\r
    XCODE:*_*_X64_ASM_FLAGS == -g\r
-   XCODE:*_*_X64_CC_FLAGS = -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack\r
+   XCODE:*_*_X64_CC_FLAGS = -target x86_64-apple-darwin -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=__attribute__((ms_abi))"\r
index 7c71a2da4fd86a06b491abcf3ab071de6f4f3bcb..f07bcfce66f30ef0adfa669ea568930eb949dd06 100644 (file)
@@ -2,7 +2,7 @@
  POSIX Pthreads to emulate APs and implement threads\r
 \r
 Copyright (c) 2011, Apple Inc. All rights reserved.\r
-Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR>\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -109,7 +109,7 @@ SecFakePthreadStart (
   // This is a great example of how all problems in computer\r
   // science can be solved by adding another level of indirection\r
   //\r
- return  (VOID *)ReverseGasketUint64 ((CALL_BACK)Start, (UINTN)Context);\r
+ return  (VOID *)ReverseGasketUint64 ((UINTN)Start, (UINTN)Context);\r
 }\r
 \r
 UINTN\r