Skip to content

Commit 9e802db

Browse files
committed
a template to use llvm-clang-19
Signed-off-by: Slice <sergey.slice@gmail.com>
1 parent 3e7fda7 commit 9e802db

4 files changed

Lines changed: 56 additions & 22 deletions

File tree

Clover.dsc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,11 @@ DEFINE LESS_DEBUG_FLAG = -DLESS_DEBUG
10421042
DEFINE ENABLE_MODERN_CPU_QUIRKS_FLAG = -DENABLE_MODERN_CPU_QUIRKS
10431043
!endif
10441044

1045+
1046+
!ifdef NO_MSABI_VA_FUNCS
1047+
DEFINE NO_MSABI_VA_FUNCS_FLAG = -DNO_MSABI_VA_FUNCS
1048+
!endif
1049+
10451050
DEFINE BUILD_OPTIONS=-DIS_UEFI_MODULE -DMDEPKG_NDEBUG -DCLOVER_BUILD -DLESS_DEBUG $(VBIOS_PATCH_CLOVEREFI_FLAG) $(ONLY_SATA_0_FLAG) $(BLOCKIO_FLAG) $(NOUSB_FLAG) $(NOUDMA_FLAG) $(AMD_FLAG) $(SECURE_BOOT_FLAG) $(ANDX86_FLAG) $(PS2MOUSE_LEGACYBOOT_FLAG) $(DEBUG_ON_SERIAL_PORT_FLAG) $(EXIT_USBKB_FLAG) $(JIEF_DEBUG_FLAG) $(ENABLE_MODERN_CPU_QUIRKS_FLAG) -DDISABLE_NEW_DEPRECATED_INTERFACES -DOC_TARGET_DEBUG
10461051

10471052
XCODE:DEBUG_*_*_CC_FLAGS =

MdePkg/Include/Base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ typedef char* VA_LIST;
635635
#define VA_END(Marker) (Marker = (VA_LIST) 0)
636636
#define VA_COPY(Dest, Start) ((void)((Dest) = (Start)))
637637

638-
#elif defined(__GNUC__) || defined(__clang__)
638+
#elif defined(__GNUC__) || defined(__clang__) //SI?
639639

640640
#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS)
641641
//

hebuild.sh

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# ebuild.sh ->ebuild.sh //renamed to be unique file begining from E
44
# Script for building CloverEFI source under OS X or Linux
5-
# Supported chainloads(compilers) are XCODE*, GCC*, UNIXGCC and CLANG
5+
# Supported chainloads(compilers) are XCODE*, GCC*, UNIXGCC and LLVM
66
#
77
#
88
# Created by Jadran Puharic on 1/6/12.
@@ -54,26 +54,29 @@ export PYTHON_COMMAND=python3
5454

5555
# if building through Xcode, then TOOLCHAIN_DIR is not defined
5656
# checking if it is where CloverGrowerPro put it
57-
if [[ "$SYSNAME" == Linux ]]; then
58-
export TOOLCHAIN=GCC152
59-
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-/usr}
60-
else
61-
if [[ -d ~/src/opt/local ]]; then
62-
TOOLCHAIN_DIR=~/src/opt/local
63-
else
64-
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/toolchain}
65-
fi
66-
export DIR_MAIN=${DIR_MAIN:-"$CLOVERROOT"/toolchain}
67-
fi
68-
export TOOLCHAIN_DIR
69-
echo "TOOLCHAIN_DIR: $TOOLCHAIN_DIR"
57+
#if [[ "$SYSNAME" == Linux ]]; then
58+
# export TOOLCHAIN=GCC152
59+
# TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-/usr}
60+
#else
61+
# if [[ "$TOOLCHAIN" == LLVM ]]; then
62+
# TOOLCHAIN_DIR=/opt/local
63+
# elif [[ -d ~/src/opt/local ]]; then
64+
# TOOLCHAIN_DIR=~/src/opt/local
65+
# else
66+
# TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/toolchain}
67+
# fi
68+
# export DIR_MAIN=${DIR_MAIN:-"$CLOVERROOT"/toolchain}
69+
#fi
70+
#export TOOLCHAIN_DIR
71+
#echo "TOOLCHAIN_DIR: $TOOLCHAIN_DIR"
7072

7173
VBIOSPATCHCLOVEREFI=0
7274
ONLYSATA0PATCH=0
7375
USE_BIOS_BLOCKIO=0
7476
USE_LOW_EBDA=1
7577
CLANG=0
7678
GENPAGE=0
79+
LLVM=0
7780

