Add a New Comment (Rich Markup)
Comment Type & Canned Response: None No canned response available
similar problem ?
linux 2.6.35-22-generic tcc version 0.9.25
#include <stdlib.h> #include <stdio.h> #include <string.h> int main(int argc, const char *argv[]) { char *pollo= "ppooo"; printf("%s", pollo); return 0; }
calling tcc -b (mem/ptr bounds checker) fails : tcc: undefined symbol 'memset' tcc: undefined symbol 'memmove' tcc: undefined symbol 'memcpy'
whitout -b, it works fine. why ? Massimo
TCC fails to bootstrap on recent version on Linux for failing to support 'i' relocations (see below) A similar problem arises when trying to use TCC to 'finalize' Eiffel projects (that use a C generating backend)
The bootstrapping issue on x86_64 Linux is due to a GNU extension, the missing linker symbols:
tcc -o tcc tcc.c -DTCC_TARGET_X86_64 -O2 -g -Wall -Wno-pointer-sign -lm -ldl tcc: undefined symbol 'strlen' tcc: undefined symbol 'strchr' tcc: undefined symbol 'strrchr' tcc: undefined symbol 'strcpy' tcc: undefined symbol 'strcmp' tcc: undefined symbol 'memcmp' tcc: undefined symbol 'strncmp'
are 'i' not 'T' symbols in libc.a: <man nm>
"i" For PE format files this indicates that the symbol is in a section specific to the implementation of DLLs. For ELF format files this indicates that the symbol is an indirect function. This is a GNU extension to the standard set of ELF symbol types. It indicates a symbol which if referenced by a relocation does not evaluate to its address, but instead must be invoked at runtime. The runtime execution will then return the value to be used in the relocation. "T" "t" The symbol is in the text (code) section.
nm -A --defined-only /usr/lib/libc.a | grep strcpy
/usr/lib/libc.a:strcpy.o:0000000000000030 T __GI_strcpy /usr/lib/libc.a:strcpy.o:0000000000000030 t __strcpy_sse2 /usr/lib/libc.a:strcpy.o:0000000000000000 t __strcpy_ssse3 /usr/lib/libc.a:strcpy.o:0000000000000000 i strcpy <--- 'i' not 'T', hence not picked up by TCC /usr/lib/libc.a:string-inlines.o:00000000000000c0 T __strcpy_small /usr/lib/libc.a:strcpy_chk.o:0000000000000000 T __strcpy_chk
Fixing this will entail an upgrade of the TCC linker (and possibly a TCC runtime upgrade as well)
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 3 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9