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.]
-- ...
- 09-04-2009 #1Just 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
- 09-08-2009 #2
Posting a makefile I use for a litle similar situation you can use it as a base and modify if you like
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.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)
- 09-21-2009 #3Just 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.


Reply With Quote