7881
FORCEREBUILD=0
7982
NOBOOTFILES=0
@@ -246,8 +249,8 @@ usage() {
246249
print_option_help "-v, --version" "print the version information and exit"
247250
echo
248251
echo "Toolchain:"
249-
# print_option_help "-clang" "use XCode Clang toolchain"
250-
# print_option_help "-llvm" "use LLVM toolchain"
252+
# print_option_help "-clang" "use Clang toolchain"
253+
print_option_help "-llvm" "use LLVM toolchain"
251254
# print_option_help "-gcc49" "use GCC 4.9 toolchain"
252255
print_option_help "-gcc53" "use GCC 5.3 toolchain, including gcc-11"
253256
print_option_help "-gcc131" "use GCC 13.1 toolchain, including gcc-14.2"
@@ -258,7 +261,7 @@ usage() {
258261
print_option_help "-xcode5" "use XCode 5 toolchain, "
259262
print_option_help "-xcode8" "use XCode 8 toolchain [Default]"
260263
print_option_help "-xcode14" "use XCode 14 toolchain"
261-
print_option_help "-xcode15" "use XCode 15 toolchain"
264+
print_option_help "-xcode16" "use XCode 16-26 toolchain"
262265
print_option_help "-t TOOLCHAIN, --tagname=TOOLCHAIN" "force to use a specific toolchain"
263266
echo
264267
echo "Target:"
@@ -309,7 +312,7 @@ checkCmdlineArguments() {
309312
local option=$1
310313
shift
311314
case "$option" in
312-
-clang | --clang) TOOLCHAIN=XCLANG ; CLANG=1 ;;
315+
-llvm | --llvm) TOOLCHAIN=LLVM ; CLANG=1 ;;
313316
-xcode5 | --xcode5 ) TOOLCHAIN=XCODE5 ; CLANG=1 ;;
314317
-xcode8 | --xcode8 ) TOOLCHAIN=XCODE8 ; CLANG=1 ;;
315318
-xcode14 | --xcode14 ) TOOLCHAIN=XCODE14 ; CLANG=1 ;;
@@ -461,6 +464,11 @@ checkToolchain() {
461464
./buildnasm.sh
462465
fi
463466

467+
if [[ $TOOLCHAIN == LLVM ]]; then
468+
export LLVM_PREFIX="/opt/local/bin/"
469+
export LLVM_BIN="/opt/local/libexec/llvm-19/bin/"
470+
fi
471+
464472
echo "NASM_PREFIX: $NASM_PREFIX"
465473

466474
#NASM_VER=`nasm -v | awk '/version/ {print $3}'`
@@ -474,7 +482,8 @@ checkToolchain() {
474482

475483
# Main build script
476484
MainBuildScript() {
477-
checkCmdlineArguments $@
485+
# checkCmdlineArguments $@
486+
478487
checkToolchain
479488

480489
# local repoRev=$(git describe --tags $(git rev-list --tags --max-count=1))
@@ -585,7 +594,7 @@ MainBuildScript() {
585594
[[ "$ONLYSATA0PATCH" -ne 0 ]] && addEdk2BuildMacro 'ONLY_SATA_0'
586595
[[ "$USE_LOW_EBDA" -ne 0 ]] && addEdk2BuildMacro 'USE_LOW_EBDA'
587596
[[ -d "$WORKSPACE/MdeModulePkg/Universal/Variable/EmuRuntimeDxe" ]] && addEdk2BuildMacro 'HAVE_LEGACY_EMURUNTIMEDXE'
588-
[[ "$CLANG" -ne 0 ]] && addEdk2BuildMacro 'CLANG'
597+
[[ "$LLVM" -ne 0 ]] && addEdk2BuildMacro 'LLVM'
589598
[[ "$ENABLE_MODERN_CPU" -ne 0 ]] && addEdk2BuildMacro 'ENABLE_MODERN_CPU_QUIRKS'
590599

591600
local cmd="${EDK2_BUILD_OPTIONS[@]}"
@@ -604,6 +613,8 @@ MainBuildScript() {
604613
echo "$cmd"
605614
echo
606615

616+
617+
607618
# Build Clover version
608619
if (( $SkipAutoGen == 0 )) || (( $FORCEREBUILD == 1 )); then
609620

@@ -915,6 +926,24 @@ export LC_ALL=POSIX
915926

916927
startBuildEpoch=$(date -u "+%s")
917928

929+
checkCmdlineArguments $@
930+
931+
if [[ "$SYSNAME" == Linux ]]; then
932+
export TOOLCHAIN=GCC152
933+
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-/usr}
934+
else
935+
if [[ "$TOOLCHAIN" == LLVM ]]; then
936+
TOOLCHAIN_DIR=/opt/local
937+
elif [[ -d ~/src/opt/local ]]; then
938+
TOOLCHAIN_DIR=~/src/opt/local
939+
else
940+
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/toolchain}
941+
fi
942+
export DIR_MAIN=${DIR_MAIN:-"$CLOVERROOT"/toolchain}
943+
fi
944+
export TOOLCHAIN_DIR
945+
echo "TOOLCHAIN_DIR: $TOOLCHAIN_DIR"
946+
918947
# Add toolchain bin directory to the PATH
919948
if [[ "$SYSNAME" != Linux ]]; then
920949
pathmunge "$TOOLCHAIN_DIR/bin"

rEFIt_UEFI/Platform/APFS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ EFI_GUID APFSPartitionUUIDExtract(
4949
}
5050
if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
5151
//Check that vendor-assigned EFI_GUID defines APFS Container Partition
52-
if ( ApfsSignatureUUID == *(EFI_GUID *)((UINT8 *)DevicePath+0x04) ) {
52+
if ( ApfsSignatureUUID == *(const EFI_GUID *)((UINT8 *)DevicePath+0x04) ) {
5353
return *(EFI_GUID *)((UINT8 *)DevicePath+0x14);
5454
}
5555
}

0 commit comments

Comments
 (0)