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: "cannot run C compiled programs" error


Hi,

On Mon, Apr 18, 2011 at 9:45 AM, Anna Ceguerra
<anna.ceguerra@sydney.edu.au> wrote:
> Hi Kevin,
>
>
> On 19/04/11 19/04/11 12:22 AM, "kevin diggs" <diggskevin38@gmail.com> wrote:
>
>> Hi,
>>
>> On Sun, Apr 17, 2011 at 10:45 PM, Ian Lance Taylor <iant@google.com> wrote:
>>> Jonathan Wakely <jwakely.gcc@gmail.com> writes:
>>>
>>>>> configure:3166: checking whether the C compiler works
>>>>> configure:3175: ./a.out
>>>>> ../../../../gcc-4.6-20110408/libgcc/configure: line 3177: ./a.out: Bad CPU
>>>>> type in executable
>>>>
>> Some type of PowerPC vs x86 thing? Can you use the file command to
>> make sure that the architecture matches what you are running on?
>>
> I can't seem to find the file a.out anywhere...
>
It is something that configure creates. Try looking in the config.log
in the libgcc directory of your obj dir. It is in the top level under
the <machine type> dir.

>> Can you try going into the gcc subdir of your object dir and try to
>> compile using -S a simple file and see what the assembler looks like:
>>
>> ./xgcc -B. <other stuff may be needed> simple.c
>
> This is what the assembly code looks like for
> simple.c
> ========
> int main()
> {
>
> }
>
> simple.s
> ========
> ? ? ? ?.text
> ? ? ? ?.globl _main
> _main:
> LFB0:
> ? ? ? ?pushl ? %ebp
> LCFI0:
> ? ? ? ?movl ? ?%esp, %ebp
> LCFI1:
> ? ? ? ?popl ? ?%ebp
> LCFI2:
> ? ? ? ?ret
> LFE0:
> ? ? ? ?.section
> __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
> EH_frame1:
> ? ? ? ?.set L$set$0,LECIE1-LSCIE1
> ? ? ? ?.long L$set$0
> LSCIE1:
> ? ? ? ?.long ? 0
> ? ? ? ?.byte ? 0x1
> ? ? ? ?.ascii "zR\0"
> ? ? ? ?.byte ? 0x1
> ? ? ? ?.byte ? 0x7c
> ? ? ? ?.byte ? 0x8
> ? ? ? ?.byte ? 0x1
> ? ? ? ?.byte ? 0x10
> ? ? ? ?.byte ? 0xc
> ? ? ? ?.byte ? 0x5
> ? ? ? ?.byte ? 0x4
> ? ? ? ?.byte ? 0x88
> ? ? ? ?.byte ? 0x1
> ? ? ? ?.align 2
> LECIE1:
> LSFDE1:
> ? ? ? ?.set L$set$1,LEFDE1-LASFDE1
> ? ? ? ?.long L$set$1
> LASFDE1:
> ? ? ? ?.long ? LASFDE1-EH_frame1
> ? ? ? ?.long ? LFB0-.
> ? ? ? ?.set L$set$2,LFE0-LFB0
> ? ? ? ?.long L$set$2
> ? ? ? ?.byte ? 0
> ? ? ? ?.byte ? 0x4
> ? ? ? ?.set L$set$3,LCFI0-LFB0
> ? ? ? ?.long L$set$3
> ? ? ? ?.byte ? 0xe
> ? ? ? ?.byte ? 0x8
> ? ? ? ?.byte ? 0x84
> ? ? ? ?.byte ? 0x2
> ? ? ? ?.byte ? 0x4
> ? ? ? ?.set L$set$4,LCFI1-LCFI0
> ? ? ? ?.long L$set$4
> ? ? ? ?.byte ? 0xd
> ? ? ? ?.byte ? 0x4
> ? ? ? ?.byte ? 0x4
> ? ? ? ?.set L$set$5,LCFI2-LCFI1
> ? ? ? ?.long L$set$5
> ? ? ? ?.byte ? 0xc
> ? ? ? ?.byte ? 0x5
> ? ? ? ?.byte ? 0x4
> ? ? ? ?.byte ? 0xc4
> ? ? ? ?.align 2
> LEFDE1:
> ? ? ? ?.subsections_via_symbols
>
> Thanks and regards,
> Anna.
>
>

Try to assemble this:

./xgcc -B. -v simple.s

If that works, try:

file simple.o

One of your other posts, which I missed somehow, you state that your
system is 32-bit? I thought all of the x86 macs were 64-bit capable?
(You and me have a WILDLY different idea of what "really old machine"
means. DEMON is ... an old machine. He is a PowerMac 8600. My 386 is a
really old machine.)

kevin


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