Hello!
Build without optimization is broken again in CVS:
gcc -o wine -Wl,--section-start,.interp=0x3c000100 main.o -L../dlls -lntdll.dll -L../libs/wine -lwine -L../libs/unicode -lwine_unicode -L../libs/port -lwine_port ../dlls/libntdll.dll.so: undefined reference to `SetLastError' ../dlls/libntdll.dll.so: undefined reference to `GetCurrentProcessId' ../dlls/libntdll.dll.so: undefined reference to `GetCurrentThreadId'
GetCurrentProcessId() and GetCurrentThreadId() are referenced by dlls/ntdll/virtual.c and dlls/ntdll/server.c respectively because they don't include ntdll_misc.h header that has replacement includes.
SetLastError() is used by the set_status() wrapper in dlls/ntdll/heap.c. I believe NtCurrentTeb()->last_error is valid even for gcc x86 builds. At least it's used unconditionally in LdrInitializeThunk(), file dlls/ntdll/loader.c.
ChangeLog: * dlls/ntdll/server.c, dlls/ntdll/virtual.c: Include ntdll_misc.h to suppress wrong dependencies when building Wine without optimization. * dlls/ntdll/heap.c: Define set_error unconditionally to eliminate dependency on SetLastError().