Jump to content

Clover General discussion


ErmaC
30,171 posts in this topic

Recommended Posts

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 :hysterical: !

 

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

753213448_ScreenShot2022-04-26at4_06_47PM.png.0e6d04a124cc9b72ac7bd079c2529db2.png

 

 

 

 

Edited by chris1111
Link to comment
Share on other sites

14 hours ago, chris1111 said:

Ok great but big problem with Xcode on that commits. Not test GCC

  Reveal hidden contents

753213448_ScreenShot2022-04-26at4_06_47PM.png.0e6d04a124cc9b72ac7bd079c2529db2.png

 

 

 

 

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...

  • Like 1
Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

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

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

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 by chris1111
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

2 hours ago, chris1111 said:

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?

  • Sad 1
Link to comment
Share on other sites

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

1 hour ago, chris1111 said:

Xcode 13.2.1 issue is persistant

:angel_not: 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.

 

  • Like 1
Link to comment
Share on other sites

7 hours ago, chris1111 said:

Xcode 13.2.1 issue is persistant

:angel_not: 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

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

514123009_Capturedcran2022-05-0110_17_48.png.05074cd215440e0142352caf1827c408.png

 

I don't understand why there is a difference !

Clover_Build.log

Link to comment
Share on other sites

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

×
×
  • Create New...