This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help on building cross compiler for ARC processor


Tsai, James wrote:
Hi,

Has anybody successfully built a cross compiler for ARC processor?

I seemed to stuck at building "stmp-multilib-arc". The Makefile was complaining about "No rule to make target crtinit.o ....", but I found initfini.c in gcc/config/arc directory that can be built into crtinit.o.

The error message says that there is no rule to make the target file 'crtinit.o'. What is the unclear part in this message? BUT the target Makefile-fragment, 'gcc/config/arc/t-arc' has the following rules:

----------------------- clip ------------------------------------------
# .init/.fini section routines

x-crtinit.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
	  -DCRT_INIT -finhibit-size-directive -fno-inline-functions \
	  -g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtinit.o

x-crtfini.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
	  -DCRT_FINI -finhibit-size-directive -fno-inline-functions \
	  -g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtfini.o

MULTILIB_OPTIONS = EB
MULTILIB_DIRNAMES = be

----------------------- clip ------------------------------------------

 Ie. if the 'x-crtinit.o' and 'x-crtfini.o' would be required to be
built, the '$build/gcc/Makefile' could do that...

Suggections?

So there is a plain vanilla bug in the ARC config stuff! If comparing these rules with equivalents for other CPUs needing multilibbed 'crt*.o' stuff, one easily sees that the target rules should be like :

----------- a clip from the fixed gcc/config/arc/t-arc ---------------
# .init/.fini section routines

$(T)crtinit.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
    $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) \
      $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
      -DCRT_INIT -finhibit-size-directive -fno-inline-functions \
      -g0 -c $(srcdir)/config/arc/initfini.c -o $(T)crtinit.o

$(T)crtfini.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
    $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) \
      $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
      -DCRT_FINI -finhibit-size-directive -fno-inline-functions \
      -g0 -c $(srcdir)/config/arc/initfini.c -o $(T)crtfini.o

MULTILIB_OPTIONS  = EB
MULTILIB_DIRNAMES = be

EXTRA_MULTILIB_PARTS = crtinit.o crtfini.o
--------------------------------- clip ---------------------------------

As seen, I have added the possible $(MULTILIB_CFLAGS) options too...

 The GCC-build uses these '$(T)crt*.o' ('T' means 'temporary') file
names when making the multilib versions of the 'crt*.o' targets, and
removes the '$(T)' when moving the files into the multilib subdirs
with their base names (these told in the 'EXTRA_MULTILIB_PARTS = ').
The production will be done in the main $build/gcc, so later 'crt*.o'
would overwrite the default 'crt*.o' stuff if not produced with fake
temporary names first...

Cheers, Kai



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]