Find the answer to your Linux question:
Results 1 to 3 of 3
Hi guys, Small problem, I am doing some cross compiling and I am getting a build error that is making little sense to me, the error states that the file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    25

    Cross compiling and an error that doesn't make any sense to me


    Hi guys,

    Small problem, I am doing some cross compiling and I am getting a build error that is making little sense to me, the error states that the file libpng.so.3 cannot be found, but it is there, in /usr/lib. I'm not really sure what to do to clear the build error, error mentions something about -rpath again not quite sure what to with this.

    Code:
    Compiling /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/src/demo.c
    Compiling /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/src/ifxui_integration.c
    Compiling /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/packages/engineTemplate/rom/eft-1.0.0_FileTable.c
    Compiling /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/../inflexionui/framework/src/framework_linux_generic.c
    arm-cortexa8-linux-gnueabi-g++ -fno-exceptions -fno-rtti -DLINUX -O3 -I/home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/.. -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=soft -o /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/bin/vm_demo obj/demo.o obj/ifxui_integration.o obj/eft-1.0.0_FileTable.o obj/framework_linux_generic.o -L/home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/../inflexionui/libs/armeabi/iMX5x/no_gpu -L/home/wayne/factory-20110718/build_armv7l-timesys-linux-gnueabi/rfs/usr/lib -lfreetype -lz -lpng -linflexionui -L/home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/../inflexionui/libs/armeabi/iMX5x/no_gpu -Xlinker -rpath -Xlinker --allow-shlib-undefined -Xlinker --gc-sections
    /usr/local/arm/cross-gcc-4.4.1-armv7a-soft/i686-pc-linux-gnu/lib/gcc/arm-cortexa8-linux-gnueabi/4.4.1/../../../../arm-cortexa8-linux-gnueabi/bin/ld: warning: libpng.so.3, needed by /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/../inflexionui/libs/armeabi/iMX5x/no_gpu/libinflexionui.so, not found (try using -rpath or -rpath-link)
    /home/wayne/inflexion/InflexionUI-Runtime-2.3/Linux/eftDemo/../inflexionui/libs/armeabi/iMX5x/no_gpu/libinflexionui.so: undefined reference to `__longjmp_chk@GLIBC_2.11'
    collect2: ld returned 1 exit status
    make: *** [all] Error 1
    Oh yeah and here is the makefile

    Code:
    # The location of libinflexionui.so.
    LIB_DIR = $(BUILDDIR)/inflexionui/libs/armeabi/iMX5x/no_gpu
    
    # Specify the cross compiler to use
    CROSS_TOOLCHAIN := arm-cortexa8-linux-gnueabi-
    
    APP = vm_demo
    BUILDDIR=$(CURDIR)/..
    APP_DIR = $(CURDIR)
    EXE = $(APP_DIR)/bin/$(APP)
    OBJDIR = obj
    
    OBJS = $(OBJDIR)/demo.o \
           $(OBJDIR)/ifxui_integration.o
                 
    OBJS += $(OBJDIR)/eft-1.0.0_FileTable.o
    
    # Set the framework source depending on the platform being used.
    OBJS += $(OBJDIR)/framework_linux_generic.o
    
    # Compiler options
    CFLAGS += -DLINUX
    CFLAGS += -O3
    CFLAGS += -I$(BUILDDIR)
    
    CXXFLAGS += -fno-exceptions -fno-rtti
    CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -mfloat-abi=soft
    
    # Linker options
    LDFLAGS += -L$(LIB_DIR)
    LDFLAGS += -L$(LTIB_ROOTFS)/usr/lib
    LDFLAGS += -lfreetype -lz -lpng
    LDFLAGS += -linflexionui -L$(LIB_DIR)
    LDFLAGS += -Xlinker -rpath
    LDFLAGS += -Xlinker --allow-shlib-undefined
    LDFLAGS += -Xlinker --gc-sections
    
    default: all
    
    ifndef LTIB_ROOTFS
        $(error "LTIB_ROOTFS is not defined")
    endif
    
    .PHONY: ltib_check
    ltib_check: $(LTIB_ROOTFS)/usr/lib
    	@echo "Using the following as the LTIB rootfs (location of iMX5 target libraries):"
    	@echo $(LTIB_ROOTFS)
    	@echo ""
    	
    
    all: ltib_check $(OBJS)
    	$(CROSS_TOOLCHAIN)g++ $(CXXFLAGS) $(CFLAGS) -o $(EXE) $(OBJS) $(LDFLAGS)
    	@echo ""
    	@echo "*************************************************"
    	@echo "* Successfully created $(notdir $(EXE))"
    	@echo "*************************************************"
    	@echo ""
    
    # Steps to compile source files
    $(OBJDIR)/%.o: ./%.c
    	@mkdir -p $(@D)
    	@echo Compiling $^
    	@$(CROSS_TOOLCHAIN)gcc -c $(CFLAGS) $^ -o $@
    
    clean:
    	@$(RM) -Rf $(OBJDIR)
    	@$(RM) $(EXE)
    
    install:
    	#$(INSTALL) -s $(EXE) -D $(DESTDIR)/$(bindir)/$(APP)
    	$(CROSS_TOOLCHAIN)strip -s $(EXE)
    
    # Specify the directories in which the source files 
    # are looked for when building.
    vpath %.c $(APP_DIR)/src
    vpath %.c $(APP_DIR)/packages/engineTemplate/rom
    vpath %.c $(BUILDDIR)/inflexionui/framework/src

    Ta very much

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,599
    What is your Linux distribution+version, and are you running 64-bit or 32-bit operating system?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Location
    Fairfax, Virginia, USA
    Posts
    94
    Hello,
    I think I see your problem. I am betting that the existing libpng.so in /usr/lib is for an x86 and not an arm. You can probably use the file command to tell which one it is compiled for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •