tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] OSX


From: Peter \"Firefly\" Lund
Subject: Re: [Tinycc-devel] OSX
Date: Mon, 21 Apr 2003 08:26:27 +0200 (MEST)

On Sun, 20 Apr 2003, Steve Dekorte wrote:

> On Sunday, April 20, 2003, at 03:02 PM, Steve Dekorte wrote:
> > Looks like OSX gcc chokes on this stuff:
> >
> >     case 'a' ... 'z':
> >     case 'A' ... 'Z':
>
> So I commented that out and added:
>
>          if (strchr("abcdefghijklmnopqrstuvwxyz", ch)) break;
>          if (strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", ch)) break;

if (((ch >= 'a') && (ch <= 'z')) ||
     (ch >= 'A') && (ch <= 'Z'))) ...

would probably be better.

> to the default case. And changed the makefile:
>
> ifeq ($(ARCH),"i386")
>
> CFLAGS+=-mpreferred-stack-boundary=2
> ifeq ($(GCC_MAJOR),2)
> CFLAGS+=-m386 -malign-functions=0
> else
> CFLAGS+=-march=i386 -falign-functions=0
> endif
>
> endif

Do you know diff -u -p ?

> % make
> gcc -O2 -g -Wall -o tcc_g tcc.c -ldl
> tccelf.c: In function `resolve_sym':
> tccelf.c:381: `RTLD_DEFAULT' undeclared (first use in this function)
> tccelf.c:381: (Each undeclared identifier is reported only once
> tccelf.c:381: for each function it appears in.)
> tcc.c: In function `rt_get_caller_pc':

rt_get_caller_pc can be stubbed out for the moment.

> tcc.c:8855: request for member `gregs' in something not a structure or
> union
> tcc.c:8855: `EIP' undeclared (first use in this function)
> tcc.c:8862: request for member `gregs' in something not a structure or
> union
> tcc.c:8862: `EBP' undeclared (first use in this function)
> tcc.c: In function `sig_error':
> tcc.c:8910: `FPE_INTDIV' undeclared (first use in this function)
> make: *** [tcc_g] Error 1
>
> How is tccelf.c is supposed to find `RTLD_DEFAULT' if it's defined in
> tcc?

1) tccelf.c is included into tcc.c.   tcc currently underuses linking, to
put it mildly.

2) RTLD_DEFAULT normally comes from dlfcn.h.  It is only defined in tcc.c
if CONFIG_TCC_STATIC is defined.

3) You have run into a snag in some of the BSD unices, including OS X,
which tries to behave as FreeBSD.  It has a very crippled dynamic loader.

-Peter




reply via email to

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