LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2018, 05:41 AM   #1
ArmNewbie
LQ Newbie
 
Registered: Jun 2018
Posts: 8

Rep: Reputation: Disabled
Relocations in generic ELF (EM: 183)


Hi,

I used to be able to cross-compile a program for aarch64 architecture with arm cpus with:

./configure --host=aarch64-linux-gnu --prefix=/data/data/papi/independent --exec-prefix=/data/data/papi/dependent --with-static-lib=yes --with-shared-lib=no --with-static-tools --with-arch=aarch64 --with-CPU=arm --with-ffsll --with-walltimer=cycle --with-tls=__thread --with-virtualtimer=clock_cputime_id --with-perf-events

But now, after running make, I'm getting this error:
mpicc -I../testlib -I../validation_tests -I.. -I. -g -Wextra -DUSE_PTHREAD_MUTEXES -Wall -O1 first.c ../testlib/libtestlib.a ../testlib/do_loops.o ../libpapi.a -ldl -static -o mpifirst
/usr/bin/ld: ../testlib/libtestlib.a(test_utils.o): Relocations in generic ELF (EM: 183)
/usr/bin/ld: ../testlib/libtestlib.a(test_utils.o): Relocations in generic ELF (EM: 183)
/usr/bin/ld: ../testlib/libtestlib.a(test_utils.o): Relocations in generic ELF (EM: 183)
/usr/bin/ld: ../testlib/libtestlib.a(test_utils.o): Relocations in generic ELF (EM: 183)
/usr/bin/ld: ../testlib/libtestlib.a(test_utils.o): Relocations in generic ELF (EM: 183)
/usr/bin/ld: ../testlib/libtestlib.a(test_utils.o): Relocations in generic ELF (EM: 183)
../testlib/libtestlib.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile.recipies:230: recipe for target 'mpifirst' failed
make[2]: *** [mpifirst] Error 1
make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/ctests'
Makefile.inc:240: recipe for target 'ctests' failed
make[1]: *** [ctests] Error 2
make[1]: Leaving directory '/home/lfpm1993/Desktop/papi/src'
Rules.pfm4_pe:42: recipe for target 'libpfm4/lib/libpfm.a' failed
make: *** [libpfm4/lib/libpfm.a] Error 2


Running file on test_utils.o gives:
test_utils.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), not stripped

Makefile.recipies:230: recipe for target 'mpifirst' failed corresponds to:
mpifirst: mpifirst.c $(TESTLIB) $(DOLOOPS) $(PAPILIB)
$(MPICC) $(INCLUDE) $(MPFLAGS) $(CFLAGS) $(TOPTFLAGS) first.c $(TESTLIB) $(DOLOOPS) $(PAPILIB) $(LDFLAGS) -o mpifirst -lpthread


Looks fine to me :/

Any ideias on how to solve it?

Thanks,
Luís
 
Old 07-26-2018, 01:29 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
I think the lib ../testlib/libtestlib.a is not ok (not relocatable)
 
Old 07-26-2018, 06:38 AM   #3
ArmNewbie
LQ Newbie
 
Registered: Jun 2018
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for the reply @pan64

According to another thread, I was invoking the wrong system linker and probably the wrong compiler too.

Running:
Code:
mpicc -c  -I../testlib -I../validation_tests -I.. -I.  -DUSE_PTHREAD_MUTEXES first.c
file first.o
Gives:
Code:
ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
Running:
Code:
$ mpicc --print-multiarch
Gives:
Code:
x86_64-linux-gnu
I don't know how to change the triplet or chose the right path, so that, mpicc finds the right toolchain compiler (aarch64-linux-gnu-)

Thanks,
Luís
 
  


Reply

Tags
cross-compile, elf, linux



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
LXer: mintCast 183 – Python, Twitter, and Pi LXer Syndicated Linux News 0 11-17-2013 11:42 AM
LXer: Softpedia Linux Weekly, Issue 183 LXer Syndicated Linux News 0 01-21-2012 05:40 PM
rpm -qi shows wrong Relocations anish2good Linux - Newbie 3 08-06-2011 07:39 PM
LXer: The Internet is 183 million big, and that is official LXer Syndicated Linux News 0 06-03-2009 11:51 PM
Why Suse 9.3 DVD Eval is only 183 MB? TigerLinux SUSE / openSUSE 6 10-21-2005 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:02 PM.

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