public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures
@ 2019-08-02  3:23 Michael D Kinney
  2019-08-02  3:23 ` [Patch 1/4] EmulatorPkg: Fix VS2015 build when VS2017 also installed Michael D Kinney
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Michael D Kinney @ 2019-08-02  3:23 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Jordan Justen, Andrew Fish, Ray Ni

https://bugzilla.tianocore.org/show_bug.cgi?id=2045
https://bugzilla.tianocore.org/show_bug.cgi?id=2046

* Fix tool paths for VS2015x86 builds of EmulatorPkg
* Add NetworkPkg to UNIX Host.inf dependencies
* Fix MacOS redefinition of NTOHLL and HTONLL macros
  between EDK II and standard includes in UNIX Host.h.
* Fix [BuildOptions] flags for IA32/X64 XCODE5 build issues
* Fix function pointer type mismatch in reverse gasket callback
* Disable #pragma GCC visibility push (hidden) for XCODE5

Cc: Liming Gao <liming.gao@intel.com>
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>

Michael D Kinney (3):
  EmulatorPkg/Unix/Host: Fix NetworkPkg dependencies
  EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure
  MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5

Michael Kinney (1):
  EmulatorPkg: Fix VS2015 build when VS2017 also installed

 EmulatorPkg/Unix/Host/EmuThunk.c   |  4 ++--
 EmulatorPkg/Unix/Host/Gasket.h     |  4 ++--
 EmulatorPkg/Unix/Host/Host.h       |  6 +++++-
 EmulatorPkg/Unix/Host/Host.inf     |  9 +++++----
 EmulatorPkg/Unix/Host/Pthreads.c   |  4 ++--
 EmulatorPkg/Win/Host/WinHost.inf   | 22 ++++++++--------------
 MdePkg/Include/X64/ProcessorBind.h |  4 ++--
 7 files changed, 26 insertions(+), 27 deletions(-)

-- 
2.21.0.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch 1/4] EmulatorPkg: Fix VS2015 build when VS2017 also installed
  2019-08-02  3:23 [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Michael D Kinney
@ 2019-08-02  3:23 ` Michael D Kinney
  2019-08-02  3:23 ` [Patch 2/4] EmulatorPkg/Unix/Host: Fix NetworkPkg dependencies Michael D Kinney
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Michael D Kinney @ 2019-08-02  3:23 UTC (permalink / raw)
  To: devel; +Cc: Michael Kinney, Jordan Justen, Andrew Fish, Ray Ni

From: Michael Kinney <michael.d.kinney@intel.com>

https://bugzilla.tianocore.org/show_bug.cgi?id=2045

* Remove INTEL family flags that are no longer used.
* Remove [BuildOptions] statements that apply to all
  MSFT family tool chains
* Update [BuildOptions] for VS2015 and VS2015x86 tool
  chain tags to use the correct path to tools when
  multiple VS20xx tool chains are installed.

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>
---
 EmulatorPkg/Win/Host/WinHost.inf | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/EmulatorPkg/Win/Host/WinHost.inf b/EmulatorPkg/Win/Host/WinHost.inf
index d61880bf76..631d5a6470 100644
--- a/EmulatorPkg/Win/Host/WinHost.inf
+++ b/EmulatorPkg/Win/Host/WinHost.inf
@@ -2,7 +2,7 @@
 # Entry Point of Win Emulator
 #
 # Main executable file of Win Emulator that loads Sec core after initialization finished.
-# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>
 # Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -80,24 +80,18 @@ [Pcd]
   gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage
 
 [BuildOptions]
-       *_*_*_DLINK_FLAGS            == /out:"$(BIN_DIR)\$(BASE_NAME).exe" /base:0x10000000 /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb"
-      :*_*_*_CC_FLAGS               == /nologo /W4 /WX /Gy /c /D UNICODE /Od /Oy- /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
-       *_*_*_PP_FLAGS               == /nologo /E /TC /FIAutoGen.h
+  MSFT:*_*_*_DLINK_FLAGS            == /out:"$(BIN_DIR)\$(BASE_NAME).exe" /base:0x10000000 /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb"
+  MSFT:*_*_*_CC_FLAGS               == /nologo /W4 /WX /Gy /c /D UNICODE /Od /Oy- /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
+  MSFT:*_*_*_PP_FLAGS               == /nologo /E /TC /FIAutoGen.h
 
-  MSFT:*_*_IA32_DLINK_FLAGS          = /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
-  MSFT:*_VS2015_IA32_DLINK_FLAGS     = /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib vcruntimed.lib ucrtd.lib
-  MSFT:*_VS2015x86_IA32_DLINK_FLAGS  = /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib vcruntimed.lib ucrtd.lib
+  MSFT:*_VS2015_IA32_DLINK_FLAGS     = /LIBPATH:"%VS2015_PREFIX%Lib" /LIBPATH:"%VS2015_PREFIX%VC\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib vcruntimed.lib ucrtd.lib
+  MSFT:*_VS2015x86_IA32_DLINK_FLAGS  = /LIBPATH:"%VS2015_PREFIX%Lib" /LIBPATH:"%VS2015_PREFIX%VC\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib vcruntimed.lib ucrtd.lib
   MSFT:*_VS2017_IA32_DLINK_FLAGS     = /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_*_IA32_ASM_FLAGS           == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi
   MSFT:*_*_IA32_ASMLINK_FLAGS       == /link /nologo /tiny
 
-  MSFT:*_*_X64_DLINK_FLAGS           = /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
-  MSFT:*_VS2015_X64_DLINK_FLAGS      = /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
-  MSFT:*_VS2015x86_X64_DLINK_FLAGS   = /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
+  MSFT:*_VS2015_X64_DLINK_FLAGS      = /LIBPATH:"%VS2015_PREFIX%VC\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
+  MSFT:*_VS2015x86_X64_DLINK_FLAGS   = /LIBPATH:"%VS2015_PREFIX%VC\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_VS2017_X64_DLINK_FLAGS      = /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_*_X64_ASM_FLAGS            == /nologo /W3 /WX /c /Cx /Zd /W0 /Zi
   MSFT:*_*_X64_ASMLINK_FLAGS        == /link /nologo
-
-  INTEL:*_*_IA32_DLINK_FLAGS         = /LIBPATH:"C:\Program Files\Intel\Compiler\C++\9.1\IA32\Lib" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib
-  INTEL:*_*_IA32_ASM_FLAGS          == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi
-  INTEL:*_*_IA32_ASMLINK_FLAGS      == /link /nologo /tiny
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch 2/4] EmulatorPkg/Unix/Host: Fix NetworkPkg dependencies
  2019-08-02  3:23 [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Michael D Kinney
  2019-08-02  3:23 ` [Patch 1/4] EmulatorPkg: Fix VS2015 build when VS2017 also installed Michael D Kinney
