LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2009, 11:36 PM   #1
_oligarch
LQ Newbie
 
Registered: Apr 2009
Posts: 5

Rep: Reputation: 0
Compiling project with threads for ARM


Hi everybody. I'm performing development for AT91SAM9260 microcontroller (ARM926EJ-S core) under RedHat4 virtual machine.
I made a project wich contain one thread. And when I try to compile it with:

arm-none-linux-gnueabi-gcc -l pthread -mcpu=arm926ej-s test.c -o test

compiling is failing with a follow error:

/usr/local/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libpthread.so.0 inside /usr/local/bin/../arm-none-linux-gnueabi/libc

After that I found a "libpthread.so.0" and pointed a path to this link:

arm-none-linux-gnueabi-gcc -L /usr/local/arm-none-linux-gnueabi/libc/armv4t/lib -l pthread -mcpu=arm926ej-s test.c -o test

And the same error occured again. After that I added "/usr/local/arm-none-linux-gnueabi/libc/armv4t/lib" to the 'PATH' environment variable. And it didn't help to solve this problem.
What else can I do to compile my project?
 
Old 04-27-2009, 04:00 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Please check if the pthread version you have found matches your architecture. Compare readelf result on the library and on one of your running programs. It looks there's something's different. The first check will be to find which libc it links to. Pthread should be in the same directory.

Note that it *seems* to see the library in your 'standard' version (i386), there's full path shown. You may try adding the path to LD_LIBRARY_PATH: PATH doesn't help for libraries:
export LD_LIBRARY_PATH=:/usr/local/arm-none-linux-gnueabi/libc/armv4t/lib:$LD_LIBRARY_PATH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compiling apache-2.0.54 for arm jkeertir Linux - Newbie 3 09-11-2014 01:35 PM
ARM Cross Compiling Issues AuzJ Linux - Newbie 4 04-16-2009 03:47 AM
Error compiling 2.6.26 for ARM zahidul Linux - Kernel 0 11-04-2008 05:20 AM
When do i get "/arm-elf/bin/ld:cannot find -lc" while compiling my project rameshsatyavaram Linux - Newbie 0 09-10-2008 03:31 PM
Cross compiling utftpd for arm SachinTCS Linux - Desktop 1 04-13-2007 02:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration