README
1Building for arm-linux
2----------------------
3
4The files in this directory add another cross-compilation
5target to the Perl buildsystem. It was built as a part of
6the Open Zaurus (http://www.openzaurus.org/) distribution.
7Most / All of the arm compiler optimisations are "borrowed"
8from this excellent project.
9
10(Further discussion about cross-compiling Perl in the top level
11INSTALL file, see the section "Cross-compilation".)
12
13The main target is arm-linux but I have also managed to
14successfully cross-compile Perl for Solaris x86 using the same
15buildsystem.
16
17We are currently dependent on an existing working local copy of
18Perl ** of the same version and revision ** which is available
19as /usr/bin/perl.
20
21You need a working and tested cross-compiler for your build
22and target combination. The binary directory must be in
23your path.
24
251) You should be reading me (README) in perl-5.x.y/Cross
26
272) Make sure you are in the Cross directory.
28
293) Edit the file 'config' to contain your target platform information.
30
314) make patch ## This will patch the existing source-tree.
325) make perl ## Will make perl
33
34Your built Perl environment is in install_me_here/ in your build
35directory. From here you can package and deploy as you wish.
36
37Omissions
38----------
39
40This does NOT perform any installation.
41
42Make test will NOT work.
43
44We do not provide documentation in the core, man pages are not generated.
45
46Other Targets (For Developers)
47------------------------------
48
49It is possible to extend the cross-compilation to other targets.
50We have successfully compiled for the target solaris2.8/x86
51on linux/x86 build system.
52
53To attempt a cross-compile for another target using the methods
54in this directory:
55
561) Copy the Perl source code onto your TARGET machine.
572) Execute sh Configure as normal and configure as required,
58 do not "make".
593) Copy the config.sh file that is generated to your BUILD
60 machine and place it in the Cross directory with the
61 filename config.sh-ARCH-OS. For example,
62 config.sh-i386-pc-solaris2.8. For the appropriate ARCH
63 and OS please refer to your cross-compiler documentation.
644) Edit Cross/config to reflect your new target and continue
65 with build as above.
66
67Should you wish to produce optimised binaries for different
68architectures you can add the appropriate compiler flags to
69the Makefile in a new ifeq ($(ARCH),...) ... endif block.
70
71
72Please refer to your cross-compiler documentation for details.
73
74
75 Note that the Cross/ directory is also used by a different
76 cross-compilation setup described in the INSTALL file, and
77 executed by Configure. There should be no conflicts since
78 it is unlikely both that cross-compilation setups are used
79 simultaneously.
80
81Enjoy!
82
83References
84----------
85Redvers Davies <red@criticalintegration.com>
86Open Zaurus http://www.openzaurus.org/
87
README.new
1# vim: syntax=pod
2
3You're reading ./Cross/README.new, describing Perl cross-compilation process.
4NOTE: this file will replace ./Cross/README, after the cross-compilation scheme
5is stabilized.
6
7=head1 NAME
8
9README.new - Cross-compilation for linux
10
11=head1 DESCRIPTION
12
13This is second approach to linux cross-compilation, which should allow
14building full perl and extensions for target platform.
15
16We refer to HOST as the platform where the build is performed, and to
17TARGET as where final executables will run.
18
19=head2 Basic ideas
20
21=head3 common
22
23Output files from GCC cross-compiler are produced in the same
24directory where C files are. All TARGET binaries have different extensions
25so to distinguish HOST and TARGET binaries. Namely, object files for C<arm>
26cross-compilation will have extension C<.armo>, executable files will have
27C<.arm>.
28
29After typical cross-compilation the following files will be built, among
30others:
31
32 sv.c
33 sv.o
34 sv.armo
35 libperl.arma
36
37(this approach may be reconsidered, however.)
38
39=head3 build process
40
41C<miniperl> is built. This executable is intended to run on HOST, and it
42will facilitate the remaining build process; all binaries built after it are
43foreign (TARGET) and should not run locally (HOST).
44
45Unlike HOST build, miniperl will not have C<Config.pm> of HOST within reach;
46it rather will use the C<Config.pm> from the cross-compilation directories.
47In fact, if the build process does have Config.pm within reach, this is only
48an indication of a mistake somewhere in the middle.
49
50 # following command is okay:
51 ./miniperl -Ilib -MCross -MConfig -e 1
52 # following command should cluck, and it is bad if it does not:
53 ./miniperl -Ilib -MConfig -e 1
54
55After C<miniperl> is built, C<configpm> is invoked to create an
56appropriate C<Config.pm> in the right place and its corresponding
57C<Cross.pm>.
58
59File C<Cross.pm> is dead simple: for given cross-architecture places in @INC
60a path where perl modules are, and right C<Config.pm> in that place.
61
62That said, C<miniperl -Ilib -MConfig -we 1> should report an error, because
63it cannot find C<Config.pm>. If it does not give an error, a wrong C<Config.pm>
64is substituted, and resulting binaries will be a mess.
65
66C<miniperl -MCross -MConfig -we 1> should run okay, and it will provide a
67correct C<Config.pm> for further compilations.
68
69During extensions build phase, the script C<./ext/util/make_ext_cross> is
70invoked.
71
72All invocations of C<Makefile.PL> are provided with C<-MCross> so to enable
73cross-compilation.
74
75=head2 BUILD
76
77=head3 Tools & SDK
78
79To compile, you need the following:
80
81=over 4
82
83=item * TODO
84
85=back
86
87=head1 Things to be done
88
89=over 4
90
91=item * better distinguishing of config.h/xconfig.h, dependencies
92
93=item * object files created in ./xlib/cross-name/ ?
94
95=back
96