This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to add new library into GCC source
- From: Ian Lance Taylor <iant at google dot com>
- To: Le Ton Chanh <letonchanh at yahoo dot com>
- Cc: GCC Help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 02 Dec 2008 07:32:53 -0800
- Subject: Re: How to add new library into GCC source
- References: <197037.31414.qm@web38105.mail.mud.yahoo.com>
Le Ton Chanh <letonchanh@yahoo.com> writes:
> I added a new C library (*.h file) into GCC source in directory
> $(GCC_ROOT)/gcc and it is used in haifa-sched.c and final.c. But
> when I built GCC, it warmed "undefined reference to ...". How can I
> fix this?
Impossible to say with the amount of information you provided. Is
there a new .c file? Did you add the corresponding .o file to
OBJS-common in gcc/Makefile.in, or whereever it should go?
> The second question, I want to add 'nop' instruction after an
> instruction in assembly source file generated by cc1 when the
> schedule queued for 1 cycles for the insn respectively. Does GCC
> support that?
Sure, but it's not trivial to implement. The MIPS backend does stuff
like that when compiling for the MIPS 1 ISA. It's done in the machine
reorg pass. The code is in config/mips/mips.c, in
mips_reorg_process_insns.
> I am using GCC 3.3.4. Thanks in advance.
That is quite old by now.
Ian