[Top][All Lists]

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

[Tinycc-devel] [PATCH] Add __REDIRECT needed for Large File Support API

From: Ramsay Jones
Subject: [Tinycc-devel] [PATCH] Add __REDIRECT needed for Large File Support API on linux
Date: Wed, 29 Feb 2012 19:16:16 +0000
User-agent: Thunderbird (Windows/20060308)

Since commit 9b09fc3 ("Add support of asm label for functions",
05-09-2010) tcc has had the capability to rename functions at the
assembly level. This capability was subsequently used by commit
2596273 ("Add support for __REDIRECT_NTH needed with eglibc",
11-09-2010) to redirect long double functions on platforms which
did not support long double.

Here we add the companion macro __REDIRECT which is used (along
with __REDIRECT_NTH) in the glibc headers on Linux to support the
Large File API (when _FILE_OFFSET_BITS is set to 64).

Signed-off-by: Ramsay Jones <address@hidden>


This patch allows me to use tcc to compile git without warnings.
Without this patch, each use of readdir() or getrlimit() elicits
an "assignment from incompatible pointer type" warning.

[BTW, tcc builds git about 6x faster than gcc. The testsuite runs
about 6% slower.]

Ramsay Jones

 libtcc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libtcc.c b/libtcc.c
index 159e23b..5e497c9 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -980,6 +980,7 @@ LIBTCCAPI TCCState *tcc_new(void)
     /* glibc defines */
+    tcc_define_symbol(s, "__REDIRECT(name, proto, alias)", "name proto __asm__ 
     tcc_define_symbol(s, "__REDIRECT_NTH(name, proto, alias)", "name proto 
__asm__ (#alias) __THROW");
 #ifndef TCC_TARGET_PE

reply via email to

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