|Subject:||Re: [Tinycc-devel] Error: File crti.o/crt1.o Not Found and No Function Renaming|
|Date:||Mon, 16 Sep 2013 10:41:55 -0500|
Le lundi 16 septembre 2013 07:51:49 Cayce Pollard a écrit :
> On Sun, Sep 15, 2013 at 2:03 PM, Thomas Preud'homme
> > >
> > > 1) There are crt* files on my device, but they are not crt1.o or crti.o.
> > What are they?
> Here's the list of crt* files in the sysroot/usr/lib of the android NDK:
> crtbegin_dynamic.o crtbegin_static.o crtend_so.o crtbegin_so.o
> > Anyway, crti.o and crt1.o are hardcoded in tcc so you'd have to change theTake a loot at tcc_set_output_type in libtcc.c. Just add tcc_add_crt call to
> > code to look for files named differently.
link these crt files and then recompile tcc.
Tcc definitely can't define __GNUC__ as this means "compiled by gcc". However,
> > If you could paste the relevant bits (around line 252) of file
> > /usr/include/sys/cdefs.h we could help you more efficiently.
> Sorry about that. Here's the relevant lines in cdefs.h
> 245 #if !defined(_STANDALONE) && !defined(_KERNEL)
> 246 #ifdef __GNUC__
> 247 #define __RENAME(x) ___RENAME(x)
> 248 #else
> 249 #ifdef __lint__
> 250 #define __RENAME(x) __symbolrename(x)
> 251 #else
> 252 #error "No function renaming possible"
> 253 #endif /* __lint__ */
> 254 #endif /* __GNUC__ */
> 255 #else /* _STANDALONE || _KERNEL */
> 256 #define __RENAME(x) no renaming in kernel or standalone
> 257 #endif
as you modify tcc to change the crt files linked in each program, you can add a
tcc_define_symbol and use the asm label machinery to define a ___RENAME
function. Check commit 2596273 for how to do a function rename.
Then, define __GNUC__ before including anything and that might work. It might
also fail because it now compiles lots of gcc-specific constructs because
__GNUC__ is defined. If it fail you're out of luck because you probably can't
change the contents of cdefs.h.
Why is that relevant? Do you need __func__ to be defined and it's not by tcc?
> There's also this bit that may be relevant:
|[Prev in Thread]||Current Thread||[Next in Thread]|