fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
39 stars 6 forks source link

Trouble mixing .s .c files #46

Closed fuhsnn closed 9 months ago

fuhsnn commented 9 months ago

asmfn.s

.text
.globl asmfn
asmfn:
  movl $-123, %eax
  ret
.section .note.GNU-stack,"",@progbits

main.c

#include <stdio.h>
extern int asmfn(void);
int main() {
  printf("%d\n", asmfn());
}

run chibicc asmfn.s main.c got undefined reference to asmfn