tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] win32: -Wl,-nostdlib: undefined symbol 'memset'


From: avih
Subject: [Tinycc-devel] win32: -Wl,-nostdlib: undefined symbol 'memset'
Date: Sat, 9 Sep 2023 16:19:27 +0000 (UTC)

The following is test.c:

#include <windows.h>

void _start(void) {
    char buf[16] = {0};
    ExitProcess(42);
}


Try to compile it using:
tcc -Wl,-nostdlib test.c -lkernel32

Result:
tcc: error: undefined symbol 'memset'

Which I'm guessing is tcc trying to zero buf on startup using memset,
but failing to link the startup code.

It's possible to define memset at test.c and then it compiles and runs,
but I believe this should not be required.

Additionally, I don't know whether the name "_startup" and its prototype
are standardized, but if not, maybe it's worth either adding an option to
set the startup function name, or document the name _startup and its
prototype at the option help?

- avih


reply via email to

[Prev in Thread] Current Thread [Next in Thread]