Outputs generated by crosstool-ng unusable

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

Outputs generated by crosstool-ng unusable

Postby zombiepantslol » Sat Mar 10, 2012 2:29 pm

Hello,
I've been trying to get a working cross-compiler toolchain but when I'm done compiling the toolchain and attempt to compile my own little "Hello world" program using the cross-compiler, I can't execute the output file neither on my i686 PC (which is just fine) nor on my BeagleBoard.

I followed the official DistCC Cross-Compiling Guide, used the armv7 config (as suggested) and adjusted the path to the latest kernel sources, so I really can't spot an error there. I even got distcc to work, but its compilation results don't seem usable on my board.

Under normal circumstances, I wouldn't mind compiling packages on the board, but I need to compile a custom kernel which takes roughly 14 hours to compile on the BeagleBoard. Does anyone have an idea what's going wrong here? Do I perhaps need a special config file for crosstool-ng to get this working?

Thanks in advance,
zombiepantslol
 
Posts: 9
Joined: Mon Dec 26, 2011 1:51 pm

Re: Outputs generated by crosstool-ng unusable

Postby kmihelich » Sat Mar 10, 2012 5:54 pm

Are you getting errors during compilation or linking?
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Outputs generated by crosstool-ng unusable

Postby zombiepantslol » Sat Mar 10, 2012 7:36 pm

Nope, no errors. I just updated my crosstool-ng configuration so I can use the latest versions of all tools used but still no success.
My test program looks like this, actually nothing special:

$this->bbcode_second_pass_code('', '#include <stdio.h>

int main()
{
printf("Hello world!\n");
}')

And yet when I tried to execute the new binary, I get this error:

$this->bbcode_second_pass_quote('', '[')root@beagleboard ~]# ./test
-bash: ./test: cannot execute binary file
[root@beagleboard ~]#


Seems quite weird to me. Just in case you want to check my crosstool configuration file, feel free to take a look at the attachment. And thanks for your reply!

[Edit]No attachment? Well, just uploaded it via pastebin: http://pastebin.com/WbMbx40s[Edit]
zombiepantslol
 
Posts: 9
Joined: Mon Dec 26, 2011 1:51 pm

Re: Outputs generated by crosstool-ng unusable

Postby kmihelich » Sat Mar 10, 2012 8:22 pm

What does `file test` say?
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Outputs generated by crosstool-ng unusable

Postby zombiepantslol » Sat Mar 10, 2012 8:40 pm

When compiled on my PC (i686):
$this->bbcode_second_pass_quote('', '[')chham@badthing ~]$ file test
test: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped


And on my BeagleBoard (arm):
$this->bbcode_second_pass_quote('', '[')root@beagleboard ~]# file test
test: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped


Hrm, I guess Intel 80386 is wrong there. How can I change that?
zombiepantslol
 
Posts: 9
Joined: Mon Dec 26, 2011 1:51 pm
Top

Re: Outputs generated by crosstool-ng unusable

Postby kmihelich » Sat Mar 10, 2012 8:42 pm

Something is off.. is your beagleboard install up to date, and are all packages of the group 'base-devel' installed?
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Outputs generated by crosstool-ng unusable

Postby kmihelich » Sat Mar 10, 2012 9:02 pm

For comparison, here is your example built on my Pandaboard. I know the whole distcc/ct-ng setup works, because I wrote the book on it and use it daily to build hundreds of packages across both architectures we support. Basically it boils down to something is not being done correctly by you.

$this->bbcode_second_pass_code('', 'root@platinum:~# cat test.c
#include <stdio.h>

int main()
{
printf("Hello world!\n");
}
root@platinum:~# distcc test.c -o test
root@platinum:~# file test
test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.27, BuildID[sha1]=0xfc1e338c5e3c32b62820f6bfe8da4e17e9f81ff9, not stripped
root@platinum:~# ./test
Hello world!
root@platinum:~# readelf -A test
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_DIV_use: Not allowed')
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Outputs generated by crosstool-ng unusable

Postby kmihelich » Sat Mar 10, 2012 9:07 pm

$this->bbcode_second_pass_quote('zombiepantslol', '
')$this->bbcode_second_pass_quote('', '[')root@beagleboard ~]# file test
test: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped



There's your problem, you're not linking into an executable.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm
Top

Re: Outputs generated by crosstool-ng unusable

Postby zombiepantslol » Sat Mar 10, 2012 9:44 pm

Sounds reasonable, but where's the error? Could you please upload your crosstool's .config file?

My BeagleBoard and my PC are up-to-date, so I'm really starting to run out of ideas...
zombiepantslol
 
Posts: 9
Joined: Mon Dec 26, 2011 1:51 pm

Re: Outputs generated by crosstool-ng unusable

Postby kmihelich » Sat Mar 10, 2012 9:52 pm

The error is that you're not linking the resultant object file into an executable, and the config on the main site is my config.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Next

Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 8 guests