tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] TCC on OS X


From: Aaron Gough
Subject: Re: [Tinycc-devel] TCC on OS X
Date: Wed, 15 Sep 2010 15:24:57 -0400

Hey Thomas!
Thanks for the patch! There were a couple of things that were still breaking the build once the patch was applied, but I was able to fix them.

TCC now builds on OS X 10.5. Unfortunately the build segfaults (as does 'make test'). Building it with -O0 and running through GDB gives the following output:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x00000000
0x8fe18c02 in __dyld_misaligned_stack_error ()

Hopefully this is something trivial, but I can't proceed any further as I've really reached the limits of my very minimal experience with C.

I have attached a patch for the changes that I used to get everything to this point. Everything was done against a checkout of release_0_9_25 that I got from the main repo. 

The biggest problem that I was unable to fix is that the malloc hooks in bcheck.c have to work quite differently on OS X. I started porting that section of code, but I was unable to get it to work. To get the build to complete I added another conditional that means 'install_malloc_hooks()' and 'restore_malloc_hooks()' do nothing on OS X. Hopefully you'll be able to correct these, I added some comments with links to the resources that I found regarding malloc hooks on OS X.

The uname specs for my system (OS X 10.5) are:
$ uname -m
i386

$ uname -s
Darwin

$ uname -a
Darwin aaron-goughs-macbook.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

OS X 10.6 is a slightly different story. From what I understand 10.5 is 32 bit only. 10.6 is both 32 & 64 bit compatible. OS X uses a system called 'universal binaries' to allow both 32 and 64 bit versions of an executable to be stored in the same file, as well as versions built for the older PPC cpus.

I'm really not able to offer any further information on how the config issue should be tackled for 10.6, though I was able to get a build working on 10.6 with the following settings:

config.mak:
CFLAGS=-O2 -m32
ARCH=x86-64

config.h:
#define HOST_X86_64 1

The only things I changed was forcing the architecture to x86-64 instead of i386 and forcing a 32bit build with -m32...

Hope this helps somewhat! Please let me know if there's anything else I can do!

-A

---
Aaron Gough
Web Developer

+1-647-746-7083
www.thingsaaronmade.com

Attachment: os_x_build_patch.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]