Jump to content
Micky1979

Build_Clover.command, another Script to build standard Clover (or customized)

2,080 posts in this topic

Recommended Posts

Advertisement

Sorry, but with latest Build_Clover script v4.6.2 i get the following error when building with XCode 9.2:

 

 

Attempting to detect HOST_ARCH from 'uname -m': x86_64
Detected HOST_ARCH of X64 using uname.
mkdir -p .
make -C Common
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 PcdValueCommon.c -o PcdValueCommon.o
PcdValueCommon.c:270:47: error: format specifies type 'unsigned long' but the argument has
      type 'UINT64' (aka 'unsigned long long') [-Werror,-Wformat]
    sprintf(PcdList[Index].Value, "0x%016lx", Value);
                                     ~~~~~~   ^~~~~
                                     %016llx
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/secure/_stdio.h:47:56: note: 
      expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                       ^~~~~~~~~~~
1 error generated.
make[2]: *** [PcdValueCommon.o] Error 1
make[1]: *** [Common] Error 2
make: *** [Source/C] Error 2

o_Ops, ./ebuild.sh exited with error(s), aborting..

 

 

 

Also confirmed by me, I can't build new BaseTools with latest edk revision atm.

Share this post


Link to post
Share on other sites

This issue was introduced in edk2 r25984 and I'm pretty sure it has something to do with lines 269-273 in edk2/BaseTools/Source/C/Common/PcdValueCommon.c:

#ifdef __GNUC__
    sprintf(PcdList[Index].Value, "0x%016lx", Value);
#else
    sprintf(PcdList[Index].Value, "0x%016llx", Value);
#endif

Whatever defines that GNUC macro, it also breaks the Basetools build. Enforcing the "else" part solves (maybe?!?) the build problem.

Share this post


Link to post
Share on other sites

That doesn't even make sense as a change. sprintf is a standardized function and %llx means long long. Since that is the compiler implementation it has special format specifier checks. No idea why that change was made unless they are explicitly disabling C99 support for GCC when compiling. Ironically, MVSC does not use C99 by default but %llx is always implemented... lol.

Share this post


Link to post
Share on other sites

That doesn't even make sense as a change. sprintf is a standardized function and %llx means long long. Since that is the compiler implementation it has special format specifier checks. No idea why that change was made unless they are explicitly disabling C99 support for GCC when compiling. Ironically, MVSC does not use C99 by default but %llx is always implemented... lol.

That file is brand new, introduced in this commit. Maybe the commit's author hasn't ever heard of any other toolchains/OSes/whatever hahaha... Even so, Xcode hardly could fall into the "GNU C" category as it's the Apple's proprietary toolchain. In term of "GNU C support", that's different story.

Share this post


Link to post
Share on other sites

That file is brand new, introduced in this commit. Maybe the commit's author hasn't ever heard of any other toolchains/OSes/whatever hahaha... Even so, Xcode hardly could fall into the "GNU C" category as it's the Apple's proprietary toolchain. In term of "GNU C support", that's different story.

 

Depending on the Xcode version you might be using GCC, but it eventually switched to clang at some point, which actually has a less restrictive license and is open source and not made by apple. Clang is supposed to be 100% compatible with GCC, it's one of it's top tauted features because it's supposedly also faster. Clang also defines GCC predefined macros so this would affect anything built in Xcode. There is one reason and one reason only to make that change, building with GCC or clang and disabling C99 support. Otherwise, the variable is a UINT64 and every compiler has support for %llx if it supports C99 and some always do, like MSVC. It's just a bad commit, the macro should not be checking for GCC alone but also for C99 being disabled, then it would be the correct preprocessing.

 

EDIT: Like checking __STDC_VERSION__ < 199901L

EDIT2: Forgot Apple clang 4.0 is actually a fork of clang 3.1, so it's kinda made by apple but it's still licensed under BSD, so it might as well be owned by a child in africa because that's not a very broadly enforceable license.

Share this post


Link to post
Share on other sites

Here's the output of gcc -dM -E ./PcdValueCommon.c

In the Appe's clang that macro IS defined and even returns a value of 4.

 

Yes because it's saying its parsing compatible with GCC 4.2.1.

Share this post


Link to post
Share on other sites

Is there any reason on one of my hacks (Laptop) i have this option

8) Try Clover Configurator Pro.app

But on my other hack (Desktop) that option is not there.

Both machines are running v4.6.2

Share this post


