mirror of
https://github.com/mirror/tinycc.git
synced 2026-09-05 12:14:52 +08:00
macos: Fix asm-c-connect-test
via some heavy-handed hackery in the ASM symbol handling in case C symbols get a leading underscore (but ASM symbols do not). But this is now like clang and GCC on Darwin work: asm symbols are undecorated, C symbols get a _ prepended, so to connect both some trickery is involved for the ASM symbols that don't have a _ prepended. They must be included in the C symbol table (because that's what we use to lookup also ASM labels), but they also must not disturb the normal C symbol (which don't have the _ prepended), so they need some mangling. A bit unsatisfying, but well. So, add asm-c-connect-test to the working ones for Darwin as well.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
#ifdef __APPLE__
|
||||
#define _ "_"
|
||||
#else
|
||||
#define _
|
||||
#endif
|
||||
extern int printf (const char *, ...);
|
||||
extern void vide(void);
|
||||
__asm__("vide: ret");
|
||||
__asm__(_"vide: ret");
|
||||
|
||||
int main() {
|
||||
vide();
|
||||
|
||||
Reference in New Issue
Block a user