LinuxQuestions.org
Review your favorite Linux distribution.
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 11-03-2012, 04:06 AM   #1
mahesh418.g
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Rep: Reputation: Disabled
Lightbulb xillinux( ubuntu 12.04 LTS based os) for zedboard makes Arith/logic error unlike pc


My cpp project compiles and runs as well successfully with correct results in a linux based pc. But the same cpp project luckily gets compiled in xillinux platform(ubuntu 12.04 LTS based Linux distribution) on Zedboard(development board with arm cortex a9 dual core processor) but while running it makes a logical error in computation and eventually aborts as its programmed to abort if something goes wrong.

Error:
Assertion fails and then aborts and gets cored dumped.
The assertion is to check a variable's value if its less than or equal to 1. But it gets a value 255 instead 1 or 0 or -1 .
In a PC with centos/ubuntu and intel i3 processor it didn't give 255 ever..!

Gcc compiler version in my PC running centos is:
gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)

Gcc compiler version in xillinux (zedboard) is:
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

It seems to be some incompatibility but not sure about the cause. How to get rid of this problem?
Can anyone help me in this please..?

Thanks.
-Mahesh
 
Old 11-03-2012, 12:57 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
If you would post your code, or a fragment of it to illustrate the specifics of the problem, then we could do more than guess.

But without your code, I can only guess that, IF you are using the C language, then you might want to keep in mind that the actual size of some integer data types can vary from machine to machine. So it is certainly possible to write a program which succeeds in making a computation on one machine, but fails on another machine.

You might want to make use of the sizeof operator to display the size of the variables you are using, as you run the program, on each machine.

Also, you might consider making use of more portable data types.

Link to information on C data types
 
1 members found this post helpful.
Old 11-04-2012, 10:21 PM   #3
mahesh418.g
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks a lot kakaka for the reply. And i got your point about the portable data types. I will explore into that. Thanks again.
 
Old 11-07-2012, 04:59 AM   #4
mahesh418.g
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kakaka View Post
If you would post your code, or a fragment of it to illustrate the specifics of the problem, then we could do more than guess.

But without your code, I can only guess that, IF you are using the C language, then you might want to keep in mind that the actual size of some integer data types can vary from machine to machine. So it is certainly possible to write a program which succeeds in making a computation on one machine, but fails on another machine.

You might want to make use of the sizeof operator to display the size of the variables you are using, as you run the program, on each machine.

Also, you might consider making use of more portable data types.

Link to information on C data types
Hi..
In my cpp project, i found a dir called compat and inside that stdint.h is there. In wiki its mentioned that stdint.h will help for data type problems for different cpu architectures. Any idea about how to make use of this? i tried gcc -std=c99 but it complains that c++ cannot be supported with this c99 standard.. any idea about this please...
 
Old 04-17-2013, 01:07 AM   #5
mahesh418.g
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file

Hi,

I created Boot.bin file for developing xilinx-linux on ZedBoard(Digilent),
Then copied Boot.bin and other files(ramdisk,devicetree,Zimage,zynq_fsbl.elf) to sdcard and
Booted xilinux OS on Zedboard Successfully,

Then i tried to run the simple helloworld.c on this Xilinux-linux of Zedboard using the
ARM Crosscompiler's(arm-xilinux-linux-gnueabi-g++ helloworld.c -o A.out).
On Linux PC i genrated A.out file using the Arm crosscompiler's,then moved this A.out to Zedboard
and ran the A.out executable file xilinx-linux of Zedboard,it's giving helloworld o/p...working fine.

Now i am trying to running my c,c++ codes(more than 5 files) on Xilinux-linux of Zedboard,
For that one i genrated the A.out file on Linux PC using ARM cross compiler's,
Then i tried to ran the this A.out executable on xilinx-linux of ZedBoard.
it giving the following error,

error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

Then i tried to copied libstdc++.so.6 file to corresponding location on board side,
And also exported path for corresponding /bin and library files,
Still i am facing same problem,

Can Any one provide Solution for solving this error?
Can anyone help me in this please..?

Last edited by mahesh418.g; 04-17-2013 at 01:11 AM.
 
Old 05-02-2013, 02:18 PM   #6
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
mahesh418.g,

You might try asking your questions on the forums that exist to help Users of Xilinx products:

http://forums.xilinx.com/

I don't know anything about the particular Linux you are using. But in general, when dealing with cross compiling, there are various ways to do it, two of the major ways are:

1) Have a complete development environment on one platform, with all the libraries compatible with your target platform, and statically link the output files cross-compiled for the target platform, with the libraries for the target platform. Then just copy over the executables which will have no dynamic dependencies on external libraries.

2) Just cross-compile from your source code producing binaries for the target platform with dynamic linking, meaning there will be dependencies on external libraries from the target platform. When you copy over the output binaries, the proper libraries will have to be present on the target platform in order to run the binaries successfully.

So when you copied over the libstdc++.so.6 it was the library for the target platform, yes? It was the libstdc++.so.6 for Xilinx Linux on an ARM based system?
 
  


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
LXer: ArtistX 1.3 Is Based on Ubuntu 12.04 LTS LXer Syndicated Linux News 0 09-24-2012 09:00 AM
LXer: Zorin OS 6 Is Based on Ubuntu 12.04 LTS LXer Syndicated Linux News 0 06-20-2012 12:00 AM
Distros based on Ubuntu 10.04 Lucid LTS icett Ubuntu 12 04-02-2012 02:02 AM
No enough space error when trying upgrade ubuntu from 8.04 lts to 10.04 lts flik shen Ubuntu 5 06-15-2010 12:44 PM
Kernel Panic - init - arith: syntax error BrianHenderson Debian 3 08-18-2005 03:47 AM

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

All times are GMT -5. The time now is 01:43 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