gnu /
gcc.git /
b13c0682ab290166a4a4c25513fec96beab5e211 lto: Bypass assembler when generating LTO object files.
This patch applies Jan Hubicka previous patch on current sources.
Now compiler is able to produce object files without assembler although
a lot of things are missing such as __lto_slim symbol, debug symbols
etc. They will be added in future patches. To test this current patch,
use these command below.
1) ./xgcc -B ./ -O3 a.c -flto -S -fbypass-asm=crtbegin.o -o a.o
2) ./xgcc -B ./ -O2 a.o -flto
3) ./a.out
We are currntly working with elf-only support (mach-o, coff, xcoff etc
will be dealt later) so this will only work on a linux machine. I have tested
this on my machine ( Arch linux, Machine: Advanced Micro Devices X86-64) and
all LTO test cases passed as expected.
gcc/ChangeLog:
* Makefile.in:
* common.opt:
* langhooks.cc (lhd_begin_section):
(lhd_append_data):
(lhd_end_section):
* lto/lto-object.cc: Moved to...
* lto-object.cc: ...here.
* lto-streamer.h (struct lto_section_slot):
(struct lto_section_list):
(struct lto_file):
(lto_obj_file_open):
(lto_obj_file_close):
(lto_obj_build_section_table):
(lto_obj_create_section_hash_table):
(lto_obj_begin_section):
(lto_obj_append_data):
(lto_obj_end_section):
(lto_set_current_out_file):
(lto_get_current_out_file):
* toplev.cc (compile_file):
(lang_dependent_init):
gcc/lto/ChangeLog:
* Make-lang.in:
* lto-common.cc (lto_file_read):
* lto-lang.cc:
* lto.h (struct lto_file):
(lto_obj_file_open):
(lto_obj_file_close):
(struct lto_section_list):
(lto_obj_build_section_table):
(lto_obj_create_section_hash_table):
(lto_obj_begin_section):
(lto_obj_append_data):
(lto_obj_end_section):
(lto_set_current_out_file):
(lto_get_current_out_file):
(struct lto_section_slot):
Signed-off-by: Rishi Raj <rishiraj45035@gmail.com>
10 files changed