Cross-compile N2->C2

Post Reply
pierods
Posts: 3
Joined: Mon Apr 08, 2019 9:01 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Cross-compile N2->C2

Unread post by pierods » Mon Apr 08, 2019 9:55 pm

Hi,

is it possible to compile something on the N2 and run it on the C2?

I know I can cross-compile from my pc etc, but I'd rather use an N2 as a "development machine".

Thanks.

User avatar
tobetter
Posts: 3040
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 9 times
Been thanked: 23 times
Contact:

Re: Cross-compile N2->C2

Unread post by tobetter » Mon Apr 08, 2019 10:10 pm

If you build your binary for ARM64, you can. As long as you can match the machine architecture, you can.

User avatar
meveric
Posts: 9934
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, N2
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: Cross-compile N2->C2

Unread post by meveric » Mon Apr 08, 2019 10:17 pm

N2 and C2 is not cross compiling, both are arm64 architecture and you can compile anyway you want.

I used the C2 to compile for the N1, later switched to the N1 to compile for C2, N1 and N2, everything works perfectly fine.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

pierods
Posts: 3
Joined: Mon Apr 08, 2019 9:01 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Cross-compile N2->C2

Unread post by pierods » Mon Apr 08, 2019 10:34 pm

Thanks guys!

The reason why I asked is that I compile with Go, so I was trying it on a raspberry. When I downloaded the toolchain, I had two choices:

go1.12.2.linux-armv6l.tar.gz Archive Linux ARMv6
go1.12.2.linux-arm64.tar.gz Archive Linux ARMv8

Since the raspberry has a 64 bit processor, I picked the arm64 and it didn't run, so I had to switch to the armv6l.

Would this work if I compile on a N2 for a C2 and a Raspberry? Maybe I will have to pick the "arm64" version for the N2/C2 and the executable will not work on the Raspberry?

User avatar
meveric
Posts: 9934
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, N2
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: Cross-compile N2->C2

Unread post by meveric » Mon Apr 08, 2019 10:46 pm

pierods wrote:
Mon Apr 08, 2019 10:34 pm
go1.12.2.linux-armv6l.tar.gz Archive Linux ARMv6
go1.12.2.linux-arm64.tar.gz Archive Linux ARMv8

Since the raspberry has a 64 bit processor, I picked the arm64 and it didn't run, so I had to switch to the armv6l.
The RPi 3 has a 64bit processor, but uses a 32bit OS, in fact they butcher the Kernel that even the Kernel believes it runs on a 32bit processor.

pierods wrote:
Mon Apr 08, 2019 10:34 pm
Would this work if I compile on a N2 for a C2 and a Raspberry? Maybe I will have to pick the "arm64" version for the N2/C2 and the executable will not work on the Raspberry?
If you compile for arm64 on a N2 it will work on the C2 (unless you use very specific compiler options for optimization that only work on the N2).
Since N2 and C2 are both arm64 boards with an arm64 OS the binaries will work on both systems alike.
But once again, the RPi uses a 32bit OS therefore the 64bit binaries of the N2/C2 will not work on the RPi.

But you "could" run the C2 and N2 on a 32bit OS as well and then 32bit binaries would work on C2/N2 and RPi alike, although depending on what you use as a software with different results as you need 32bit drivers for everything and the C2 does not have 32bit GPU drivers, so if your application requires GPU acceleration this would not work on the C2.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

pierods
Posts: 3
Joined: Mon Apr 08, 2019 9:01 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Cross-compile N2->C2

Unread post by pierods » Mon Apr 08, 2019 10:51 pm

Thanks!

At this point, I will try to get a better OS than Raspbian for my Raspberry, so I can use the same executables for the three of them (N2, C2, RB).

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest