|
Well, this doesn't work on my system. I'm using
petalinux-v0.40-rc3.tar.gz as obtained from svn. I removed libstdc++.a from $(ROOTDIR)/lib as recommended, then generated a new ulocate project, using petalinux-new-app. I copied my ulocate.cpp file to the project directory, then made the changes recommended below to my makefile (which will be attached here as ulocate.mak, though it was just Makefile when I ran it). The result I get, as previously, is: #******************************************** root@damien:/home/petalinux-v0.40-rc3/software/user-apps/ulocate# make mb-linux-g++ -Os -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -mno-xl-soft-div -mxl-barrel-shift -mcpu=v7.20.a -mxl-multiply-high -mno-xl-soft-mul -mhard-float -DEMBED -I/home/petalinux-v0.40-rc3/software/petalinux-dist -I/home/petalinux-v0.40-rc3/software/petalinux-dist/include -I/home/petalinux-v0.40-rc3/software/petalinux-dist/include -Dlinux -D__linux__ -Dunix -DLINUX -c -o ulocate.o ulocate.cpp mb-linux-g++ -o ulocate ulocate.o -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic /home/petalinux-v0.40-rc3/tools/linux-i386/microblaze-glibc-root/bin/../lib/gcc/microblaze-linux-elf/4.1.1/../../../../microblaze-linux-elf/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status make: *** [ulocate] Error 1 #******************************************** BTW, Notice that CXX_LDFLAGS appears to not exist on my platform; I suspect this is the fundamental problem that I have, do you agree?? So, where is that macro supposed to come from? Dan Miller BTW, I tried manually creating CXX_LDFLAGS in my makefile, and pointing it to /home/petalinux-v0.40-rc3/tools/linux-i386/microblaze-uclinux-tools/microblaze-uclinux/lib/ However, *this* fails because of the libstdc++.la file in that directory, which references several *very* non-existent directories. John Williams wrote: Hi again, |
ifndef PETALINUX
$(error You must source the petalinux/settings.sh script before working with PetaLinux)
endif
# 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
APP = ulocate
# Add any other object files to this list below
APP_OBJS = ulocate.o
all: $(APP)
# $(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS)
$(APP): $(APP_OBJS)
$(CXX) $(CXX_LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS) $(CXXLIBS)
clean:
-rm -f $(APP) *.elf *.gdb *.o
.PHONY: romfs image
romfs:
$(ROMFSINST) $(APP) /bin/$(APP)
image: romfs
make -C ${PETALINUX}/software/petalinux-dist image
%.o: %.cxx
$(CXX) -c $(CXXFLAGS) -o $@ $<
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
# Targets for the required .config files - if they don't exist, the tree isn't
# configured. Tell the user this, how to fix it, and exit.
${ROOTDIR}/config.arch ${ROOTDIR}/.config:
@echo "Error: You must configure the PetaLinux tree before compiling your application"
@echo ""
@echo "Change directory to ../../petalinux-dist and 'make menuconfig' or 'make xconfig'"
@echo ""
@echo "Once the tree is configured, return to this directory, and re-run make."
@echo ""
@exit -1