Find the answer to your Linux question:
Results 1 to 3 of 3
Hi I have a cross-compiler toolchain for Arm processor. The toolchain folder hierarchy looks like this: 4.2.2.-eabi -- bin -- sbin -- usr [arm-unknown-linux-gnueabi, bin, lib, libexec, include, etc.] -- ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5

    CrossCompiler Setup Question

    Hi
    I have a cross-compiler toolchain for Arm processor. The toolchain
    folder hierarchy looks like this:

    4.2.2.-eabi
    -- bin
    -- sbin
    -- usr [arm-unknown-linux-gnueabi, bin, lib, libexec, include, etc.]
    -- sbin
    -- lib
    etc.

    i am able to compile my code for the hardware by giving relateive paths of the cross-compiler in the 4.2.2.-eabi/usr/arm-unknow-linux-g nueabi/bin . Compilation works fine.

    but when i link, it searches for libc.so.6 library in the Host Computer [UBUNTU] /usr/lib folder instead of 4.2.2.-eabi/usr/lib . It gives me an error "incompatible library" and crashes. how can i sort this link error ?? how can i make sure that the library is searched in the toolchain folder and not the /usr/lib.

    i do not have the packages for ARM process to build a native CROSS-Compiler Environment. How can I circumvent this issue.

    Any advice will be helpful.

    thanks
    satishku

  2. #2
    Just Joined! djap's Avatar
    Join Date
    Jul 2005
    Location
    Not so sure anymore...
    Posts
    97
    Posting a makefile I use for a litle similar situation you can use it as a base and modify if you like

    Code:
    CROSS_COMPILE = /opt/devkitPro/devkitGP2X/bin/arm-linux-
    SDL_BASE = /opt/devkitPro/devkitGP2X
    LDFLAGS = -static
    
    CXX = $(CROSS_COMPILE)g++
    STRIP = $(CROSS_COMPILE)strip
    #-lSDL_ttf -lexpat 
    CXXFLAGS = -I$(SDL_BASE)/include  -I$(SDL_BASE)/include/SDL -I../header -DTARGET_GP2X -O2 -Wall
    LIBS = -L"$(SDL_BASE)/lib" -lSDL -lSDL_gfx --start-group  -lfreetype -lSDL --end-group -lSDL_image -ljpeg -lpng12 -lz --start-group -lSDL_mixer -lvorbisidec -lmikmod -lsmpeg -lmad -lSDL --end-group -lgcc -lm -lc -lpthread -ldl
    
    TARGET = ../fergu.gpe
    OBJS = main.o GraphicsEngine.o GraphicActor.o MessageQueue.o PThreadClass.o Traktori.o Puunlehti.o Pilvi.o Pakokaasu.o AudioEngine.o SoundActor.o Cake.o
    
    ALL_TARGETS = $(TARGET)
    
    all: $(ALL_TARGETS)
    
    $(TARGET): $(OBJS)
    		$(CXX) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
    		$(STRIP) $(TARGET)
    
    clean:
    		rm *.o
    		rm $(TARGET)
    The key word is -L"$(SDL_BASE)/lib", which in this case directs my compiler to look for the libraries in /opt/devkitPro/devkitGP2X/lib.

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5
    Thanks a lot. I solved the problem. All I needed to do is to copy the Toolchain to /usr/local/Arm directory [ icreated the Arm directory on my system]. After that, the problem dissapeared.

Posting Permissions

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