@ 2019-08-02  3:23 ` Michael D Kinney
  2019-08-02  3:23 ` [Patch 3/4] EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure Michael D Kinney
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Michael D Kinney @ 2019-08-02  3:23 UTC (permalink / raw)
  To: devel; +Cc: Jordan Justen, Andrew Fish

https://bugzilla.tianocore.org/show_bug.cgi?id=2046

* Add NetworkPkg to UNIX Host.inf dependencies
* Fix MacOS redefinition of NTOHLL and HTONLL macros
  between EDK II and standard includes in UNIX Host.h.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
CcM: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 EmulatorPkg/Unix/Host/Host.h   | 6 +++++-
 EmulatorPkg/Unix/Host/Host.inf | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/EmulatorPkg/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
index c26e979efa..9791cf8c37 100644
--- a/EmulatorPkg/Unix/Host/Host.h
+++ b/EmulatorPkg/Unix/Host/Host.h
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -14,7 +14,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 // Name mangle to prevent build errors. I.e conflicts between EFI and OS
 //
 #define NTOHL   _UNIX_EFI_NAME_MANGLE_NTOHL_
+#define NTOHLL  _UNIX_EFI_NAME_MANGLE_NTOHLL_
 #define HTONL   _UNIX_EFI_NAME_MANGLE_HTONL_
+#define HTONLL  _UNIX_EFI_NAME_MANGLE_HTONLL_
 #define NTOHS   _UNIX_EFI_NAME_MANGLE_NTOHS_
 #define HTONS   _UNIX_EFI_NAME_MANGLE_HTOHS_
 #define B0      _UNIX_EFI_NAME_MANGLE_B0_
@@ -72,7 +74,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <utime.h>
 
 #undef NTOHL
+#undef NTOHLL
 #undef HTONL