Link to post
Share on other sites

Is there any reason on one of my hacks (Laptop) i have this option

8) Try Clover Configurator Pro.app

But on my other hack (Desktop) that option is not there.

Both machines are running v4.6.2

 

Are you sure in the machine (desktop) you have the app?

I mean if the "Clover Configurator Pro.app" is present than the option will be not displayed...

 

EDIT: or maybe in your settings the key SHOWCCP_ADVERTISE is set to NO

 

ErmaC

Share this post


Link to post
Share on other sites

Just a request for Build_Clover.command to include an option to build AptioMemoryFix and include AptioMemoryFix.efi in /drivers64UEFI.

At present, I manually build from terminal...

cd ~/src/edk2
git clone https://github.com/vit9696/AptioFixPkg.git
git clone https://github.com/CupertinoNet/CupertinoModulePkg
git clone https://github.com/CupertinoNet/EfiMiscPkg
git clone https://github.com/CupertinoNet/EfiPkg
export NASM_PREFIX="~/src/opt/local/bin/"
source edksetup.sh
make -C BaseTools
touch edk2.ready
build -a X64 -b RELEASE -t XCODE5 -p AptioFixPkg/AptioFixPkg.dsc

---> outputs binary files in ~/src/edk2/Build/AptioFixPkg/RELEASE_XCODE5/X64.

 

Thanks to all the devs involved :)

Share this post


Link to post
Share on other sites

Hi

 

Clover r4382: I don't no why AptioMemoryFix and AptioInputFix can't be compile (add) with Build_Clover.command v4.6.2? 

 

Thanks

 

Share this post


Link to post
Share on other sites

Hi

 

Clover r4382: I don't no why AptioMemoryFix and AptioInputFix can't be compile (add) with Build_Clover.command v4.6.2? 

 

Thanks

They must be compiled with the same toolset

 

 

~/src/edk2/Build/AptioFixPkg/RELEASE_XCODE5/X64.

Share this post


Link to post
Share on other sites

@Slice

 

Sorry but I dont understand what you say with ~/src/edk2/Build/AptioFixPkg/RELEASE_XCODE5/X64.

 

I can compile AptioMemory and AptioInput with vit9696 tool files. ButI I thought to do it with Build_Clover since aptioMemory seems to be in Clover sources. Both files do not appear in Clover installer updater pkg.

 

 

Sorry for my bad english

Share this post


Link to post
Share on other sites

@Slice

 

Sorry but I dont understand what you say with ~/src/edk2/Build/AptioFixPkg/RELEASE_XCODE5/X64.

 

I can compile AptioMemory and AptioInput with vit9696 tool files. ButI I thought to do it with Build_Clover since aptioMemory seems to be in Clover sources. Both files do not appear in Clover installer updater pkg.

 

 

Sorry for my bad english

vit9696 tool compile AptioFix with XCODE5 toolset.

Be sure you are using same toolset when you build Clover.

(I don't use Build_Clover.command v4.6.2 and don't know it).

 

For Clover release I have used XCODE8 toolset for both.

Share this post


Link to post
Share on other sites

Hi

 

Clover r4382: I don't no why AptioMemoryFix and AptioInputFix can't be compile (add) with Build_Clover.command v4.6.2? 

 

Thanks

 

The latest commits for AptioFixPkg (jan 17 2018) seem to only build with nasm v2.13.02 in /usr/local/bin.  If I use export NASM_PREFIX="~/src/opt/local/bin/", I now get a nasm build error during the build phase.

 

The following steps worked for me to fix the build...

1)  Delete the old ~/src/edk2/AptioFixPkg folder and reboot the computer.  Clean the edk2 build environment by running Build_Clover.command option 3 (Update Clover + force edk2 update), then exit with option 11.

2)  Install the attached nasm v2.13.02 in /usr/local/bin

sudo cp ~/Downloads/nasm /usr/local/bin/

3)  Then run the following commands to build AptioMemoryFix.efi again...

cd ~/src/edk2
git clone https://github.com/vit9696/AptioFixPkg.git
git clone https://github.com/CupertinoNet/CupertinoModulePkg
git clone https://github.com/CupertinoNet/EfiMiscPkg
git clone https://github.com/CupertinoNet/EfiPkg
source edksetup.sh
make -C BaseTools
touch edk2.ready
build -a X64 -b RELEASE -t XCODE5 -p AptioFixPkg/AptioFixPkg.dsc

