matsumoto-r/ngx_mruby — pull request #1 by cubicdaiya (2012-11-01 16:52:38+00:00)
Title: fix compilation error

The compilation of current master of ngx_mruby fails in my environment.

```bash
$ git clone git://github.com/matsumoto-r/ngx_mruby.git
$ cd ngx_mruby
$ make
・
・
・
objs/addon/../ngx_http_mruby_module.o \
objs/ngx_modules.o \
-lpthread -lcrypt -lm ../../vendors/mrblib/mrblib.o -lm ../../vendors/lib/libmruby.a -lpcre -lcrypto -lcrypto -lz
../../vendors/lib/libmruby.a(math.o): In function `math_erfc':
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/math.c:625: undefined reference to `erfc'
../../vendors/lib/libmruby.a(math.o): In function `math_erf':
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/math.c:607: undefined reference to `erf'
・
・
・
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/numeric.c:458: undefined reference to `floor'
../../vendors/lib/libmruby.a(numeric.o): In function `num_pow':
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/numeric.c:101: undefined reference to `pow'
../../vendors/lib/libmruby.a(numeric.o): In function `flodivmod':
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/numeric.c:253: undefined reference to `fmod'
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/numeric.c:253: undefined reference to `fmod'
/home/bokko/workspace/nginx/ngx_mruby/tmp/mruby/src/numeric.c:253: undefined reference to `fmod'
collect2: ld returned 1 exit status
make[2]: *** [objs/nginx] Error 1
make[2]: Leaving directory `/home/bokko/workspace/nginx/ngx_mruby/tmp/nginx-1.2.2'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/home/bokko/workspace/nginx/ngx_mruby/tmp/nginx-1.2.2'
make: *** [tmp/nginx] Error 2
$
```

There is the cause in config.

```bash
CORE_LIBS="$CORE_LIBS -lm $mruby_root/mrblib/mrblib.o -lm $mruby_root/lib/libmruby.a"
```

GCC finds external symbols used in each objects from back arguments.
So I think that maybe GCC does not try to find external symbols in libmruby.a noted above.

BTW, My environment is following.

* OS
* Linux Mint 13 kernel-3.2.0-32 amd64
* Compiler
* gcc-4.6.3-1ubuntu5