openresty / luajit2

OpenResty's Branch of LuaJIT 2
https://luajit.org/luajit.html
Other
1.24k stars 200 forks source link

fail to build luajit2 at Centos 5.x #4

Closed wendal closed 9 years ago

wendal commented 9 years ago

fail snice v2.1-20150120

cat /etc/issue

CentOS release 5.6 (Final)
Kernel \r on an \m

gcc -v

Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)
==== Building LuaJIT 2.1.0-alpha ====
make -C src
make[1]: Entering directory `/tmp/luajit2/src'
HOSTCC    host/minilua.o
HOSTLINK  host/minilua
DYNASM    host/buildvm_arch.h
HOSTCC    host/buildvm.o
HOSTCC    host/buildvm_asm.o
HOSTCC    host/buildvm_peobj.o
HOSTCC    host/buildvm_lib.o
HOSTCC    host/buildvm_fold.o
HOSTLINK  host/buildvm
BUILDVM   lj_vm.S
ASM       lj_vm.o
CC        lj_gc.o
BUILDVM   lj_ffdef.h
CC        lj_err.o
CC        lj_char.o
BUILDVM   lj_bcdef.h
CC        lj_bc.o
CC        lj_obj.o
CC        lj_buf.o
CC        lj_str.o
CC        lj_tab.o
CC        lj_func.o
CC        lj_udata.o
CC        lj_meta.o
CC        lj_debug.o
CC        lj_state.o
CC        lj_dispatch.o
CC        lj_vmevent.o
CC        lj_vmmath.o
lj_vmmath.c: In function ‘lj_vm_foldfpm’:
lj_vmmath.c:133: warning: implicit declaration of function ‘exp2’
lj_vmmath.c:133: warning: incompatible implicit declaration of built-in function ‘exp2’
lj_vmmath.c:135: warning: implicit declaration of function ‘log2’
lj_vmmath.c:135: warning: incompatible implicit declaration of built-in function ‘log2’
lj_vmmath.c: In function ‘lj_vm_foldfpm’:
lj_vmmath.c:133: warning: implicit declaration of function ‘exp2’
lj_vmmath.c:133: warning: incompatible implicit declaration of built-in function ‘exp2’
lj_vmmath.c:135: warning: implicit declaration of function ‘log2’
lj_vmmath.c:135: warning: incompatible implicit declaration of built-in function ‘log2’
CC        lj_strscan.o
CC        lj_strfmt.o
CC        lj_api.o
CC        lj_profile.o
CC        lj_lex.o
CC        lj_parse.o
CC        lj_bcread.o
CC        lj_bcwrite.o
CC        lj_load.o
CC        lj_ir.o
lj_ir.c:64: error: ‘exp2’ undeclared here (not in a function)
lj_ir.c:64: error: ‘log2’ undeclared here (not in a function)
make[1]: *** [lj_ir.o] Error 1
make[1]: Leaving directory `/tmp/luajit2/src'
make: *** [default] Error 2

I add next 2 lines into lj_arch.h will compile success.

#define LUAJIT_NO_LOG2 1
#define LUAJIT_NO_EXP2 1
wendal commented 9 years ago

uname -a

Linux danoo190.danoo190 2.6.18-238.el5PAE #1 SMP Thu Jan 13 17:10:20 EST 2011 i686 athlon i386 GNU/Linux
wendal commented 9 years ago

so, ngx_openresty-1.7.7.2 and ngx_openresty-1.7.10.1 will fail to build at Centos 5.x

agentzh commented 9 years ago

@wendal This was a known issue that has just been fixed recently :)

Please try out the following tarball on your side. Thank you!

http://openresty.org/download/ngx_openresty-1.7.10.2rc0.tar.gz