+#undef HTONLL
 #undef NTOHS
 #undef HTONS
 #undef B0
diff --git a/EmulatorPkg/Unix/Host/Host.inf b/EmulatorPkg/Unix/Host/Host.inf
index 71732d89fc..efe8a2b5e5 100644
--- a/EmulatorPkg/Unix/Host/Host.inf
+++ b/EmulatorPkg/Unix/Host/Host.inf
@@ -46,6 +46,7 @@ [Sources.IA32]
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
+  NetworkPkg/NetworkPkg.dec
   EmulatorPkg/EmulatorPkg.dec
 
 [LibraryClasses]
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch 3/4] EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure
  2019-08-02  3:23 [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Michael D Kinney
  2019-08-02  3:23 ` [Patch 1/4] EmulatorPkg: Fix VS2015 build when VS2017 also installed Michael D Kinney
  2019-08-02  3:23 ` [Patch 2/4] EmulatorPkg/Unix/Host: Fix NetworkPkg dependencies Michael D Kinney
@ 2019-08-02  3:23 ` Michael D Kinney
  2019-08-02  3:23 ` [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5 Michael D Kinney
  2019-08-06  1:55 ` [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Ni, Ray
  4 siblings, 0 replies; 7+ messages in thread
From: Michael D Kinney @ 2019-08-02  3:23 UTC (permalink / raw)
  To: devel; +Cc: Jordan Justen, Andrew Fish, Ray Ni

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>
---
 EmulatorPkg/Unix/Host/EmuThunk.c | 4 ++--
 EmulatorPkg/Unix/Host/Gasket.h   | 4 ++--
 EmulatorPkg/Unix/Host/Host.inf   | 8 ++++----
 EmulatorPkg/Unix/Host/Pthreads.c | 4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5
  2019-08-02  3:23 [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Michael D Kinney
                   ` (2 preceding siblings ...)
  2019-08-02  3:23 ` [Patch 3/4] EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure Michael D Kinney
@ 2019-08-02  3:23 ` Michael D Kinney
  2019-08-07 11:38   ` Liming Gao
  2019-08-06  1:55 ` [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Ni, Ray
  4 siblings, 1 reply; 7+ messages in thread
From: Michael D Kinney @ 2019-08-02  3:23 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Jordan Justen, Andrew Fish, Ray Ni

https://bugzilla.tianocore.org/show_bug.cgi?id=2046

Make sure all libs that should be dynamically linked
are dynamically linked when XCODE5 compiler is used.
A previous change introduced the following pragma:

    #pragma GCC visibility push (hidden)

When the EmulatorPkg is built using XCODE5 toolchain
for X64, this pragma is included and it generates a
linker error when building the Unix Host module.  This
change uses !defined(__APPLE__) to prevent the use of
this pragma when building EmulatorPkg/Unix/Host.

Cc: Liming Gao <liming.gao@intel.com>
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>
---
 MdePkg/Include/X64/ProcessorBind.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h
index b22cb226b0..6f65acd609 100644
--- a/MdePkg/Include/X64/ProcessorBind.h
+++ b/MdePkg/Include/X64/ProcessorBind.h
@@ -1,7 +1,7 @@
 /** @file
   Processor or Compiler specific defines and types x64 (Intel 64, AMD64).
 
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -21,7 +21,7 @@
 #pragma pack()
 #endif
 
-#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
+#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)  && !defined(__APPLE__)
 //
 // Mark all symbol declarations and references as hidden, meaning they will
 // not be subject to symbol preemption. This allows the compiler to refer to
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures
  2019-08-02  3:23 [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Michael D Kinney
                   ` (3 preceding siblings ...)
  2019-08-02  3:23 ` [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5 Michael D Kinney
@ 2019-08-06  1:55 ` Ni, Ray
  4 siblings, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2019-08-06  1:55 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Gao, Liming, Justen, Jordan L, Andrew Fish

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Friday, August 2, 2019 11:23 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Justen, Jordan L
> <jordan.l.justen@intel.com>; Andrew Fish <afish@apple.com>; Ni, Ray
> <ray.ni@intel.com>
> Subject: [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2045
> https://bugzilla.tianocore.org/show_bug.cgi?id=2046
> 
> * Fix tool paths for VS2015x86 builds of EmulatorPkg
> * Add NetworkPkg to UNIX Host.inf dependencies
> * Fix MacOS redefinition of NTOHLL and HTONLL macros
>   between EDK II and standard includes in UNIX Host.h.
> * Fix [BuildOptions] flags for IA32/X64 XCODE5 build issues
> * Fix function pointer type mismatch in reverse gasket callback
> * Disable #pragma GCC visibility push (hidden) for XCODE5
> 
> Cc: Liming Gao <liming.gao@intel.com>
> 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>
> 
> Michael D Kinney (3):
>   EmulatorPkg/Unix/Host: Fix NetworkPkg dependencies
>   EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure
>   MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5
> 
> Michael Kinney (1):
>   EmulatorPkg: Fix VS2015 build when VS2017 also installed
> 
>  EmulatorPkg/Unix/Host/EmuThunk.c   |  4 ++--
>  EmulatorPkg/Unix/Host/Gasket.h     |  4 ++--
>  EmulatorPkg/Unix/Host/Host.h       |  6 +++++-
>  EmulatorPkg/Unix/Host/Host.inf     |  9 +++++----
>  EmulatorPkg/Unix/Host/Pthreads.c   |  4 ++--
>  EmulatorPkg/Win/Host/WinHost.inf   | 22 ++++++++--------------
>  MdePkg/Include/X64/ProcessorBind.h |  4 ++--
>  7 files changed, 26 insertions(+), 27 deletions(-)
> 
> --
> 2.21.0.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5
  2019-08-02  3:23 ` [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5 Michael D Kinney
@ 2019-08-07 11:38   ` Liming Gao
  0 siblings, 0 replies; 7+ messages in thread
From: Liming Gao @ 2019-08-07 11:38 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Justen, Jordan L, Andrew Fish, Ni, Ray

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Kinney, Michael D
>Sent: Friday, August 02, 2019 11:23 AM
>To: devel@edk2.groups.io
>Cc: Gao, Liming <liming.gao@intel.com>; Justen, Jordan L
><jordan.l.justen@intel.com>; Andrew Fish <afish@apple.com>; Ni, Ray
><ray.ni@intel.com>
>Subject: [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64
>XCODE5
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=2046
>
>Make sure all libs that should be dynamically linked
>are dynamically linked when XCODE5 compiler is used.
>A previous change introduced the following pragma:
>
>    #pragma GCC visibility push (hidden)
>
>When the EmulatorPkg is built using XCODE5 toolchain
>for X64, this pragma is included and it generates a
>linker error when building the Unix Host module.  This
>change uses !defined(__APPLE__) to prevent the use of
>this pragma when building EmulatorPkg/Unix/Host.
>
>Cc: Liming Gao <liming.gao@intel.com>
>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>
>---
> MdePkg/Include/X64/ProcessorBind.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/MdePkg/Include/X64/ProcessorBind.h
>b/MdePkg/Include/X64/ProcessorBind.h
>index b22cb226b0..6f65acd609 100644
>--- a/MdePkg/Include/X64/ProcessorBind.h
>+++ b/MdePkg/Include/X64/ProcessorBind.h
>@@ -1,7 +1,7 @@
> /** @file
>   Processor or Compiler specific defines and types x64 (Intel 64, AMD64).
>
>-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
>+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>   SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>@@ -21,7 +21,7 @@
> #pragma pack()
> #endif
>
>-#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
>+#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
>&& !defined(__APPLE__)
> //
> // Mark all symbol declarations and references as hidden, meaning they will
> // not be subject to symbol preemption. This allows the compiler to refer to
>--
>2.21.0.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-07 11:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02  3:23 [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Michael D Kinney
2019-08-02  3:23 ` [Patch 1/4] EmulatorPkg: Fix VS2015 build when VS2017 also installed Michael D Kinney
2019-08-02  3:23 ` [Patch 2/4] EmulatorPkg/Unix/Host: Fix NetworkPkg dependencies Michael D Kinney
2019-08-02  3:23 ` [Patch 3/4] EmulatorPkg/Unix/Host: Fix XCODE5 IA32/X64 build failure Michael D Kinney
2019-08-02  3:23 ` [Patch 4/4] MdePkg/X64/ProcessorBind.h: Fix EmulatorPkg X64 XCODE5 Michael D Kinney
2019-08-07 11:38   ` Liming Gao
2019-08-06  1:55 ` [Patch 0/4] EmulatorPkg: Fix XCODE5 and VS2015 build failures Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox