Victor, A couple of things: 1. you probably need "export FLTFLAGS" in microblaze.mk2. it looks like you are using a custom link script. This is likely to cause pain.
3. explicitly invoking the compiler and linker in separate phases will cause pain.
The pain associated with (3) is why we've gone to the effort of creating a standalone toolchain, and why snapgear created the ucfront tool.
If you really have to do this, then you'll need to look carefully at the output of a command line
microblaze-uclinux-gcc --save-temps -v -o foo foo.cand split it into the indiviual commands that are invoked by the gcc frontend. In particular, have a look at the link phase (actually it will invoke a binary called "collect2", but it's the same as ld)
There are many, many flags that get passed in addition to -elf2flt. You'll need to munge these into your Makefile infrstructure.
My advice is to refactor your makefile so that it looks more like the ones created by petalinux-new-app, or those in petalinux-dist/user/*/Makefile
At the very least, you want something resembling this stuff at the top (to get sensible CFLAGS and LDFLAGS):
# Point to default PetaLinux root directory ifndef ROOTDIR ROOTDIR=$(PETALINUX)/software/petalinux-dist endif PATH := $(PATH):$(ROOTDIR)/tools UCLINUX_BUILD_USER = 1 -include $(ROOTDIR)/.config -include $(ROOTDIR)/$(CONFIG_LINUXDIR)/.config LIBCDIR = $(CONFIG_LIBCDIR) -include $(ROOTDIR)/config.arch ROMFSDIR=$(ROOTDIR)/romfs ROMFSINST=$(ROOTDIR)/tools/romfs-inst.sh regards, John victor-sv_yeo@xxxxxxxxxxx wrote:
John, The makefiles are pretty complicated. I will attach them here, though I doubt anyone will have the patience to go through them. Summary of the makefiles: 1) Makefile make use of FLTFLAGS in the linking stage, and basically it says how to link the object files. You might want to search for "echo Linking" to go directly to the linking part. 2) FLTFLAGS+=-v is defined in microblaze.mk 3) In rules.mk, it says how to compile the object files. Am I missing something in the makefile, such as invoking mb-elf2flt? There is a tutorial on binary flat format: http://www.beyondlogic.org/uClinux/bflt.htm Anyone knows what the criterion is for the code to go into either .text segment or relocations segment? Thanks Victor -----Original Message----- From: owner-microblaze-uclinux@xxxxxxxxxxxxxx [mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of John Williams Sent: Wednesday, June 27, 2007 6:29 PM To: microblaze-uclinux@xxxxxxxxxxxxxx Subject: Re: [microblaze-uclinux] uclinux memory exhausted, unable to allocate RAM Hi Victor,Yeah, I added FLTFLAGS+=-v to my makefile. However, my makefile is not using the FLTFLAGS anywhere. I am not calling mb-elf2flt anywhere too.In fact, I am not sure where to add the FLTFLAGS thingy.Can you please post the app Makefile? John ___________________________ microblaze-uclinux mailing list microblaze-uclinux@xxxxxxxxxxxxxx Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
___________________________ microblaze-uclinux mailing list microblaze-uclinux@xxxxxxxxxxxxxx Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/