Re: [edk2] building EDK2 for Xcode on Mac OS X 10.7.4

Subject: Re: [edk2] building EDK2 for Xcode on Mac OS X 10.7.4

From: Andrew Fish <afish@apple.com>

To: edk2-devel@lists.sourceforge.net

Date: 2012-05-23 02:50:15

Stuart,

I'm back from vacation and I've installed Xcode 4.3.2. 

I noticed with Xcode 4.3.2 there is an extra step required under Preferences->Downloads as you know need to install the Command Line Tools. If you don't do this you will not get tools in the old locations of /usr/bin. 

The only issue I saw was the XCODE32 target used by EmulatorPkg did not work. I made the following change to the Conf/tools_def.txt file to get things working. 

~/work/edk2TOT>diff Conf/tools_def.txt BaseTools/Conf/tools_def.template 
4509c4509
< *_XCODE32_X64_CC_PATH       = gcc
---
> *_XCODE32_X64_CC_PATH       = gcc-4.2
4513,4514c4513,4514
< *_XCODE32_X64_PP_PATH       = gcc
< *_XCODE32_X64_VFRPP_PATH    = gcc
---
> *_XCODE32_X64_PP_PATH       = gcc-4.2
> *_XCODE32_X64_VFRPP_PATH    = gcc-4.2

So this works for me with svn 13351
~/work/edk2TOT>. edksetup.sh BaseTools
Loading previous configuration from $WORKSPACE/Conf/BuildEnv.sh
WORKSPACE: /Users/fish/work/edk2TOT
EDK_TOOLS_PATH: /Users/fish/work/edk2TOT/BaseTools
~/work/edk2TOT>cd EmulatorPkg/
~/work/edk2TOT/EmulatorPkg>./build.sh
~/work/edk2TOT/EmulatorPkg>./build.sh run

Andrew Fish

PS I checked the fix into the BaseTools project, but it can take a while to sync back with edk2. 



On May 17, 2012, at 7:42 AM, Andrew Fish wrote:



On May 16, 2012, at 10:10 PM, Stuart Smith wrote:

Andrew
thank you very much for your reply. As you can tell, I'm new to this.

On May 15, 2012, at 7:03 PM, edk2-devel-request@lists.sourceforge.net wrote:

Message: 3
Date: Tue, 15 May 2012 16:16:41 -0700
From: Andrew Fish <afish@apple.com>
Subject: Re: [edk2] building EDK2 for Xcode on Mac OS X 10.7.4
To: edk2-devel@lists.sourceforge.net
Message-ID: <97A6BC43-C2A8-4A2B-B2CC-C1FD8FA6D23B@apple.com>
Content-Type: text/plain; charset=windows-1252


On May 15, 2012, at 3:29 PM, Stuart Smith wrote:

I'm trying to follow the instructions here:

http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Xcode

to build an EDK II environment, and I'm having some problems.

The first is that the build script for cctools (which will build mtoc.NEW)
fails because the vers_string tool is not found. This tool was part of the
Xcode 3 distribution, but doesn't appear to be in Xcode 4.3.2 (the current
version). 
I made a soft link to Xcode 3's vers_string at /usr/bin, which got me over
that hurdle.


Sorry this seems to change for every release. I'll try and update the instructions. 

thank you. Incidentally, the instructions mention cctools-809, but the latest available appear to be cctools-800.
The sources for 10.7.4 haven't been posted yet.


The cctools are part of Developer Tools not Mac OS X.


(snip)
What tools are you using? XCLANG => clang in Xcode. For clang this error is suppressed via -Wno-tautological-compare

The compiler flags are in:
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/BaseTools/Conf/tools_def.template
And when you setup your environment the first time BaseTools/Conf/tools_def.template gets copied to Conf/tools_def.txt and that is the one the build will use. 

cc -v tells me  this
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
The version of Xcode is 4.3.2.

and indeed, I see in tools_def.template that -Wno-tautological-compare is set (near line 4600).
So I'm not quite sure how I should proceed here.


I'm running Xcode 4.2.1 and it looks like you are running 4.3?

~>clang -v
Apple clang version 3.0 (tags/Apple/clang-211.12) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix

~>cc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

I've got some vacation in the queue, but I'll fix any Xcode 4.3.2 issues next week and submit patches if there are any issues. 

you said:
For X64 the latest Xcode is the way to go as it supports the EFI ABI via -ccc-host-triple x86_64-pc-win32-macho. So older Xcode just support x86_64 Unix ABI which is not compatible with EFI. 
my version of clang appears to support that flag - at least, it does not object to it when I compile a trivial program with it, although the compilation itself fails.

and to my question:
also, how does one search the mailing list archives?

you replied
http://sourceforge.net/mailarchive/forum.php?forum_name=edk2-devel

which I've found already, thank you. This web page allows me to browse the archives, which is a little laborious - is there some way I can search the mailing list for keywords?


Sorry I  have been subscribed forever, so I just search from Mail on my Mac. 



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel