This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling for i586 architecture - illegal instruction on executable


On 09/27/2015 05:25 PM, Renato Mendes wrote:
> Johann:
> 
> I  tried to compile and run on gdb and here is what IÂve got:
> 
> First IÂve added the -g flag:
> 
> g++ -march=i586 test.cpp -g -o test586.cpp -static -static-libgcc
> -static-libstdc++
> 
> Then on target machine:
> 
> 
> [root@DSC_DKLinux:/]$ gdb ./test586
> 
> 
> dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: symbol
> __libc_write, version GLIBC_PRIVATE not defined in file libc.so.6 with
> link time reference
> GDB will not be able to debug pthreads.
> 
> GNU gdb 5.3.92
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i586-suse-linux"...Dwarf Error: wrong
> version in compilation unit header (is 4, should be 2) [in module
> /test586]
> 
> (gdb) run
> 
> 
> Here the run get stuck - nothing happens and I have to abort using CTRL-Z
> 
> BTW: IÂve tried both march=i586 and march=i486
> 
something seems out of sync.... I dunno what...
fix your gdb.. libraries.. whatever...
> 
> Florian:
> 
> So, for Ubuntu I would need to download the gcc latest source code and
> recompile it or is there a shorter way to go ? What flags would that
> be used for compilation ?
> 
> Abount Debian, you mean that if I switch my developmnet machine to
> Debian and install the latest gcc it will generate usable code for my
> Vortex processor using the -march=i586 flag ?
> 
I don't recall suggesting it, but yes it could work...
I guess even ubuntu should work, or don't they have i386 binaries?
I do have a fileserver that runs debian testing. But it's not the same CPU as yours...
It's not quite possible to tell without knowing the faulting instruction..
Try to get the address of it and find out... or just try and err.. I dunno...
I believe there was an addr2line.pl script somewhere.. not sure where...



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]