---> output binary files in ~/src/edk2/Build/AptioFixPkg/RELEASE_XCODE5/X64

 

4)  Replace OsxAptioFix3Drv-64.efi in ~/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI with AptioMemoryFix.efi.

 

Slightly modified @vit9696's build script (attached Build_AptioFixPkg.sh) so it uses existing ~/src/edk2  ---> output to ~/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI.

 

EditBuild_Clover.command v4.6.4 now automatically compiles AptioMemoryFix.efi when using XCODE5 toolchain.  Thanks @Micky1979 and @Vit9696 :).

nasm.zip

Compiled AptioFixPkg.zip

Build_AptioFixPkg.sh.zip

Share this post


Link to post
Share on other sites

The latest commits for AptioFixPkg (jan 17 2018) seem to only build with nasm v2.13.02 in /usr/local/bin.  If I use export NASM_PREFIX="~/src/opt/local/bin/", I now get a nasm build error during the build phase.

 

The following steps worked for me to fix the build...

1)  Delete the old ~/src/edk2/AptioFixPkg folder and reboot the computer.  Clean the edk2 build environment by running Build_Clover.command option 3 (Update Clover + force edk2 update), then exit with option 11.

2)  Install the attached nasm v2.13.02 in /usr/local/bin

sudo cp ~/Downloads/nasm /usr/local/bin/

3)  Then run the following commands to build AptioMemoryFix.efi again...

cd ~/src/edk2
git clone https://github.com/vit9696/AptioFixPkg.git
git clone https://github.com/CupertinoNet/CupertinoModulePkg
git clone https://github.com/CupertinoNet/EfiMiscPkg
git clone https://github.com/CupertinoNet/EfiPkg
source edksetup.sh
make -C BaseTools
touch edk2.ready
build -a X64 -b RELEASE -t XCODE5 -p AptioFixPkg/AptioFixPkg.dsc

---> output binary files in ~/src/edk2/Build/AptioFixPkg/RELEASE_XCODE5/X64

 

4)  Replace OsxAptioFix3Drv-64.efi in ~/src/edk2/Clover/CloverPackage/CloverV2/drivers-Off/drivers64UEFI with AptioMemoryFix.efi.

Or you could just use the script I made that does everything automated for you.

