Skip to content

Commit

Permalink
restore old xcode8 and create new xcode14 toolset
Browse files Browse the repository at this point in the history
Signed-off-by: SergeySlice <[email protected]>
  • Loading branch information
SergeySlice committed Sep 6, 2023
1 parent 71da65f commit 0ea0020
Showing 1 changed file with 78 additions and 1 deletion.
79 changes: 78 additions & 1 deletion BaseTools/Conf/tools_def.template
Original file line number Diff line number Diff line change
Expand Up @@ -2746,7 +2746,7 @@ RELEASEMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAG
# -Wno-varargs
# -Wno-unused-const-variable

DEFINE XCODE8_COMMON_FLAGS = -nostdinc -c -Wall -Wextra -include AutoGen.h -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mms-bitfields -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -mno-red-zone -fno-common -fdata-sections -ffreestanding -ffunction-sections -fno-asynchronous-unwind-tables -m64 -mabi=ms -mcmodel=small -DNO_MSABI_VA_FUNCS -fno-strict-aliasing -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-deprecated-non-prototype
DEFINE XCODE8_COMMON_FLAGS = -nostdinc -c -Wall -Wextra -include AutoGen.h -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mms-bitfields -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -mno-red-zone -fno-common -fdata-sections -ffreestanding -ffunction-sections -fno-asynchronous-unwind-tables -m64 -mabi=ms -mcmodel=small -DNO_MSABI_VA_FUNCS -fno-strict-aliasing -Wno-unused-parameter



Expand All @@ -2767,6 +2767,83 @@ RELEASEMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAG
*_XCODE8_*_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS)
*_XCODE8_*_APP_FLAGS = DEF(GCC_PP_FLAGS)

#
# XCODE14 support
#

*_XCODE14_*_*_FAMILY = GCC
*_XCODE14_*_*_BUILDRULEFAMILY = XCODE
*_XCODE14_*_*_BUILDRULEORDER = nasm S s

*_XCODE14_*_MTOC_PATH = ENV(MTOC_PREFIX)mtoc.NEW_jief

*_XCODE14_*_MAKE_PATH = make
*_XCODE14_*_DSYMUTIL_PATH = /usr/bin/dsymutil

DEBUG_XCODE14_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
NOOPT_XCODE14_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
RELEASE_XCODE14_*_MTOC_FLAGS = -align 0x20

#
# use xcode-select to change Xcode version of command line tools
#
*_XCODE14_*_CC_PATH = clang
*_XCODE14_*_SLINK_PATH = libtool
*_XCODE14_*_DLINK_PATH = clang
*_XCODE14_*_ASM_PATH = clang
*_XCODE14_*_PP_PATH = clang
*_XCODE14_*_VFRPP_PATH = clang
*_XCODE14_*_ASL_PATH = DEF(UNIX_IASL_BIN)
*_XCODE14_*_ASLCC_PATH = clang
*_XCODE14_*_ASLPP_PATH = clang
*_XCODE14_*_ASLDLINK_PATH = clang
*_XCODE14_*_NASM_PATH = ENV(NASM_PREFIX)nasm

##################
# X64 definitions
##################
DEBUG_XCODE14_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-object_path_lto,$(DEST_DIR_DEBUG)/$(BASE_NAME).o,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEBUGMACOS_XCODE14_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x800,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
RELEASE_XCODE14_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
RELEASEMACOS_XCODE14_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x800,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map

*_XCODE14_X64_SLINK_FLAGS = -static -no_warning_for_no_symbols -o

DEBUG_XCODE14_X64_ASM_FLAGS = -c -x assembler -arch x86_64 -g
DEBUGMACOS_XCODE14_X64_ASM_FLAGS = -c -x assembler -arch x86_64 -g
RELEASE_XCODE14_X64_ASM_FLAGS = -c -x assembler -arch x86_64
RELEASEMACOS_XCODE14_X64_ASM_FLAGS = -c -x assembler -arch x86_64

*_XCODE14_X64_NASM_FLAGS = -f macho64
*_XCODE14_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
*_XCODE14_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h


# -mno-implicit-float
# -Wno-varargs
# -Wno-unused-const-variable

DEFINE XCODE14_COMMON_FLAGS = -nostdinc -c -Wall -Wextra -include AutoGen.h -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mms-bitfields -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -mno-red-zone -fno-common -fdata-sections -ffreestanding -ffunction-sections -fno-asynchronous-unwind-tables -m64 -mabi=ms -mcmodel=small -DNO_MSABI_VA_FUNCS -fno-strict-aliasing -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-deprecated-non-prototype



DEBUG_XCODE14_X64_CC_FLAGS = -g3 -gdwarf -O0 DEF(XCODE14_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))"
DEBUGMACOS_XCODE14_X64_CC_FLAGS = -g3 -gdwarf -O0 DEF(XCODE14_COMMON_FLAGS)
RELEASE_XCODE14_X64_CC_FLAGS = -Os DEF(XCODE14_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" -Werror
RELEASEMACOS_XCODE14_X64_CC_FLAGS = -Os DEF(XCODE14_COMMON_FLAGS)
DEBUG_XCODE14_X64_CXX_FLAGS = -g3 -gdwarf -O0 DEF(XCODE14_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))"
DEBUGMACOS_XCODE14_X64_CXX_FLAGS = -g3 -gdwarf -O0 DEF(XCODE14_COMMON_FLAGS)
RELEASE_XCODE14_X64_CXX_FLAGS = -Os DEF(XCODE14_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" -Werror
RELEASEMACOS_XCODE14_X64_CXX_FLAGS = -Os DEF(XCODE14_COMMON_FLAGS)

*_XCODE14_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -c -include AutoGen.h
*_XCODE14_*_ASLDLINK_FLAGS = -nostdlib -Wl,-e,_ReferenceAcpiTable,-preload,-segalign,0x20,-pie,-seg1addr,0x260,-read_only_relocs,suppress,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
*_XCODE14_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
*_XCODE14_*_ASL_FLAGS =
*_XCODE14_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
*_XCODE14_*_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS)
*_XCODE14_*_APP_FLAGS = DEF(GCC_PP_FLAGS)

