For curiosity's sake, I'm trying to see what's the smallest that I can make a C program with a minimum of assembly language. I want to see if I can make a simple OpenGL demo (i.e. demo scene) using OpenGL and GLUT linked dynamically, without the standard library. However, I'm running into trouble with the most basic stuff.
I've created a test main.c file that contains
void newStart() {
//Do stuff here...
asm("movl $1, %eax;"
"xorl %ebx, %ebx;"
"int $0x80;");
}
and I'm making it with
gcc main.c -nostdlib -e newStart -o min
using the '-e' option as recommended by this StackOverflow question. I get the following error when I try to compile it:
ld: warning: symbol dyld_stub_binder not found, normally in libSystem.dylib
ld: entry point (newStart) undefined. for architecture x86_64
I'm running OS X 10.7 (Lion). Can anyone help me out?