Skip to content

Commit

Permalink
Merge branch 'acidanthera:master' into YamingNetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
wy414012 authored Apr 25, 2024
2 parents 3bb1f75 + ac0110a commit c47c122
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ OpenCore Changelog
- Fixed assert caused by dependency ordering in OpenDuet
- Prevented assert in normal situation when freeing memory above 4GB in OpenDuet
- Prevented debug assert reporting that optional Hii protocols are not present in OpenDuet
- Fixed problem loading non-firmware runtime drivers (e.g. OpenRuntime.efi) in OpenDuet
- Resolved issue using NOOPT debugging in OpenDuet

#### v0.9.9
- Fixed incorrect warning in ocvalidate
Expand Down
4 changes: 4 additions & 0 deletions Legacy/BootSector/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ PRODUCTS64=$(BINDIR)/StartX64_$(PAGE_TABLE).com $(BINDIR)/StartX64_$(PAGE_TABLE_

all: $(PRODUCTS32) $(PRODUCTS64)

IA32: $(PRODUCTS32)

X64: $(PRODUCTS64)

clean:
$(RM) -f $(BINDIR)/*.com

Expand Down
1 change: 0 additions & 1 deletion OpenCorePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAlignmentPolicy|0xFFFFFFFF
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRelocTypePolicy|0xFFFFFFFF
gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003
gEfiMdePkgTokenSpaceGuid.PcdUefiImageFormatSupportNonFv|0x01

[PcdsPatchableInModule]
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth|8
Expand Down
13 changes: 7 additions & 6 deletions OpenDuetPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@
DxeServicesTableLib|MdeModulePkg/Library/DxeCoreDxeServicesTableLib/DxeCoreDxeServicesTableLib.inf
UefiBootServicesTableLib|MdeModulePkg/Library/DxeCoreUefiBootServicesTableLib/DxeCoreUefiBootServicesTableLib.inf
UefiRuntimeServicesTableLib|MdeModulePkg/Library/DxeCoreUefiRuntimeServicesTableLib/DxeCoreUefiRuntimeServicesTableLib.inf
<PcdsFixedAtBuild>
gEfiMdePkgTokenSpaceGuid.PcdUefiImageFormatSupportFv|0x03
}

MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
Expand Down Expand Up @@ -182,7 +180,10 @@
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
OpenCorePkg/Legacy/BootPlatform/SmbiosGenDxe/SmbiosGen.inf

!if $(TARGET) != NOOPT
# We will reuse DEBUG EfiLdr in NOOPT build to keep within allotted 0x10000-0x20000 space.
OpenCorePkg/Legacy/BootPlatform/EfiLdr/EfiLdr.inf
!endif
OpenCorePkg/Legacy/BootPlatform/BdsDxe/BdsDxe.inf {
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
Expand Down Expand Up @@ -290,18 +291,18 @@
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE

[BuildOptions]
MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel
MSFT:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline -DMDEPKG_NDEBUG /GS /kernel
MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel
MSFT:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel
MSFT:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline -DMDEPKG_NDEBUG /GS /kernel

XCODE:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -fno-unwind-tables -O0 -fstack-protector-strong -ftrivial-auto-var-init=pattern
XCODE:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -fno-unwind-tables -flto -Os -fstack-protector-strong -ftrivial-auto-var-init=pattern
XCODE:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -fno-unwind-tables -flto -Os -DMDEPKG_NDEBUG -fstack-protector-strong -ftrivial-auto-var-init=pattern

GCC:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
GCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
GCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
GCC:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized

CLANGGCC:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
CLANGGCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
CLANGGCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
CLANGGCC:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized
2 changes: 1 addition & 1 deletion OpenDuetPkgDefines.fdf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
NumBlocks = 0x8 #GenFv image size 0x80000
!else
!if ($(TARGET) == DEBUG)
NumBlocks = 0xd #GenFv image size 0xd0000
NumBlocks = 0xe #GenFv image size 0xe0000
!else
NumBlocks = 0x24 #GenFv image size 0x240000
!endif
Expand Down
10 changes: 7 additions & 3 deletions build_duet.tool
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ imgbuild() {
"${BUILD_DIR_ARCH}/DxeIplUe.raw" || exit 1

echo "Generating Loader Image..."

ImageTool GenImage -c PE -x -b 0x10000 -o "${BUILD_DIR_ARCH}/EfiLoaderRebased.efi" "${BUILD_DIR_ARCH}/EfiLoader.efi" || exit 1
# Reuse DEBUG EfiLdr in NOOPT build to keep within allotted 0x10000-0x20000 space.
# With this approach, everything after EfiLdr is fully NOOPT, but EfiLdr starts.
# TODO: Look at moving EFILDR_BASE_SEGMENT (see also kBoot2Segment, BASE_ADDR_32)
# to make space for NOOPT loader.
SAFE_LOADER=$(echo "${BUILD_DIR_ARCH}/EfiLoader.efi" | sed -e 's/NOOPT/DEBUG/')
ImageTool GenImage -c PE -x -b 0x10000 -o "${BUILD_DIR_ARCH}/EfiLoaderRebased.efi" "${SAFE_LOADER}" || exit 1

"${FV_TOOLS}/EfiLdrImage" -o "${BUILD_DIR}/FV/Efildr${arch}" \
"${BUILD_DIR_ARCH}/EfiLoaderRebased.efi" "${BUILD_DIR}/FV/DxeIpl${arch}.z" \
Expand Down Expand Up @@ -77,7 +81,7 @@ imgbuild() {
# Build bootsectors.
mkdir -p "${BOOTSECTORS}" || exit 1
cd "${BOOTSECTORS}"/.. || exit 1
make || exit 1
make "${arch}" || exit 1
cd - || exit 1

# Concatenate bootsector into the resulting image.
Expand Down

0 comments on commit c47c122

Please sign in to comment.