AptioMemory_Builder.sh.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By RougeOne
      Budget Workstation MacOS 10.14.1 build: z370 AORUS Gaming 5 - i5-8600K - RX 580 - UHD 630
      flawless iGPU/dGPU integration, fast FCPX editing/rendering, great overall performance for ~$1200 / ~£1000
       
      Update: updated WhateverGreen and Lilu, then updated OS to 10.14.3 and everything is fine! Even iMessage, which previously I hadn't been able to make work, is now working - possibly the update flushed the NVRAM?
       
      I'm gonna come straight out and admit it - I used newb tools which are considered taboo on InsanelyMac, and so this isn't so much an installation guide as it is a green flag to anyone considering the same hardware. My first and previous Hackintosh project was just over ten years ago and this site was massively helpful, so this is my (very small) way of giving back.
       
      EFI DIRECTORY
      http://s000.tinyupload.com/index.php?file_id=97606131925137056003
       
      HARDWARE
      CPU: Intel i5-8600K 3.6GHz hexacore (contains UHD 630 iGPU)
      CPU Cooler: be quiet! Pure Rock Slim (no paste needed, and fan facing front)
      Mobo: GIGABYTE z370 AORUS Gaming 5 (WIFI)
      RAM: 1x 8GB CORSAIR Vengeance LPX C16 2666MHz (in first slot)
      GFX Card: Sapphire RX 580 NITRO+ SE
      SATA: used ports 0, 1, 3, 5 (HDD problems when connected to port 4)
      HDD: generic
      DVD Drive: generic
      PSU: EVGA 500W Semi Modular (but you should get 650W!)
      Case: CoolerMaster CM590 III
      Fans: 2x stock case fans (one sucky on front, one blowy on back), 3x be quiet! BL046 120mm fans (two blowy on top, one sucky on front). Airflow near-perfectly balanced.
       
      ADVICE
      With the Clover configuration, you want to pay close attention to all things relating to graphics. There are some specific settings for ACPI, Boot, Devices and Graphics which should be copied exactly in order to get the iGPU and dGPU to work in perfect harmony. For instance, make sure you use ig-platform-id 59120003 rather than 59120000 if you want FCPX to be usable. With the right settings, FCPX will not only run, but run flawlessly.
       
      I was not able to figure out how to make NVRAM/PRAM behave itself, and I got errors when I tried to issue relevant commands. As a result, I could not at first get iMessage to work properly. It worked once on my first installation attempt but not from subsequent attempts. This Clover configuration therefore has no consideration whatsoever toward iMessage reliability - however, iMessage ended up working somehow, anyway - I noticed it after I'd updated to 10.14.3 but this may just have been coincidence.
       
      Onboard WiFi does not work. There is no driver for it. I'm using wired ethernet to a bridge router as it was cheaper than getting a compatible PCI card.
       
      Audio is working well after I installed the z370 audio patch, then the ALC1220 codecs, then AppleALC.
       
      With kexts for generic 3rd party SATA and generic 3rd party eSATA, my HDDs and DVD drive work perfectly well.
       
      Sleep/Wake functions run perfectly. iCloud functions run perfectly. Shutdown leaves the mobo LEDs on, annoyingly.
       
      My USB 3 ports seem to suffer from low power output, and I don't know why.
       
      Overall, this system appears to run about as well under MacOS 10.14 Mojave as it does under Windows 7. I would solidly recommend this build to anyone looking to build a computer for workstation purposes, on a budget.
    • By JhonneR
      Good morning, everyone, I'm sorry if I was wrong in choosing the topic but I need help.
      I have found it extremely difficult to mount a Hackintosh in my acer.
      Setup;
      I5 2430m 2.4 6GB RAM
      Mobo P5we0 - Intel intel Graphics 3000
      At the moment I have not found out what my audio codecs are.
      but I'll leave the link on the motherboard.
      however, my real problem is several.
      I have already used the itakos image, I have already used several images that could be installed normally and that after installing the image I do not have internet via cable or wireless.
      And another, I already looked in other forums and I know that I will be called a donkey in the logical question but I have not been able to install the [url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url] or clover to start from the Hard Disk, so I do not know what to do.At the moment I still do not know if there has already been someone who has already installed the High Sierra or just the Sierra in this notebook model and obtained permanent success.
      If anyone can help me, I'll be grateful.
      Installations without success, but with the system already installed in ACER;
      SIERRA
      HIGH SIERRA
      MOJAVE
      All with the same symptom. Starting only by the bootable USB stick and without internet connection via cable and wireless.
      Appreciate ! Acer 5750 Official Page
    • By Slice
      Since rev 4844 Vector Themes are supported and there are ready-to-use Clovy by Clovy, cesium by Slice and BGM_SVG by Blackosx.
      You may see it's structure to create own theme
      -------------------------------------------------------------------------------------------------------------------------------------------------------
       
       
      Now I want to add vector graphics support in Clover. See rev 4560 and later.
      It is not working yet but designers may begin to create Vector Themes.
      It supposed to consist of SVG elements and has design size. It will be rendered to any screen size scaled from design size.
       
      What application in macOS can create SVG graphics?
      Inkscape is not working in macOS 10.11+. Pity.
      LibreOffice Draw works with SVG but buggy.
      Boxy SVG cost 10$ but looks good enough. It creates the best in simplicity files and have more then enough features.
      Illustrator is good but expensive.
       
      How to improve SVG file?
      Clover has restricted support for SVG. It is your job to make compatible file and as small as possible to speedup rendering.
      Some helps:
      Help:Inkscape – From invalid to valid SVG Inkscape files
      From invalid to valid SVG Adobe Illustrator files
      From invalid to valid SVG files of other editors: BKchem, ChemDraw and CorelDRAW
      Help:Illustrator – Assistance with creating and saving SVG images in Adobe Illustrator that will pass W3C validation
      User:Quibik/Cleaning up SVG files manually
      Later I will write own instructions specific to Clover abilities.
       
      How to create SVG fonts?
      You can google to find ready-to-use SVG fonts.  I found some problems with too beaty fonts: slow rendering and overflow crash. Be careful.
      You can get ttf or otf fonts and convert them into svg by using online WEB services. Not a problem to google.
      But then I want to find a way to simplify the font to reduce a size and speedup rendering.
      You can create own font by FontForge It is opensource and available for Windows, Mac and GNU+Linux. It creates otf font which you can convert to svg font.
       
      Pictures from Badruzeus
      https://www.insanelymac.com/forum/applications/core/interface/file/attachment.php?id=301597
×