BUILD FAILED gcc failed with return code 1

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

BUILD FAILED gcc failed with return code 1

Postby banderson » Thu Jan 17, 2008 12:19 am

Machine is 64 bit K12LTSP version 6.0

[root@server build]# ant -version
Apache Ant version 1.7.0 compiled on December 13 2006

Buildfile: build.xml

clean:
[echo] saving existing files to .bak files
[move] Moving 4 files to /opt/lejos_nxj/bin

libnxt:

clean:

libnxt:
[cc] 5 total files to be compiled.
[cc] Starting link
[cc] ar: creating libnxt.a
[cc] a - samba.o
[cc] a - flash.o
[cc] a - error.o
[cc] a - lowlevel.o
[cc] a - firmware.o

nxjflash:
[cc] 1 total files to be compiled.
[cc] Starting link

jlibnxt:
[cc] 1 total files to be compiled.
[cc] Starting link
[cc] /usr/bin/ld: /opt/lejos_nxj/src/libnxt/libnxt.a(lowlevel.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
[cc] /opt/lejos_nxj/src/libnxt/libnxt.a: could not read symbols: Bad value
[cc] collect2: ld returned 1 exit status

BUILD FAILED
/opt/lejos_nxj/build/build.xml:65: The following error occurred while executing this line:
/opt/lejos_nxj/src/libnxt/build.xml:144: gcc failed with return code 1

Total time: 1 second

I experimented with adding -fPIC various places in libnxt/build.xml and I could get things to compile, but when I executed nxj I got wordsize missmatch and unable to load comm driver errors.
Bruce Anderson
Westmont High School
4805 Westmont Avenue
Campbell, CA 95008
banderson
New User
 
Posts: 6
Joined: Sun Jan 06, 2008 12:30 am

Re: BUILD FAILED gcc failed with return code 1

Postby CoBB » Thu Jan 17, 2008 7:03 am

banderson wrote:I experimented with adding -fPIC various places in libnxt/build.xml and I could get things to compile, but when I executed nxj I got wordsize missmatch and unable to load comm driver errors.

Check out this topic. The argument is needed for libnxt, since that’s the lib you want to link to later. The fix definitely works for me.
User avatar
CoBB
Novice
 
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm

word width mismatch

Postby banderson » Thu Jan 17, 2008 3:14 pm

[bruce@server Lejos]$ nxjc Tune.java
[bruce@server Lejos]$ ls
GraphicsSample.java HelloWorld.java Tune.class
Hello1.java legoNxtInstall Tune.java
[bruce@server Lejos]$ nxj -r Tune
leJOS NXJ> Linking...
leJOS NXJ> Uploading...
leJOS NXJ> /opt/lejos_nxj/bin/libjlibnxt.so: /opt/lejos_nxj/bin/libjlibnxt.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
leJOS NXJ> /opt/lejos_nxj/bin/libjbluez.so: /opt/lejos_nxj/bin/libjbluez.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
an error occurred: Cannot load a comm driver
[bruce@server Lejos]$ nxjbrowse
Error: Cannot load a comm driver
[bruce@server Lejos]$
Bruce Anderson
Westmont High School
4805 Westmont Avenue
Campbell, CA 95008
banderson
New User
 
Posts: 6
Joined: Sun Jan 06, 2008 12:30 am

Postby CoBB » Thu Jan 17, 2008 4:57 pm

Hmm, is everything in your system 64-bit? Your Java runtime might be a 32-bit version if it can’t use the 64-bit libs.
User avatar
CoBB
Novice
 
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm

Postby banderson » Tue Jan 29, 2008 3:32 am

I copied a lejos_nxj build from a 32 bit system to my 64 bit machine and it seems to work.
Bruce Anderson
Westmont High School
4805 Westmont Avenue
Campbell, CA 95008
banderson
New User
 
Posts: 6
Joined: Sun Jan 06, 2008 12:30 am

Postby CoBB » Tue Jan 29, 2008 6:39 pm

Yes, that’s a sensible solution. After all, 64-bit systems can execute 32-bit programs as long as all the dependencies are available in 32-bit version too.
User avatar
CoBB
Novice
 
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm


Return to NXJ Software

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests

more stuff