|
From: KJK::Hyperion <no...@li...> - 2002-05-18 22:23:18
|
At 23.02 18/05/2002, you wrote: > > > > testfork.o(.text+0x43):testfork.c: undefined reference to `__main' > > > > make: *** [testfork.nostrip.exe] Error 1 > > >well, you need your custom __main function then. > > erm... why exactly? I checked, and it's the damn *compiler* that inserts a > > "call ___main" just after the stack frame setup in main(): >Try examining the way drivers on ReactOS are built. They have no main >symbol. smss.exe is a native application and has no gcc runtime library >linked with it. It's entry point is NtProcessStartup. That's not the problem. crthybrid.c, in my case, implements the entry point (__PdxLdrEntry, with the same signature as NtProcessStartup), then calls exit() with the return value of main() as parameter, because it's, as the name suggests, a static CRT for Win32-POSIX+ hybrids, that converts/imports the Win32 environment, invocation, standard file descriptors, current directory, etc. and then calls main() The idea is to have something clean and self-contained, and containing exactly what the code says, no more no less, because it's easier to debug The problem is that the C frontend of GCC *always* inserts a call to _main() at the beginning of all functions called main(), without me asking for, or even *wanting* it. I'll just insert a dummy _main() in crthybrid.c until it's fixed, but I *really* hate this |