Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

luxinhaus - yes
 

--no-usb)
addEdk2BuildMacro DISABLE_USB_SUPPORT

Micky:

$RANDOM I put for case if someone gets the repository with "svn export" and is not source controlled. Didn't want it to always be the same number, but didn't think about accessing the repository directly. It's up to Slice.

.git is used with git-svn.

  • Like 1
Link to comment
Share on other sites

I committed as "0000". It is more clear then RANDOM.

1:035  0:001  Now is 25.4.2016,  14:31:43 (GMT)
1:035  0:000  Starting Clover rev 3471:3473 on CLOVER EFI
1:035  0:000  Build with: [Args: ./ebuild.sh | Command: build -D USE_LOW_EBDA -p Clover/Clover.dsc -a X64 -b RELEASE -t XCODE5 -n 3  | OS: 10.7.5 | XCODE: 4.4.1]
1:038  0:002  SelfDevicePath=PcieRoot(0x0)\Pci(0x1F,0x2)\VenHw(CF31FAC5-C24E-11D2-85F3-00A0C93EC93B,80)\HD(1,GPT,065C30D9-992D-4C4C-8965-A266108C7D0F,0x800,0x60000) @7F19D118
1:038  0:000  SelfDirPath = \EFI\CLOVER

  • Like 1
Link to comment
Share on other sites

$RANDOM I put for case if someone gets the repository with "svn export" and is not source controlled. Didn't want it to always be the same number, but didn't think about accessing the repository directly. It's up to Slice.

.git is used with git-svn.

clear, thanks

 

EDIT

about ISO

boot0md is not copied inside 'edk2/Clover/CloverPackage/CloverV2/BootSectors/' so show me an error when I create the iso (makeiso line 144). should be commented?

Link to comment
Share on other sites

clear, thanks

 

EDIT

about ISO

boot0md is not copied inside 'edk2/Clover/CloverPackage/CloverV2/BootSectors/' so show me an error when I create the iso (makeiso line 144). should be commented?

Look 3475

Link to comment
Share on other sites

first run failed due to mtoc.NEW not being found in /usr/local/bin. (had to copy it manually)

wouldn't be possible to include it in the repo.

 

Also, i have -t XCODE5 in my log even w/o specifying -xcode5 in ./ebuild.sh flag. normal?

Edited by luxinhaus
Link to comment
Share on other sites

I have numerous warning during compilation like

ld: warning: could not create compact unwind for _GetSleepImageLocation: non-standard register 4 being saved in prolog
ld: warning: could not create compact unwind for _GetSleepImagePosition: non-standard register 4 being saved in prolog

 

exception handling unwind tables gone rev 3479.

Shrinks CloverGUI by another 20K or so.

eh_frame is suppressed in GCC build too (-fno-asynchronous-unwind-tables)

Link to comment
Share on other sites

been trying to follow the thread lately on Xcode  :)

seems the goal is to compile clover using just the Xcode tools? that is without gcc and/or without extra items?

 

anyway, so today i tried it out...

 

so 2 questions

 

1) when i run ./ebuild.sh - it stops looking for mtoc.NEW? Note: i don't have mtoc (or mtoc.new) anywhere on my system - and gcc53 and gcc49 builds just. 

 

2) what does TOOLCHAIN or TOOLCHAIN_DIR need to be set to? thinking something like /Applications/Xcode.app/Contents/Developer/usr?

 

otherwise it seems to need the gcc53 toolchain in edk2/Clover../../toolchain ?

 

 

.....

[sLINK] GrubHFSPLUS
[DLINK1] Fat
/bin/sh: /usr/local/bin/mtoc.NEW: No such file or directory
make: *** [/Extra/Clover_Install/CloverGrowerPro/edk2/Build/Clover/RELEASE_XCODE5/X64/Clover/FatPkg/EnhancedFatDxe/Fat/DEBUG/Fat.efi] Error 127

build.py...
: error 7000: Failed to execute command
make tbuild [/Extra/Clover_Install/CloverGrowerPro/edk2/Build/Clover/RELEASE_XCODE5/X64/Clover/FatPkg/EnhancedFatDxe/Fat]

