This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Fix failing CI 32-bit tests
[perl5.git] / Cross / README.new
CommitLineData
608969de 1You're reading ./Cross/README.new, describing Perl cross-compilation process.
fbe7f75f
RGS
2NOTE: this file will replace ./Cross/README, after the cross-compilation scheme
3is stabilized.
608969de 4
fbe7f75f 5=head1 NAME
608969de 6
fbe7f75f
RGS
7README.new - Cross-compilation for linux
8
9=head1 DESCRIPTION
10
11This is second approach to linux cross-compilation, which should allow
79c32fc2 12building full perl and extensions for target platform.
608969de
VK
13
14We refer to HOST as the platform where the build is performed, and to
15TARGET as where final executables will run.
16
17=head2 Basic ideas
18
19=head3 common
20
79c32fc2 21Output files from GCC cross-compiler are produced in the same
608969de
VK
22directory where C files are. All TARGET binaries have different extensions
23so to distinguish HOST and TARGET binaries. Namely, object files for C<arm>
24cross-compilation will have extension C<.armo>, executable files will have
25C<.arm>.
26
27After typical cross-compilation the following files will be built, among
28others:
29
30 sv.c
31 sv.o
32 sv.armo
33 libperl.arma
34
35(this approach may be reconsidered, however.)
36
37=head3 build process
38
39C<miniperl> is built. This executable is intended to run on HOST, and it
40will facilitate the remaining build process; all binaries built after it are
41foreign (TARGET) and should not run locally (HOST).
42
43Unlike HOST build, miniperl will not have C<Config.pm> of HOST within reach;
44it rather will use the C<Config.pm> from the cross-compilation directories.
45In fact, if the build process does have Config.pm within reach, this is only
46an indication of a mistake somewhere in the middle.
47
48 # following command is okay:
49 ./miniperl -Ilib -MCross -MConfig -e 1
50 # following command should cluck, and it is bad if it does not:
51 ./miniperl -Ilib -MConfig -e 1
52
fbe7f75f
RGS
53After C<miniperl> is built, C<configpm> is invoked to create an
54appropriate C<Config.pm> in the right place and its corresponding
55C<Cross.pm>.
608969de
VK
56
57File C<Cross.pm> is dead simple: for given cross-architecture places in @INC
58a path where perl modules are, and right C<Config.pm> in that place.
59
60That said, C<miniperl -Ilib -MConfig -we 1> should report an error, because
fbe7f75f 61it cannot find C<Config.pm>. If it does not give an error, a wrong C<Config.pm>
608969de
VK
62is substituted, and resulting binaries will be a mess.
63
fbe7f75f
RGS
64C<miniperl -MCross -MConfig -we 1> should run okay, and it will provide a
65correct C<Config.pm> for further compilations.
608969de
VK
66
67During extensions build phase, the script C<./ext/util/make_ext_cross> is
68invoked.
69
fbe7f75f
RGS
70All invocations of C<Makefile.PL> are provided with C<-MCross> so to enable
71cross-compilation.
608969de
VK
72
73=head2 BUILD
74
75=head3 Tools & SDK
76
fbe7f75f 77To compile, you need the following:
608969de
VK
78
79=over 4
80
81=item * TODO
82
83=back
84
85=head1 Things to be done
86
87=over 4
88
fbe7f75f 89=item * better distinguishing of config.h/xconfig.h, dependencies
608969de
VK
90
91=item * object files created in ./xlib/cross-name/ ?
92
93=back