Hi Martin,
> On 16 Sep 2021, at 11:00, Martin Liška <mli...@suse.cz> wrote: > > As preparation for a new global object that will encapsulate > asm_out_file, we would need to live with a macro that will > define asm_out_file as casm->out_file and thus the name > can't be used in function arguments. So, if I understand correctly, the motivation is to be able to switch between output file streams for different categories of content? Darwin, actually already does this (manually) with a separate lto_asm_out_name for lto data (so a general solution would be great). What is the reason for associating the section pointers with the casm object? * I can understand that each instance of a casm object would have potentially a different current section (“in_section”), but it seems that as things stand the section pointers would be duplicates. * In the case that there’s reason that the sections could be different between casm instances, then would it make sense to have a target hook so that target-specific sections can be added to the local list (via some indirection, I’d assume)? — (of course, it would be great if one day we could abstract the asm out such that we could switch to a direct-to-object implementation) > I've built all cross compilers with the change and > can bootstrap on x86_64-linux-gnu and survives regression tests. A native bootstrap fails early in stage1 for x86_64-darwin (I’ll take a look at fixing the issues once the patch series settles down) --- /src-local/gcc-master/gcc/dwarf2asm.c: In function ‘void dw2_asm_output_nstring(const char*, size_t, const char*, ...)’: /src-local/gcc-master/gcc/output.h:387:26: error: expected initializer before ‘->’ token #define asm_out_file casm->out_file ^ /src-local/gcc-master/gcc/defaults.h:68:13: note: in expansion of macro ‘asm_out_file’ FILE *asm_out_file = _hide_asm_out_file; \ ^~~~~~~~~~~~ /src-local/gcc-master/gcc/dwarf2asm.c:414:7: note: in expansion of macro ‘ASM_OUTPUT_ASCII’ ASM_OUTPUT_ASCII (asm_out_file, str, len); ^~~~~~~~~~~~~~~~ In file included from ./tm.h:42:0, ------ /src-local/gcc-master/gcc/config/i386/darwin.h:219:6: error: ‘in_section’ was not declared in this scope if (in_section == text_section) \ ^ /src-local/gcc-master/gcc/dwarf2out.c:677:3: note: in expansion of macro ‘ASM_OUTPUT_ALIGN’ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));