####################################################################################
#
# RVCT Common
Expand Down

1 comment on commit 0ea0020

@matxpa
Copy link

@matxpa matxpa commented on 0ea0020 Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergeySlice Hi

with Xcode14 or Xcode8 (Release) Clover build abort

macOS Ventura 13.6

~ % clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Xcode Version 14.3.1 (14E300c)

With Sonoma Dev beta 7 Xcode 15.0.0 beta 8 (builme XCODE14 abort too)

commit 0ea0020 : -Wno-unused-but-set-variable and -Wdeprecated-non-prototype were removed from XCODE8_COMMON_FLAGS content in [BaseTools/Conf/tools_def.template]

Clover build (buildme XCODE8) with : ... -a X64 -b RELEASE -t XCODE8 ...

...

build --cmd-len=50000 -D NO_GRUB_DRIVERS_EMBEDDED -D LESS_DEBUG --conf=/Users/meunier/CloverBootloader/Conf -D USE_LOW_EBDA -p Clover.dsc -a X64 -b RELEASE -t XCODE8 -n 5

Build environment: macOS-13.6-x86_64-i386-64bit
...
Architecture(s) = X64
Build target = RELEASE
Toolchain = XCODE8
...
[CC] OcAppleImg4Lib
/Users/meunier/CloverBootloader/OpenCorePkg/Library/OcDebugLogLibOc2Clover/DebugPrint.c:28:3: error: variable '__DebugCodeLocal' set but not used [-Werror,-Wunused-but-set-variable]
DEBUG_CODE_BEGIN();
^
/Users/meunier/CloverBootloader/MdePkg/Include/Library/DebugLib.h:542:68: note: expanded from macro 'DEBUG_CODE_BEGIN'
#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal
^
/Users/meunier/CloverBootloader/OpenCorePkg/Library/OcDebugLogLibOc2Clover/DebugPrint.c:48:3: error: variable '__DebugCodeLocal' set but not used [-Werror,-Wunused-but-set-variable]
DEBUG_CODE_BEGIN ();
^
/Users/meunier/CloverBootloader/MdePkg/Include/Library/DebugLib.h:542:68: note: expanded from macro 'DEBUG_CODE_BEGIN'
#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal
^
/Users/meunier/CloverBootloader/OpenCorePkg/Library/OcDebugLogLibOc2Clover/DebugPrint.c:71:3: error: variable '__DebugCodeLocal' set but not used [-Werror,-Wunused-but-set-variable]
DEBUG_CODE_BEGIN();
^
/Users/meunier/CloverBootloader/MdePkg/Include/Library/DebugLib.h:542:68: note: expanded from macro 'DEBUG_CODE_BEGIN'
#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal
^
3 errors generated.
make: *** [/Users/meunier/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/OpenCorePkg/Library/OcDebugLogLibOc2Clover/OcDebugLogLibOc2Clover/OUTPUT/DebugPrint.obj] Error 1
...

  • Failed -
    Build end time: 22:26:50, Sep.08 2023
    Build total time: 00:01:01

       Clover r5155 (SHA: 0ea0020c4) Build KO !
    

2d pass with only -Wno-unused-but-set-variable restored
...

[CC] OcAppleKeysLib
/Users/meunier/CloverBootloader/OpenCorePkg/Library/OcCompressionLib/zlib/crc32.c:730:23: error: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
unsigned long ZEXPORT crc32_z(crc, buf, len)
^
1 error generated.
make: *** [/Users/meunier/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/OpenCorePkg/Library/OcCompressionLib/OcCompressionLib/OUTPUT/zlib/crc32.obj] Error 1

build.py...
: error 7000: Failed to execute command
make tbuild [/Users/meunier/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/OpenCorePkg/Library/OcCompressionLib/OcCompressionLib]

build.py...
: error F002: Failed to build module
/Users/meunier/CloverBootloader/OpenCorePkg/Library/OcCompressionLib/OcCompressionLib.inf [X64, XCODE8, RELEASE]

  • Failed -
    Build end time: 23:16:15, Sep.08 2023
    Build total time: 00:01:00

       Clover r5155 (SHA: 0ea0020c4) Build KO !
    

3d pass with Wdeprecated-non-prototype restored

...

  • Done -
    Build end time: 23:31:43, Sep.08 2023
    Build total time: 00:06:50

    -> CloverX64-RELEASE_XCODE8-20230906192706-0ea0020-5155-dirty.efi
    adding: Users/meunier/CloverBootloader/Build/CloverX64-RELEASE_XCODE8-20230906192706-0ea0020-5155-dirty.efi (deflated 54%)

  • Clover build process took 6m54s to complete...

       Clover r5155 (SHA: 0ea0020c4) Build OK !
    

Regards

Please sign in to comment.