assembly - Why does my symbol not have external linkage? -
i'm trying build coro.c
using clang+lto (it works fine without lto).
when link final binary, following error:
global external, doesn't have external or weak linkage! void ()* @coro_transfer
the symbol defined in coro.h
as:
#if __i386__ || __x86_64__ extern void __attribute__ ((__noinline__, __regparm__(2))) #else extern void __attribute__ ((__noinline__)) #endif coro_transfer (coro_context *prev, coro_context *next);
and in coro.c
as:
asm ( "\t.text\n" #if _win32 || __cygwin__ || __mach__ "\t.globl _coro_transfer\n" "_coro_transfer:\n" #else "\t.globl coro_transfer\n" "coro_transfer:\n" #endif
it seems me have (or should) have global linkage. bug lto, or there wrong assembly definition?
i checked nm , noticed symbol first undefined , defined. guess that's because of declaration in header it's not technically c function in implementation.
coro.c.o: u abort 00000000 t coro_create 00000000 t coro_stack_alloc 00000000 t coro_stack_free u coro_transfer 00000000 t coro_transfer u mmap u mprotect u munmap u sysconf
could causing problem?
Comments
Post a Comment