Erstellt vor 7 Jahren

Zuletzt geändert vor 6 Jahren

#1500 new addition

Fully-Featured Perl on Freetz

Erstellt von: ralph Verantwortlicher:
Priorität: normal Meilenstein: freetz-future
Komponente: packages Version: devel
Stichworte: Beobachter:
Product Id: Firmware Version:


To get a fully-featured perl to compile on Freetz, we need to…

  • Have uClibc's system headers available (notably, errno.h and dependencies).
  • Have tons of storage space available (> 128 MB uncompressed).
  • Configure perl source tree for host (build system).
  • Configure (another) perl source tree for target (fbox).

— Setting Configure option -Duserelocatableinc will help avoid 'extension not found' errors.
— With it, perl will look for extensions in ../lib/perl5 .
— Without it, it will look in ${prefix}/lib/perl5.
— (Either way, -I $path adds $path to @INC .)

  • Build native microperl as host_microperl. Alternatively, a locally-available /usr/bin/perl would probably suffice IF it's the same version.
  • Edit target_perl's $(top_srcdir)/ext/Errno/Errno_pm.PL so it can read errno.h (default: /usr/include/errno.h). In 5.14.1, that's lines 127, 147 and 148.
  • Patch target_perl's top-level Makefile so it uses host_microperl to generate Makefiles for its extensions (instead of its own). Setting FULLPERL=/path/to/host_microperl should do that.
  • Make & pray.
  • If successful, make test and hope for the best. Alternatively, skip that step if you're confident.
  • If happy with the results, make install.

Sizes seem to vary depending on actual config:
(note that this is a native build)

# perl5.14.1 -V

Summary of my perl5 (revision 5 version 14 subversion 1) configuration:

    osname=linux, osvers=, archname=mips-linux
    uname='linux #2 sat aug 13 16:45:57 cest 2011 mi
ps gnulinux '
    config_args='-Dusedevel -Dprefix=/opt'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OF
    cppflags='-fno-strict-aliasing -pipe'
    ccversion='', gccversion='4.4.6', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib
    libs=-ldl -lm -lcrypt -lc
    perllibs=-ldl -lm -lcrypt -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2'

Characteristics of this binary (from libperl):
                        USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Sep 12 2011 23:34:25
# ls -dl bin/perl5.14.*
-rwxr-xr-x 2 root root 1557422 Sep 13 00:59 bin/perl5.14.1


# ldd bin/perl5.14.*
bin/perl5.14.1: => /lib/ (0x2aabf000) => /lib/ (0x2aad2000) => /lib/ (0x2aaf8000) => /lib/ (0x2ab1c000) => /lib/ (0x2abd7000) => /lib/ (0x2aaa8000)

Anhänge (2) (5.2 KB) - hinzugefügt von ralph vor 7 Jahren. used for build (32.3 KB) - hinzugefügt von ralph vor 7 Jahren. used for build

Alle Anhänge herunterladen als: .zip

Änderungshistorie (3)

Geändert vor 7 Jahren durch ralph used for build

Geändert vor 7 Jahren durch ralph used for build

comment:1 Geändert vor 6 Jahren durch cuma

  • Typ von enhancement nach addition geändert
Hinweis: Hilfe zur Verwendung von Tickets finden Sie in TracTickets.