build.py...

Link to comment
Share on other sites

tluck,

  1. You can still build with gcc by using ./ebuild.sh -gcc49 or ./ebuild.sh -gcc53
  2. mtoc is needed for -xcode5 build which the default now.  A binary was posted to this thread several times.  Look on page 27 onward.  It is a bit tricky to build, but there are instructions on page 27 how to if you like.  The binary needs to be placed in /usr/local/bin/mtoc.NEW.
  3. We should find some solution for mtoc tool like other toolchain build scripts, but unfortunately mtoc is tricky to build.
  4. You don't need to worry about setting toolchain.  -xcode5 uses Xcode that you have installed (which is set via xcode-select tool).  nasm still needs to be in your $TOOLCHAIN_DIR/bin same place as before.  mtoc needs to be as above.  Those are all tools needed.
Link to comment
Share on other sites

@Zenith,

Great job!! BOOTX64 now down to 617KB. I am trying to dispense with gcc toolchain altogether but 

make -C "$WORKSPACE"/BaseTools CC="gcc -Wno-deprecated-declarations"

line 460 in ebuild.sh fails on native toolchain with this error:

FvLib.c:197:128: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
  ...mFvHeader + GetFfsFileLength(CurrentFile) + 0x07) & (-1 << 3)) + (UINT8 ...
                                                          ~~ ^
FvLib.c:482:171: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
  ...GetSectionFileLength(CurrentSection.CommonHeader) + 0x03) & (-1 << 2));

Now I know that we need to replace the values described with the shifting operation with the signed representation of the result but I don't really know how to do this. Any ideas? The reason I'm keen to do this is that I want to dispense altogether with additional non-native toolchains and save a great wad of disk space in the process. I also like the idea of clover compilation being 100% OSX native. Sad, I know  ;)

Link to comment
Share on other sites

dgsga: patch the makefile for BaseTools like this

diff a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -47,7 +47,7 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKE
 CPPFLAGS = $(INCLUDE)
 ifeq ($(DARWIN),Darwin)
 # assume clang or clang compatible flags on OS X
-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g
+CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g -Wno-shift-negative-value
 else
 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g
 endif

luxinhaus: Micky1979's

Link to comment
Share on other sites

I would rather not shift negatives than just shut the compiler up. :)

(-1 << 3) can easily be replaced with (~0x7) which looks much better anyhow.

 

Don't have a proper setup now, so s/o care to submit stuff to edk2-devel? Otherwise I will next month or so.

 

Edit: Maybe (~(UINTN)0x07) should be used if for some reason the compiler choses a funny size for 0x07.

Link to comment
Share on other sites

Bad idea... our one(s) are updated with latest llvm/lto code.

Shrug. Been working perfectly fine for me.

 

Had to compile it myself, else clang complains of it not being present.

Link to comment
Share on other sites

Well then is good, but checked the files size also? I hope llvm devs are doing only better with the passage of time..

EDIT

BTW the second link you posted expressly says to update llvm to build mtoc. :wink_anim:  

Link to comment
Share on other sites

I would rather not shift negatives than just shut the compiler up. :)

(-1 << 3) can easily be replaced with (~0x7) which looks much better anyhow.

Don't have a proper setup now, so s/o care to submit stuff to edk2-devel? Otherwise I will next month or so.

Edit: Maybe (~(UINTN)0x07) should be used if for some reason the compiler choses a funny size for 0x07.

@DF

Am I right in thinking that (-1<<2) be replaced with (~(UINTN)0x03)? If you could run through the logic it would be great

Link to comment
Share on other sites

@DF

Am I right in thinking that (-1<<2) be replaced with (~(UINTN)0x03)? If you could run through the logic it would be great

 

Yeah, you are right. :)

I didn't mean that you need to do it though, you may just as well use Zenith's patch now, I was just talking for the future.

Link to comment
Share on other sites

Well then is good, but checked the files size also? I hope llvm devs are doing only better with the passage of time..

EDIT

BTW the second link you posted expressly says to update llvm to build mtoc. :wink_anim:

LLVM was already the latest version.

Link to comment
Share on other sites

×
×
  • Create New...