tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Problem DLL and __stdcall


From: grischka
Subject: Re: [Tinycc-devel] Problem DLL and __stdcall
Date: Mon, 22 Nov 2010 19:23:58 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Michel Claveau wrote:
"bad compile" means what?

When I use  __stdcall, externals softwares do not found any function.
No problem with 0.9.23, or is I delete __stdcall (but I must change the calls...)

I see.

Indeed "address@hidden" (leading underscore + call parameter size) is
only SOMEHOW standard.  It is what MSVC tools generate.

GCC/Mingw wants to be compatible but generates "address@hidden" which
causes headaches to people elsewhere.  Other compilers may
generate undecorated symbols (as did tcc-0.9.23).  Also,
MS-Windows uses undecorated symbols in the win32 API.

I don't know what tools were used to compile the software that
you want to link with.

Anyway, if you want undecorated stdcall symbols with tcc, you
need to hack the source code.

This is in 2 locations:
1) in libtcc.c:put_extern_sym2(), disable this if-block:
  if (FUNC_CALL(attr) == FUNC_STDCALL && can_add_underscore) {
    ...
  }
2) above tccpe.c:pe_add_runtime, enable
  #define PE_STDSYM(n,s) n
also for non-X86_64 target

Sorry, but I am not able to compile (I do not know) TCC from source.

Maybe you will sometimes.  Instructions are in win32/tcc-win32.txt.

--- grischka




reply via email to

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