perl-5.14.0在新版gcc中编译不通过解决办法

1     由于在新版本中GCC把C99中的标准库分成了libc和libm两个部分,libm中包含一些数学库等,如果要用到libm时,必须加上-lm选项

在解压Configure之后,再在Makefile中,LDFLAGS 和 CLDFLAGS两个参数后面加上 -lm即可解决问题

2     参考:http://serverfault.com/questions/145288/make-error-when-compiling-perl-5-12-1-rhel-5-5

     修改 dist/IO/poll.h:将 #include<poll.h> 修改为 #include<sys/poll.h>

3     参考:http://blog.163.com/zhangliye_2009/blog/static/1223120282013518104148904/

     在Makefile 中,LDFLAGS 和 CLDFLAGS两个参数后面加上 -lrt 

相关报错信息:

1

cc -fstack-protector -L/usr/lib64 -o miniperl \              gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o keywords.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 globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o   \            miniperlmain.o opmini.o perlmini.opp.o: In function `Perl_pp_int':pp.c:(.text+0x9151): undefined reference to `floor'pp.c:(.text+0x9171): undefined reference to `ceil'pp.o: In function `Perl_pp_sin':pp.c:(.text+0x944d): undefined reference to `sin'pp.o: In function `Perl_pp_atan2':pp.c:(.text+0xc2c3): undefined reference to `atan2'pp.o: In function `Perl_pp_modulo':pp.c:(.text+0xdc71): undefined reference to `floor'pp.c:(.text+0xde3d): undefined reference to `fmod'pp.c:(.text+0xde6f): undefined reference to `floor'pp.o: In function `Perl_pp_pow':pp.c:(.text+0xe1b3): undefined reference to `pow'pp.o:(.rodata+0x260): undefined reference to `cos'pp.o:(.rodata+0x268): undefined reference to `sin'pp.o:(.rodata+0x270): undefined reference to `sin'pp.o:(.rodata+0x278): undefined reference to `exp'pp.o:(.rodata+0x280): undefined reference to `log'pp.o:(.rodata+0x288): undefined reference to `sqrt'pp_sys.o: In function `S_gmtime64_r':pp_sys.c:(.text+0x1c21): undefined reference to `ceil'pp_sys.c:(.text+0x1c7e): undefined reference to `ceil'pp_sys.c:(.text+0x1ce3): undefined reference to `ceil'pp_sys.c:(.text+0x1da1): undefined reference to `floor'pp_sys.c:(.text+0x1f11): undefined reference to `floor'pp_sys.c:(.text+0x1f65): undefined reference to `floor'pp_sys.c:(.text+0x1f85): undefined reference to `floor'pp_sys.c:(.text+0x1fc0): undefined reference to `ceil'pp_sys.c:(.text+0x2119): undefined reference to `fmod'pp_sys.c:(.text+0x2155): undefined reference to `fmod'pp_sys.c:(.text+0x2193): undefined reference to `fmod'pp_sys.c:(.text+0x21cb): undefined reference to `fmod'pp_sys.o: In function `Perl_pp_gmtime':pp_sys.c:(.text+0x2287): undefined reference to `floor'pp_pack.o: In function `S_pack_rec':pp_pack.c:(.text+0x369b): undefined reference to `floor'pp_pack.c:(.text+0x36c3): undefined reference to `floor'collect2: ld returned 1 exit statusmake: *** [miniperl] Error 1

2

make[1]: Entering directory `/data_center_02/User/wucy/soft/perl-5.14.0/dist/IO'cc -c   -DOVR_DBL_DIG=14 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"1.25_04\" -DXS_VERSION=\"1.25_04\"  "-I../.."   IO.cIO.xs: In function 'XS_IO__Poll__poll':IO.xs:249: error: invalid application of 'sizeof' to incomplete type 'struct pollfd'IO.xs:253: error: invalid use of undefined type 'struct pollfd'IO.xs:253: error: dereferencing pointer to incomplete typeIO.xs:255: error: invalid use of undefined type 'struct pollfd'IO.xs:255: error: dereferencing pointer to incomplete typeIO.xs:257: error: invalid use of undefined type 'struct pollfd'IO.xs:257: error: dereferencing pointer to incomplete typeIO.xs:261: error: invalid use of undefined type 'struct pollfd'IO.xs:261: error: dereferencing pointer to incomplete typeIO.xs:262: error: invalid use of undefined type 'struct pollfd'IO.xs:262: error: dereferencing pointer to incomplete typemake[1]: *** [IO.o] Error 1make[1]: Leaving directory `/data_center_02/User/wucy/soft/perl-5.14.0/dist/IO'Unsuccessful make(dist/IO): code=512 at make_ext.pl line 463.make: *** [lib/auto/IO/IO.a] Error 2

3

Can't find extension Encode/Byte in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/CN in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/EBCDIC in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/JP in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/KR in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/Symbol in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/TW in any of cpan dist ext at make_ext.pl line 251.Can't find extension Encode/Unicode in any of cpan dist ext at make_ext.pl line 251.lib/auto/POSIX/POSIX.a(POSIX.o): In function `XS_POSIX_tmpnam':POSIX.c:(.text+0x4614): warning: the use of `tmpnam' is dangerous, better use `mkstemp'lib/auto/Time/HiRes/HiRes.a(HiRes.o): In function `XS_Time__HiRes_clock_nanosleep':HiRes.c:(.text+0xac3): undefined reference to `clock_nanosleep'lib/auto/Time/HiRes/HiRes.a(HiRes.o): In function `XS_Time__HiRes_clock_getres':HiRes.c:(.text+0xc8e): undefined reference to `clock_getres'lib/auto/Time/HiRes/HiRes.a(HiRes.o): In function `XS_Time__HiRes_clock_gettime':HiRes.c:(.text+0xdbe): undefined reference to `clock_gettime'collect2: ld returned 1 exit statusmake: *** [perl] Error 1

转载于:https://www.cnblogs.com/lyon2014/p/4351848.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值