[haiku-development] Re: Trouble building @vmware-image on Mac OS X 10.9 Mavericks

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 29 Oct 2013 13:14:20 -0400

On Tue, Oct 29, 2013 at 4:24 AM, Simon Taylor <simontaylor1@xxxxxxxxxxxx> wrote:
> On 29 Oct 2013, at 01:24, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
>> The makebootable code actually always tries to read the resources and only 
>> when that fails it reads the attribute, regardless of the platform for which 
>> it is compiled. So scratch that. The issue is indeed just that the exception 
>> thrown in ResourceFile::_InitFile() isn't caught in ResourceFile::SetTo() 
>> despite the matching catch statement. Why that is I do not know.
>
> I’ve just switched to Mavericks too and found some slightly odd stuff when 
> compiling things from the command line:
>
> 1) It looks like gcc has been completely removed now. g++ still exists, but 
> appears just to invoke clang. I’ve never tried compiling Haiku from OS X, but 
> I think the clang build works now?
>
> $ g++ --version
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> --with-gxx-include-dir=/usr/include/c++/4.2.1
> Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
> Target: x86_64-apple-darwin13.0.0
> Thread model: posix

Building on OS X has become more difficult as of late. The default
compiler is now clang, even /usr/bin/gcc actually points to clang. If
you want to build Haiku, you'll first need to build gcc yourself,
either from source or using MacPorts or Home Brew. Once you've built
gcc you'll need to replace the cc, gcc, and g++ binaries in /usr/bin
with the ones you've built.

> 2) The default c++ library is now libc++ rather than libstdc++. I was bitten 
> by a weird linking error which turned out to be a difference in the c++ 
> library between the dylib and the code I was trying to link it with. 
> Functions with parameters such as std::vector<int>& wouldn’t link.
>
> I suspect this might also have something to do with exceptions. It took me a 
> while to track this one down as neither library nor executable compilation 
> used the option to select the c++ lib. It turned out in the end the 
> -mmacosx-version-min=10.6 ends up setting it to libstdc++. Setting 
> -stdlib=libstdc++ seemed to have the same effect.

There might be something here, I don't know.

Other related posts: