Fix GenFW, remove -no-lto for CppMemLib.

This commit is contained in:
jief666 2020-11-09 16:19:33 +03:00
parent cb29f59457
commit b6a13a9f53
12 changed files with 481 additions and 22 deletions

4
.gitignore vendored
View File

@ -108,7 +108,6 @@ build/
!default.mode2v3
!default.perspectivev3
xcuserdata/
xcshareddata/
# Translation files
CloverUpdater.strings
@ -125,4 +124,7 @@ tools
#Eclipse build folder
/DEBUG_*/
/RELEASE_*/
#copy I make sometimes
/rEFIt_UEFI copy*/

View File

@ -525,6 +525,17 @@ ScanSections64 (
mCoffOffset = mCoffAlignment;
}
//
// List all sections.
//
for (i = 0; i < mEhdr->e_shnum; i++) {
Elf_Shdr *shdr = GetShdrByIndex(i);
Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
NormalMsg("section %d %s sh_addr_in_memory_image=%llu(0x%llx) sh_offset_in_file=%llu(0x%llx) sh_size=%llu(0x%llx) sh_addralign=%llu sh_flags=0x%llx", i, sectName, shdr->sh_addr, shdr->sh_addr, shdr->sh_offset, shdr->sh_offset, shdr->sh_size, shdr->sh_size, shdr->sh_addralign, shdr->sh_flags);
}
//
// First text sections.
//
@ -534,17 +545,15 @@ ScanSections64 (
SectionCount = 0;
for (i = 0; i < mEhdr->e_shnum; i++) {
Elf_Shdr *shdr = GetShdrByIndex(i);
Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
/*debug*/Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
/*debug*/CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
if (IsTextShdr(shdr)) {
if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
// the alignment field is valid
if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
// if the section address is aligned we must align PE/COFF
UINT32 mCoffOffsetNew = (UINT32) ((shdr->sh_addr + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
printf("Section %d %s mCoffOffset=%d(0x%x) mCoffOffsetNew=%d(0x%x) diff=%d(0x%x)\n", i, sectName, mCoffOffset, mCoffOffset, mCoffOffsetNew, mCoffOffsetNew, mCoffOffsetNew-mCoffOffset, mCoffOffsetNew-mCoffOffset);
mCoffOffset=mCoffOffsetNew;
/*debug*/NormalMsg("Text section %d %s size=%llu mCoffOffset=%d(0x%x)", i, sectName, shdr->sh_size, mCoffOffset, mCoffOffset);
} else {
Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its own alignment.");
}
@ -590,17 +599,15 @@ mCoffOffset=mCoffOffsetNew;
SectionCount = 0;
for (i = 0; i < mEhdr->e_shnum; i++) {
Elf_Shdr *shdr = GetShdrByIndex(i);
Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
/*debug*/Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
/*debug*/CHAR8* sectName = ((CHAR8*)mEhdr) + Namedr->sh_offset + shdr->sh_name;
if (IsDataShdr(shdr)) {
if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
// the alignment field is valid
if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
// if the section address is aligned we must align PE/COFF
UINT32 mCoffOffsetNew = (UINT32) ((shdr->sh_addr + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
printf("Section %d %s mCoffOffset=%d(0x%x) mCoffOffsetNew=%d(0x%x) diff=%d(0x%x)\n", i, sectName, mCoffOffset, mCoffOffset, mCoffOffsetNew, mCoffOffsetNew, mCoffOffsetNew-mCoffOffset, mCoffOffsetNew-mCoffOffset);
mCoffOffset=mCoffOffsetNew;
/*debug*/NormalMsg("Data section %d %s size=%llu mCoffOffset=%d(0x%x)", i, sectName, shdr->sh_size, mCoffOffset, mCoffOffset);
} else {
Error (NULL, 0, 3000, "Invalid", "Section address not aligned to its own alignment.");
}
@ -673,6 +680,7 @@ mCoffOffset=mCoffOffsetNew;
//
// Allocate base Coff file. Will be expanded later for relocations.
//
NormalMsg("Allocate %d bytes for mCoffFile", mCoffOffset);
mCoffFile = (UINT8 *)malloc(mCoffOffset);
if (mCoffFile == NULL) {
Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
@ -1026,8 +1034,8 @@ WriteSections64 (
}
} else if (mEhdr->e_machine == EM_AARCH64) {
INT64 Offset;
switch (ELF_R_TYPE(Rel->r_info)) {
INT64 Offset;
case R_AARCH64_LD64_GOT_LO12_NC:
//

View File

@ -1161,6 +1161,8 @@ Returns:
OutputFileTime = 0;
ZeroDebugFlag = FALSE;
SetPrintLevel(INFO_LOG_LEVEL + 1);
if (argc == 1) {
Error (NULL, 0, 1001, "Missing options", "No input options.");
Usage ();
@ -1382,6 +1384,14 @@ Returns:
continue;
}
if ((stricmp (argv[0], "--info") == 0)) {
SetPrintLevel (INFO_LOG_LEVEL);
NormalMsg ("Info output Mode Set!");
argc --;
argv ++;
continue;
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
SetPrintLevel (KEY_LOG_LEVEL);
KeyMsg ("Quiet output Mode Set!");

View File

@ -0,0 +1,310 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
9AC31D3725592B0400ABC5D3 /* libCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AC31D3625592B0400ABC5D3 /* libCommon.a */; };
9AD17D112559286100D22C6A /* Elf32Convert.c in Sources */ = {isa = PBXBuildFile; fileRef = 9AD17D102559286100D22C6A /* Elf32Convert.c */; };
9AD17D132559286800D22C6A /* Elf64Convert.c in Sources */ = {isa = PBXBuildFile; fileRef = 9AD17D122559286800D22C6A /* Elf64Convert.c */; };
9AD17D152559286F00D22C6A /* ElfConvert.c in Sources */ = {isa = PBXBuildFile; fileRef = 9AD17D142559286F00D22C6A /* ElfConvert.c */; };
9AD17D172559287800D22C6A /* GenFw.c in Sources */ = {isa = PBXBuildFile; fileRef = 9AD17D162559287800D22C6A /* GenFw.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9A9A3A852559281100B97949 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9A9A3A872559281200B97949 /* GenFw */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = GenFw; sourceTree = BUILT_PRODUCTS_DIR; };
9AC31D3625592B0400ABC5D3 /* libCommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCommon.a; path = ../libs/libCommon.a; sourceTree = "<group>"; };
9AD17D102559286100D22C6A /* Elf32Convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Elf32Convert.c; sourceTree = "<group>"; };
9AD17D122559286800D22C6A /* Elf64Convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Elf64Convert.c; sourceTree = "<group>"; };
9AD17D142559286F00D22C6A /* ElfConvert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ElfConvert.c; sourceTree = "<group>"; };
9AD17D162559287800D22C6A /* GenFw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GenFw.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
9A9A3A842559281100B97949 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9AC31D3725592B0400ABC5D3 /* libCommon.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9A9A3A7E2559281100B97949 = {
isa = PBXGroup;
children = (
9A9A3A892559281200B97949 /* GenFw */,
9A9A3A882559281200B97949 /* Products */,
);
sourceTree = "<group>";
};
9A9A3A882559281200B97949 /* Products */ = {
isa = PBXGroup;
children = (
9A9A3A872559281200B97949 /* GenFw */,
);
name = Products;
sourceTree = "<group>";
};
9A9A3A892559281200B97949 /* GenFw */ = {
isa = PBXGroup;
children = (
9AD17D102559286100D22C6A /* Elf32Convert.c */,
9AD17D122559286800D22C6A /* Elf64Convert.c */,
9AD17D142559286F00D22C6A /* ElfConvert.c */,
9AD17D162559287800D22C6A /* GenFw.c */,
9AC31D3625592B0400ABC5D3 /* libCommon.a */,
);
name = GenFw;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
9A9A3A862559281100B97949 /* GenFw */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9A9A3A8E2559281200B97949 /* Build configuration list for PBXNativeTarget "GenFw" */;
buildPhases = (
9A9A3A832559281100B97949 /* Sources */,
9A9A3A842559281100B97949 /* Frameworks */,
9A9A3A852559281100B97949 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = GenFw;
productName = GenFw;
productReference = 9A9A3A872559281200B97949 /* GenFw */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
9A9A3A7F2559281100B97949 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = Jief;
TargetAttributes = {
9A9A3A862559281100B97949 = {
CreatedOnToolsVersion = 11.2;
};
};
};
buildConfigurationList = 9A9A3A822559281100B97949 /* Build configuration list for PBXProject "GenFw" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 9A9A3A7E2559281100B97949;
productRefGroup = 9A9A3A882559281200B97949 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
9A9A3A862559281100B97949 /* GenFw */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
9A9A3A832559281100B97949 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9AD17D152559286F00D22C6A /* ElfConvert.c in Sources */,
9AD17D112559286100D22C6A /* Elf32Convert.c in Sources */,
9AD17D132559286800D22C6A /* Elf64Convert.c in Sources */,
9AD17D172559287800D22C6A /* GenFw.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
9A9A3A8C2559281200B97949 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/../Common",
"$(PROJECT_DIR)/../Include",
"$(PROJECT_DIR)/../Include/Common",
"$(PROJECT_DIR)/../Include/X64",
"$(PROJECT_DIR)/../Include/IndustryStandard",
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../libs";
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
9A9A3A8D2559281200B97949 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = NO;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/../Common",
"$(PROJECT_DIR)/../Include",
"$(PROJECT_DIR)/../Include/Common",
"$(PROJECT_DIR)/../Include/X64",
"$(PROJECT_DIR)/../Include/IndustryStandard",
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/../libs";
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
};
name = Release;
};
9A9A3A8F2559281200B97949 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
9A9A3A902559281200B97949 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
9A9A3A822559281100B97949 /* Build configuration list for PBXProject "GenFw" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9A9A3A8C2559281200B97949 /* Debug */,
9A9A3A8D2559281200B97949 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9A9A3A8E2559281200B97949 /* Build configuration list for PBXNativeTarget "GenFw" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9A9A3A8F2559281200B97949 /* Debug */,
9A9A3A902559281200B97949 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 9A9A3A7F2559281100B97949 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:GenFw.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9A9A3A862559281100B97949"
BuildableName = "GenFw"
BlueprintName = "GenFw"
ReferencedContainer = "container:GenFw.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "YES"
customWorkingDirectory = "/JiefLand/5.Devel/Clover/Clover-projects/Clover--CloverHackyColor--master.2/Build/Clover/RELEASE_GCC53/X64/rEFIt_UEFI/refit/DEBUG"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9A9A3A862559281100B97949"
BuildableName = "GenFw"
BlueprintName = "GenFw"
ReferencedContainer = "container:GenFw.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--info"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "-e UEFI_APPLICATION"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "-o CloverX64.efi"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "CloverX64.dll"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9A9A3A862559281100B97949"
BuildableName = "GenFw"
BlueprintName = "GenFw"
ReferencedContainer = "container:GenFw.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -31,6 +31,8 @@
# VALID_ARCHITECTURES = IA32 X64
#
# Jief : The only reason we need this, is because MSVC needs memcpy and memset to be compiled without /GL
[Sources]
memory.cpp
@ -46,4 +48,3 @@
[BuildOptions]
MSFT:*_*_*_CC_FLAGS = /GL-
GCC:*_*_*_CC_FLAGS = -Os -fno-lto

View File

@ -14,13 +14,13 @@ extern "C" {
*/
#ifdef __GNUC__
//void* memset(void* dst, int ch, UINTN count) __attribute__ ((used));
//void* memcpy(void* dst, const void* src, UINT64 count) __attribute__ ((used));
#else
// void* memset(void* dst, int ch, UINT64 count);
//void* memcpy(void* dst, const void* src, UINT64 count);
#endif
// Jief : I think __attribute__ ((used)) was needed for older version of GCC, can't remember.
// If you want to put it back, do it only for the compiler version that really needs it.
// Nov 2020 : With Gcc 10.2, defining it for memset is ok, but not needed. Defining it for memcpy generates an error in GenFW.
//#ifdef __GNUC__
// void* memset(void* dst, int ch, UINTN count) __attribute__ ((used));
// void* memcpy(void* dst, const void* src, UINTN count) __attribute__ ((used));
//#endif
void* memset(void* dst, int ch, UINTN count)
{

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -84,9 +84,9 @@ ctor_ptr* pend = (ctor_ptr*)&__end_of_section_ctors;
void construct_globals_objects(EFI_HANDLE ImageHandle)
{
(void)ImageHandle;
DBG("CTOR %llX %lld\n", (UINTN)p, (UINTN)p);
DBG("CTORS %llX(%lld) size %ld\n", (UINTN)p, (UINTN)p, pend-p );
while ( p < pend ) {
DBG("CTOR %llX %lld\n", (UINTN)p[0], (UINTN)p[0]);
DBG("CTOR %llX(%lld)\n", (UINTN)p[0], (UINTN)p[0]);
(*p)();
p++;
}