[Offtopic] Cross compiling a native toolchain

Development on core packages and the distribution goes on in here.

[Offtopic] Cross compiling a native toolchain

Postby Mijzelf » Sun Feb 01, 2015 3:43 pm

I am trying to build a native toolchain for a ZyXEL NAS540, using a cross compile toolchain.

That box has a deviant page size of 64kB, causing all binaries which are not compiled explicitely for this box to be Killed. I wrote the results of some of my investigations here: http://www.zyxelforum.de/viewtopic.php?f=242&t=8200

After building binutils and gcc I can build a 'hello world' on my NAS, but the binary crashes with 'Killed'. When I compile the .c file on my NAS and link it on my PC, it runs. I intercepted the call to ld to see if gcc somehow specified the strange page size on the command line, but it didn't. So I guess the created ld binary should take care for the page size, and fails.

How do I specify such details when building binutils?
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am

Re: [Offtopic] Cross compiling a native toolchain

Postby WarheadsSE » Mon Feb 02, 2015 2:18 am

Having read that thread, thank you for properly using the ARMvX format of specifications for generations, and not ARMX for familial trees.

From what I am seeing, that is indeed a bit odd. Now, I have never seen the 540 myself, so I can't lend that much of hand remotely, but you should be able to get that page size tweak based on the kernel headers from the end target.

If you can get me more information on the device, I might be able to assist you in getting full ALARM support, unless you want only to run foreign binaries on their userland.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [Offtopic] Cross compiling a native toolchain

Postby Mijzelf » Mon Feb 02, 2015 11:56 am

$this->bbcode_second_pass_quote('WarheadsSE', 'H')aving read that thread, thank you for properly using the ARMvX format of specifications for generations, and not ARMX for familial trees.
You're welcome.
$this->bbcode_second_pass_quote('', 'F')rom what I am seeing, that is indeed a bit odd. Now, I have never seen the 540 myself, so I can't lend that much of hand remotely, but you should be able to get that page size tweak based on the kernel headers from the end target.
I don't have the GPL sources yet, ZyXEL promised me that they would be available for download at the end of February. Now I have a cross-compile toolchain (provided by ZyXEL. The toolchain is built by an OpenWRT environment), containing some kernel headers, but maybe not the right ones. I changed the value EXEC_PAGESIZE in <asm/param.h> from 4k to 64k, but that didn't seem to change anything. Any idea which value is responsible?
I do have the Synology sources, but as I wrote I think it uses a different page size. (It has half the memory, could it be that the page size is dependent on the memory size?)
$this->bbcode_second_pass_quote('', 'I')f you can get me more information on the device, I might be able to assist you in getting full ALARM support, unless you want only to run foreign binaries on their userland.
The box as-is doesn't fit my needs. I bought this box to put Debian on it (just reusing the stock kernel), but this pagesize stuff is blocking. So yes, ALARM would be an option, especially when it's easily revertable, like on the 325.
What kind of information are you looking for? I documented some specs here.
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am
Top

Re: [Offtopic] Cross compiling a native toolchain

Postby WarheadsSE » Tue Feb 03, 2015 6:51 pm

I would love if this could be confirmed to be the original Comcerto or the Freescale incorporated version.

I am looking & asking around about your page size issue.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [Offtopic] Cross compiling a native toolchain

Postby Mijzelf » Tue Feb 03, 2015 8:23 pm

$this->bbcode_second_pass_quote('WarheadsSE', 'I') would love if this could be confirmed to be the original Comcerto or the Freescale incorporated version.
What do you mean by 'this' here?
$this->bbcode_second_pass_quote('', 'I') am looking & asking around about your page size issue.
Thanks.
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am
Top

Re: [Offtopic] Cross compiling a native toolchain

Postby WarheadsSE » Tue Feb 03, 2015 9:26 pm

"This" being the SoC involved.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [Offtopic] Cross compiling a native toolchain

Postby Mijzelf » Wed Feb 04, 2015 9:33 am

Do you mean that Freescale changed the design? If yes, how can the difference be determined? Is it enough to read the chip branding? (I must admit that I haven't opened the case yet :oops: )
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am

Re: [Offtopic] Cross compiling a native toolchain

Postby Mijzelf » Sat Feb 07, 2015 1:35 pm

I added PCB photos to the Wiki. The SoC is definitely Freescale branded.
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am

Re: [Offtopic] Cross compiling a native toolchain

Postby Mijzelf » Sat Mar 14, 2015 10:44 am

Meanwhile I received the GPL sources+toolchain. (1.9TB!). I have examined the differences between the kernelsource+config of the Synology DS414 and the ZyXEL NAS540. The sources are based on the same arch/arm/mach-comcerto/* files, but both ZyXEL and Synology have adapthed them a bit. (gpio and stuff).
As far as I could judge, the only relevant difference in the config is:$this->bbcode_second_pass_code('', 'config COMCERTO_64K_PAGES
bool "Comcerto 64kB pages"
default n
help
Say Y to enable 64kB pages instead of the default 4kB. Memory usage will be increased, but
per-page operations will be reduced, and data transfers will become more efficient.')For the ZyXEL this is set to yes, for the Synology to 'not set'.
Grepping through the kernel sources, this flag is used on much places outside the mach-comcerto directory.

Well, the good news it that apearently the page size is not hardware imposed, so by compiling my own kernel I should be able to run my own OS.
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am

Re: [Offtopic] Cross compiling a native toolchain

Postby WarheadsSE » Sun Mar 15, 2015 1:19 pm

WOoo
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Next

Return to Arch Linux ARM

Who is online

Users browsing this forum: No registered users and 10 guests