The new gcc12 release does not support stabs any more.
This was a good reason to add support for dwarf.
The stabs code still works and is used if configure option --dwarf
is not used.
Tested on x86_64, i386, arm, arm64, riscv64 with dwarf-5.
Some debuggers may not support dwarf-5. Try using older dwarf versions
i that case.
The tccmacho.c code probably need some support for dwarf.
arm-gen.c, arm64-gen.c, i386-gen.c, riscv64-gen.c, x86_64-gen.
- fix get_sym_ref symbol size
arm-link.c, arm64-link.c, i386-link.c, riscv64-link.c, x86_64-link.c
- add R_DATA_32U
libtcc.c:
- parse -gdwarf option
tcc.c:
- add dwarf option
tcc.h:
- add dwarf option and sections
tccelf.c:
- init dwarf sections
- avoid adding sh_addr for dwarf sections
- remove dwarf relocs for output dll
- add dwarf sections for tccrun
tccgen.c:
- add dwarf defines + global data
- add dwarf_* functions
- mix dwarf code with stabs code
- a trick is used to emit function name in .debug_line section so
only this section has to be parsed instead of .debug_info and
.debug_abbrev.
- fix init debug_modes
tccrun.c:
- add dwarf sections in rt_context
- init them in tcc_run
- add new dwarf code rt_printline_dwarf to find file/function
dwarf.h:
- New file
tcc-doc.texi:
- document dwarf
configure:
- add dwarf option
lib/Makefile
- change -gstabs into -gdwarf
lib/bt-exe.c, tests/tests2/Makefile, tests/tests2/126_bound_global:
- Add __bound_init call
- Add new testcase to test it
The code needs to be fixed: use the functions or remove them.
arm-asm.c:
asm_parse_vfp_regvar()
arm64-link:
gotplt_entry_type()
create_plt_entry()
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Warnings reported in in x86_64-gen.c and arm-gen.c:
warning: ‘align’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Target buffer must be larger as the format string + the replacement for %s
to avoid a warning [-Wformat-truncation=]
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Using the environment CC is a common used feature to
select a compiler to build any software,
so it should be supported when building tcc.
The old way using the parameter --cc still works.
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Some headers and source code change macros and
implementation, when __OPTIMIZE_SIZE__ is defined.
This does not change our generated code.
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
With this code, we can compile more projects,
who expect gcc or clang as compiler. (-std=gnu11 used in Makefiles)
As a further extension, it would be easy to disable gcc extensions
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
There is no code generation in post_type for vla arrays. This code
generation has to be delayed until gen_function.
- post_type save code in type info.
- gen_function use this code to generate vla code.
- enable testcode for vla arrays.
Modify function parameter parser such that symbols are
put into token-table temporarily. Benefits are:
- detects redefinitions, as with
int foo(int a, int a);
- detects reserved symbols, as with
int foo(int if);
- can parse expressions like
int main(int argc, char *argv[argc + 1]);
- doesn't fix this one
int main(int argc, char *argv[++argc]);
Also: fix unexpected "function might return no value"
with statement expression
int f() { ({ return 0; }); }