我正在尝试从源代码编译(13 岁)perl 5.10.1:
$ wget https://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2
$ bunzip2 perl-5.10.1.tar.bz2
$ tar xvf perl-5.10.1.tar
$ cd perl-5.10.1
$ sh Configure -de -Dusethreads
$ make
[...]
cc -fstack-protector -L/usr/local/lib -o miniperl \
gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \
miniperlmain.o opmini.o perlmini.o
/bin/ld: pp.o: in function `Perl_pp_pow':
pp.c:(.text+0x2e4c): undefined reference to `pow'
/bin/ld: pp.o: in function `Perl_pp_modulo':
pp.c:(.text+0x3c2b): undefined reference to `fmod'
/bin/ld: pp.o: in function `Perl_pp_atan2':
pp.c:(.text+0x8b4e): undefined reference to `atan2'
/bin/ld: pp.o: in function `Perl_pp_sin':
pp.c:(.text+0x8c6f): undefined reference to `exp'
/bin/ld: pp.c:(.text+0x8d19): undefined reference to `sqrt'
/bin/ld: pp.c:(.text+0x8d73): undefined reference to `cos'
/bin/ld: pp.c:(.text+0x8d8b): undefined reference to `sin'
/bin/ld: pp.c:(.text+0x8df3): undefined reference to `log'
collect2: error: ld returned 1 exit status
make: *** [makefile:348: miniperl] Error 1
假设此构建问题存在现有的 patch,我该如何应用补丁?
答案 0 :(得分:4)
首先安装Devel::PatchPerl:
$ cpanm Devel::PatchPerl
然后从源代码树的根运行:
$ patchperl
Auto-guessed '5.10.1'
Patching 'hints/linux.sh'
patching Configure
patching ext/Errno/Errno_pm.PL
patching Configure
patching utils/h2ph.PL
patching lib/h2ph.t
patching ext/SDBM_File/sdbm/sdbm.c
patching lib/Time/Local.t
patching pp.c
patching Configure
patching lib/Archive/Tar/t/02_methods.t
patching ext/ODBM_File/hints/linux.pl
patching make_ext.pl
patching ext/Hash-Util-FieldHash/t/10_hash.t
patching hv.c
patching t/op/hash.t
patching perl.c
然后重新编译:
$ sh Configure -de -Dusethreads
$ make
[...]
../miniperl -I../lib find2perl.PL
Extracting find2perl (with variable substitutions)
make[1]: Leaving directory '/home/hakon/test/perl/perl-5.10.1/x2p'
Everything is up to date. Type 'make test' to run test suite.