chris1111 Posted April 26, 2022 Share Posted April 26, 2022 (edited) 16 hours ago, Jief_Machak said: Hi all. For the first time since a loooong while, I got some time to commit a nice refactoring (Yes, I know, another one 😀). Does it change anything for users ? Of course not ! I replaced the basic struct EFI_GUID by a class of the same name. What for ? Make it nicer for developer, which means more obvious, which mean less bug. * the object is 100% binary compatible with the previous one. So low level operation (CopyMem, CompareGuid, etc.) are still possible like before. It can also be passed to the libraries. * no need anymore for (let's say you have a EFI_GUID guid object) : - StrToGuid : just call guid.toXString8() or guid.toXStringW() (you can chain guid.toXString8().c_str() or guid.toXStringW().wc_str() if low level char access is needed). - AsciiStrToGuid : just call guid.takeValueFrom(...) - CopyGuid : just assign. guid1 = guid2 - CompareGuid : just compare. "if ( guid1 == guid2 )". (Honestly, return true when equal when all C compare function return 0 when equal ???. That's why more obvious is less bug) * I replaced all CONST EFI_GUID* in librairies parameter by const EFI_GUID& through a preprocessor macro (CONST_EFI_GUID_PTR_T and JCONST_EFI_GUID_PTR_T). So when it's compiled without this new replacement, it compiles exactly like it was before. Why replacing a pointer (CONST EFI_GUID*) by a reference (const EFI_GUID&) ? For the usual reason : if you call an EFI function that takes a pointer to a guid, you can (you should!) always wonder if the function will modify that parameter. EDK function are generally well made enough to identify IN and OUT parameter, but you have to go look at the documentation or the prototype. Now, because you can call a function that takes an EFI_GUID parameter as input without taking the address yourself, you know that it's an non modified input parameter. Example : instead of Status = gBS->LocateProtocol(&gAppleSMCProtocolGuid, NULL, (void**)&gAppleSmc); use Status = gBS->LocateProtocol(gAppleSMCProtocolGuid, NULL, (void**)&gAppleSmc); The idea is : use a guid like you would use an int. Assign, compare, give as parameter. Of course, if a function has an output EFI_GUID parameter, the need to take the address with & remains to remind you that it will be changed by the call. Ok, now I'm going back to the refactor I've started more than 2 years ago 😇 Ok great but big problem with Xcode on that commits. Not test GCC Spoiler Edited April 27, 2022 by chris1111 Link to comment Share on other sites More sharing options...
Slice Posted April 27, 2022 Share Posted April 27, 2022 No errors with gcc. 2 Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 27, 2022 Share Posted April 27, 2022 14 hours ago, chris1111 said: Ok great but big problem with Xcode on that commits. Not test GCC Reveal hidden contents You probably have a newer Xcode than me. They have deprecated something. I'll a closer look in few hours. 23 hours ago, Slice said: Hi @Jief_Machak, Good work as usual. Can you also comment your commit about "Skip" in patching? It skips some replacement. Like for kernel and kext patching. I know that TgtBridge is a way better way. because DSDT can change with BIOS settings, using a skip count is unreliable. But I end up with a case I couldn't resolve with TgtBridge... 1 Link to comment Share on other sites More sharing options...
Matgen84 Posted April 27, 2022 Share Posted April 27, 2022 2 hours ago, Jief_Machak said: You probably have a newer Xcode than me. They have deprecated something. I'll a closer look in few hours. Hi @Jief_Machak glad to see you back on the forum. 🙂 I also have the same problem with XCODE 12.4 on Catalina. 1 Link to comment Share on other sites More sharing options...
Slice Posted April 27, 2022 Share Posted April 27, 2022 18 hours ago, chris1111 said: Ok great but big problem with Xcode on that commits. Not test GCC Reveal hidden contents Attention of @Jief_Machak https://stackoverflow.com/questions/66115771/whats-the-meaning-of-gcc-g-error-implicitly-declared-constructor-is-depreca 1 Link to comment Share on other sites More sharing options...
chris1111 Posted April 27, 2022 Share Posted April 27, 2022 4 hours ago, Jief_Machak said: You probably have a newer Xcode than me. They have deprecated something. I'll a closer look in few hours. It skips some replacement. Like for kernel and kext patching. I know that TgtBridge is a way better way. because DSDT can change with BIOS settings, using a skip count is unreliable. But I end up with a case I couldn't resolve with TgtBridge... Hi I use Xcode 13.2.1 Link to comment Share on other sites More sharing options...
tluck Posted April 27, 2022 Share Posted April 27, 2022 7 hours ago, chris1111 said: Hi I use Xcode 13.2.1 im on 13.2.1 too and see this trying to compile the last commit. ``` CC] Test In file included from <built-in>:1: In file included from /opt/Source/Clover/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.h:16: In file included from /opt/Source/Clover/MdePkg/Include/Uefi.h:23: constexpr GUID(const GUID& other) : GUID{other.Data1, other.Data2, other.Data3, {other.Data4[0], other.Data4[1], other.Data4[2], other.Data4[3], other.Data4[4], other.Data4[5], other.Data4[6], other.Data4[7]}} { } ^ /opt/Source/Clover/rEFIt_UEFI/include/Guid++.h:69:26: note: in implicit copy assignment operator for 'GUID' first required here void setNull() { *this = GUID(); } ^ [DLINK] SMCHelper [SLINK] UsbMouseDxe [DLINK] NullMemoryTestDxe [CC] BiosVideo [CC] AutoGen [DLINK] UsbMouseDxe [CC] AutoGen [SLINK] FSInject [SLINK] OhciDxe [SLINK] GraphicsConsoleDxe [DLINK] FSInject [CC] ComponentName [DLINK] OhciDxe [DLINK] GraphicsConsoleDxe [CC] AudioDxe [CC] ComponentName [MTOC] NullMemoryTestDxe 1 error generated. [CC] UsbBus make: *** [/opt/Source/Clover/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit/OUTPUT/Platform/APFS.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/opt/Source/Clover/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit] Link to comment Share on other sites More sharing options...
matxpa Posted April 28, 2022 Share Posted April 28, 2022 Hi, with Xcode 13.3.1 and Monterey 12.4 beta 3 (21F5063e) too, same error with r5146 and last commit 1ea4700. 1 Link to comment Share on other sites More sharing options...
Slice Posted April 29, 2022 Share Posted April 29, 2022 @chris1111, @tluck, check commit 60b2ed52b Link to comment Share on other sites More sharing options...
LAbyOne Posted April 30, 2022 Share Posted April 30, 2022 Posted new update to Clover Suite Builder 1.7 a few tools needed correcting typos and few more added 3 Link to comment Share on other sites More sharing options...
Matgen84 Posted April 30, 2022 Share Posted April 30, 2022 14 hours ago, Slice said: @chris1111, @tluck, check commit 60b2ed52b @Slice can't build commit 60b2ed52b. (Catalina, XCODE 12.4). Build log file attached. Clover_Build.log Link to comment Share on other sites More sharing options...
chris1111 Posted April 30, 2022 Share Posted April 30, 2022 (edited) 15 hours ago, Slice said: @chris1111, @tluck, check commit 60b2ed52b @Slice No error again EDIT *** ACPIPatcher fault Spoiler 1 error generated. make: *** [/Users/chris/src/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit/OUTPUT/Platform/AcpiPatcher.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/Users/chris/src/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit] build.py... : error F002: Failed to build module /Users/chris/src/CloverBootloader/rEFIt_UEFI/refit.inf [X64, XCODE8, RELEASE] - Failed - Build end time: 05:42:07, Apr.30 2022 Build total time: 00:00:49 Edited April 30, 2022 by chris1111 Link to comment Share on other sites More sharing options...
Slice Posted April 30, 2022 Share Posted April 30, 2022 9 minutes ago, chris1111 said: @Slice No error again EDIT *** ACPIPatcher fault Hide contents 1 error generated. make: *** [/Users/chris/src/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit/OUTPUT/Platform/AcpiPatcher.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/Users/chris/src/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/rEFIt_UEFI/refit] build.py... : error F002: Failed to build module /Users/chris/src/CloverBootloader/rEFIt_UEFI/refit.inf [X64, XCODE8, RELEASE] - Failed - Build end time: 05:42:07, Apr.30 2022 Build total time: 00:00:49 Please provide full log as I see no whre the error was occured. 36 minutes ago, Matgen84 said: @Slice can't build commit 60b2ed52b. (Catalina, XCODE 12.4). Build log file attached. Clover_Build.log 135.81 kB · 0 downloads This is dirty compilation. Delete Build folder and try again. @Jief_Machak New Clover hangs at DBG(" Boot0082 points to Volume with UUID:%s\n", BootGUID.toXString8().c_str()); because BootGUID is null. Old clover has strguid(BootGUID) which produces a string "<null guid>" in this case. 2 Link to comment Share on other sites More sharing options...
chris1111 Posted April 30, 2022 Share Posted April 30, 2022 6 minutes ago, Slice said: Please provide full log as I see no whre the error was occured. here full output Terminal Saved Output.zip Link to comment Share on other sites More sharing options...
Matgen84 Posted April 30, 2022 Share Posted April 30, 2022 1 hour ago, Slice said: This is dirty compilation. Delete Build folder and try again. I manually remove Build folder and Clover_Build.log file from previous build. Normally, my script does it automatically at each compilation. Clover_Build.log Link to comment Share on other sites More sharing options...
Slice Posted April 30, 2022 Share Posted April 30, 2022 2 hours ago, chris1111 said: here full output Terminal Saved Output.zip 14.48 kB · 0 downloads OK, understand. It is second appearance of the conflict. Test please commit 4ba408424 1 hour ago, Matgen84 said: I manually remove Build folder and Clover_Build.log file from previous build. Normally, my script does it automatically at each compilation. Clover_Build.log 113.34 kB · 0 downloads I didn't understand this message Quote [CC] DebugHelp <built-in>:367:10: warning: non-portable path to file '"/Users/mathieu/src/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/MdePkg/Library/BaseLib/BaseLib/DEBUG/AutoGen.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] #include "/Users/mathieu/src/Cloverbootloader/Build/Clover/RELEASE_XCODE8/X64/MdePkg/Library/BaseLib/BaseLib/DEBUG/AutoGen.h" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "/Users/mathieu/src/CloverBootloader/Build/Clover/RELEASE_XCODE8/X64/MdePkg/Library/BaseLib/BaseLib/DEBUG/AutoGen.h" 1 warning generated. [ Autogen.h from MdePkg is not my mistake. Why this warning is here? 1 Link to comment Share on other sites More sharing options...
chris1111 Posted April 30, 2022 Share Posted April 30, 2022 @Slice no good Attaching Output 2 Terminal Saved Output-2.zip 1 Link to comment Share on other sites More sharing options...
Matgen84 Posted April 30, 2022 Share Posted April 30, 2022 20 minutes ago, Slice said: Test please commit 4ba408424 Build failed. Here log file Clover_Build.log 1 Link to comment Share on other sites More sharing options...
Slice Posted April 30, 2022 Share Posted April 30, 2022 Next commit. Test please. I am sorry, I can't test because I have no Xcode 13 while other compilers has no issue. Link to comment Share on other sites More sharing options...
Slice Posted April 30, 2022 Share Posted April 30, 2022 Done! Generating BootSectors make: Nothing to be done for `all'. Done! * Clover build process took 3m51s to complete... sergey@iMac-Pro CloverBootloader % Link to comment Share on other sites More sharing options...
chris1111 Posted April 30, 2022 Share Posted April 30, 2022 Xcode 13.2.1 issue is persistant I try recompile from scratch and also Update Clover but is the same problem GCC work fine 😉 Terminal Saved Output-3.zip 1 Link to comment Share on other sites More sharing options...
MifJpnAlphaPlus Posted April 30, 2022 Share Posted April 30, 2022 1 hour ago, chris1111 said: Xcode 13.2.1 issue is persistant I try recompile from scratch and also Update Clover but is the same problem GCC work fine 😉 Terminal Saved Output-3.zip 4.42 kB · 0 downloads [SLINK] OcDebugLogLib [CC] LRotU64 /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.c: In function 'AcpiNormalizeTableHeaders': /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.c:634:28: error: 'EFI_ACPI_DESCRIPTION_HEADER' has no member named 'SignatureCommon' 634 | Walker = (CHAR8 *) &Table->SignatureCommon.Signature; | ^~ /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.c:635:40: error: 'EFI_ACPI_DESCRIPTION_HEADER' has no member named 'SignatureCommon' 635 | for (Index = 0; Index < sizeof (Table->SignatureCommon.Signature); ++Index) { | ^~ [CC] OcDriverConnectionLib [CC] Dh /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.c: At top level: cc1: note: unrecognized command-line option '-Wno-incompatible-ms-struct' may have been intended to silence earlier diagnostics make: *** [/Users/alpha/CloverBootloader/Build/Clover/RELEASE_GCC53/X64/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib/OUTPUT/OcAcpiLib.obj] Error 1 build.py... : error 7000: Failed to execute command make tbuild [/Users/alpha/CloverBootloader/Build/Clover/RELEASE_GCC53/X64/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib] build.py... : error F002: Failed to build module /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.inf [X64, GCC53, RELEASE] Hello me too.(BigSur Xcode 13.2.1) ./buildme xcode8 [CC] BigNumMontgomery /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.c:634:30: error: no member named 'SignatureCommon' in 'EFI_ACPI_DESCRIPTION_HEADER' Walker = (CHAR8 *) &Table->SignatureCommon.Signature; ~~~~~ ^ /Users/alpha/CloverBootloader/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib.c:635:42: error: no member named 'SignatureCommon' in 'EFI_ACPI_DESCRIPTION_HEADER' for (Index = 0; Index < sizeof (Table->SignatureCommon.Signature); ++Index) { Thank you. 1 Link to comment Share on other sites More sharing options...
Slice Posted May 1, 2022 Share Posted May 1, 2022 7 hours ago, chris1111 said: Xcode 13.2.1 issue is persistant I try recompile from scratch and also Update Clover but is the same problem GCC work fine 😉 Terminal Saved Output-3.zip 4.42 kB · 1 download You just didn't update embedded OpenCore See https://github.com/CloverHackyColor/OpenCorePkg/commit/614bd7b4ec82d10f6719faad61cc3adfda767a3b @MifJpnAlphaPlus The same Link to comment Share on other sites More sharing options...
Matgen84 Posted May 1, 2022 Share Posted May 1, 2022 Hi @Slice Can't build. 😪 My local repo : HEAD is now at beafbb0b Merge branch 'master' of https://github.com/CloverHackyColor/OpenCorePkg HEAD is now at b8c935a64 Merge branch 'master' of https://github.com/CloverHackyColor/CloverBootloader Clover GitHub repo : Spoiler I don't understand why there is a difference ! Clover_Build.log Link to comment Share on other sites More sharing options...
Slice Posted May 1, 2022 Share Posted May 1, 2022 Strange, but I see successful compilation - Done - Build end time: 10:11:30, May.01 2022 Build total time: 00:02:50 ... -> CloverX64-RELEASE_XCODE8-20220430215154-b8c935a-dirty.efi ... Copy CloverEFI: -> boot6 Changing byte at 0xa9 of boot6 to show 6 as init message: What else to compile in your script? Link to comment Share on other sites More sharing options...
Recommended Posts