Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How to do a true cross compilation

by talexb (Chancellor)
on Dec 18, 2021 at 17:07 UTC ( #11139705=note: print w/replies, xml ) Need Help??


in reply to How to do a true cross compilation

    But! As I understand, 'cross compiling' Perl means the following, using some custom autotools configure settings: 1. build 'miniperl' in the target architecture (in my case, for iOS that would be arm64 for devices, and arm64 or x86_64 for the simulator that runs on macOS) 2 Miniperl will build the actual library (.a file), and is expected to do so on the target device.

I believe your understanding of cross-compiling is flawed. What it actually means is that you compile code for a target that's different than the native architecture. For example, I wrote C on a VAX 11/780 that was cross-compiled to 68000 assembler, and then downloaded to the target system (yeah, OK, it was the early 80's).

If you're compiling on the local system for use on that system .. that's not cross-compiling.

I imagine that there are tools that will cross-compile for iOS on other architectures -- then all you need to do is to load that executable on the target system, possibly by creating an iOS app. I don't actually know about any of this -- I'm just hand-waving at this point.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: How to do a true cross compilation
by Joride (Initiate) on Dec 18, 2021 at 17:15 UTC
    I see what you are saying Alex, thank you for your quick response. Your description of cross compiling matches my understanding (but I can see how my write up could have been more clear). However, my understanding of Perl's way of 'cross compiling' is different, and consists of 2 steps: First, build something called 'miniperl'. This miniperl is then supposed to be transferred to the target machine, where miniperl will then build actual Perl. Of course, in your explanation, only the first step would be cross-compiling: building on macos (x86_64) for a machine (iPhone) running arm64. So I am hoping there is a way to cross-compile Perl in the way you described, without having to transfer minperl (or any access at all before building) to the target machine/system. And maybe my understanding of Perl-specific cross compilation is flawed of incomplete too, I found quite some information on the topic, but mostly not in agreement with each other.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-05-21 00:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?