syucream / ts_mruby

Enchant Apache Traffic Server with mruby power.
Apache License 2.0
10 stars 0 forks source link

Build faild #105

Closed kinosang closed 7 years ago

kinosang commented 7 years ago

System Ubuntu 16.04.1 LTS x86_64 (also tried on CentOS 7.2.1511 x86_64)

When we run make,

/usr/bin/ld: ~/mruby/build/host/lib/libmruby.a(variable.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
~/mruby/build/host/lib/libmruby.a: error adding symbols: Bad value

Here's the whole output:

/usr/local/trafficserver/bin/tsxs -I/usr/local/trafficserver//include -I~/mruby//include -L/usr/local/trafficserver//lib -L/usr/local/trafficserver//lib  -L~/mruby/build/host/lib -latscppapi -lmruby -lm -o ts_mruby.so src/ts_mruby_*.cpp src/ts_mruby.cpp
  compiling src/ts_mruby_connection.cpp -> src/ts_mruby_connection.lo
In file included from src/ts_mruby_connection.cpp:7:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_core.cpp -> src/ts_mruby_core.lo
In file included from src/ts_mruby_core.cpp:24:0:
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_eventsystem.cpp -> src/ts_mruby_eventsystem.lo
In file included from src/ts_mruby_eventsystem.hpp:10:0,
                 from src/ts_mruby_eventsystem.cpp:6:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_filter.cpp -> src/ts_mruby_filter.lo
In file included from src/ts_mruby_filter.cpp:7:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_init.cpp -> src/ts_mruby_init.lo
In file included from src/ts_mruby_eventsystem.hpp:10:0,
                 from src/ts_mruby_init.cpp:9:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_internal.cpp -> src/ts_mruby_internal.lo
In file included from src/ts_mruby_internal.cpp:7:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_records.cpp -> src/ts_mruby_records.lo
In file included from src/ts_mruby_records.cpp:8:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_request.cpp -> src/ts_mruby_request.lo
In file included from src/ts_mruby_request.cpp:7:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby_upstream.cpp -> src/ts_mruby_upstream.lo
In file included from src/ts_mruby_upstream.cpp:7:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
src/ts_mruby_internal.hpp:35:20: warning: ¡®TS_MRUBY_PLUGIN_AUTHOR¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_AUTHOR = "Ryo Okubo";
                    ^
src/ts_mruby_internal.hpp:36:20: warning: ¡®TS_MRUBY_PLUGIN_EMAIL¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_EMAIL = "";
                    ^
  compiling src/ts_mruby.cpp -> src/ts_mruby.lo
In file included from src/ts_mruby.cpp:10:0:
src/ts_mruby_internal.hpp:34:20: warning: ¡®TS_MRUBY_PLUGIN_VERSION¡¯ defined but not used [-Wunused-variable]
 const static char *TS_MRUBY_PLUGIN_VERSION = "0.1";
                    ^
  linking -> ts_mruby.so
/usr/bin/ld: ~/mruby/build/host/lib/libmruby.a(variable.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
~/mruby/build/host/lib/libmruby.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
tsxs: link failed: cc -shared -L/usr/local/trafficserver//lib -L/usr/local/trafficserver//lib -L~/mruby/build/host/lib -Wl,-E -L/usr/local/trafficserver//lib -Wl,--rpath=/usr/local/trafficserver//lib -L/usr/local/trafficserver//lib -Wl,--rpath=/usr/local/trafficserver//lib -L~/mruby/build/host/lib -Wl,--rpath=~/mruby/build/host/lib -o ts_mruby.so src/ts_mruby_connection.lo src/ts_mruby_core.lo src/ts_mruby_eventsystem.lo src/ts_mruby_filter.lo src/ts_mruby_init.lo src/ts_mruby_internal.lo src/ts_mruby_records.lo src/ts_mruby_request.lo src/ts_mruby_upstream.lo src/ts_mruby.lo -latscppapi -lmruby -lm -latscppapi -lmruby -lm
Makefile:776: recipe for target 'ts_mruby.so' failed
make: *** [ts_mruby.so] Error 1

And we tried to use docker for kickstart, when we run docker run -it syucream/ts_mruby, it says the input device is not a TTY.

syucream commented 7 years ago

/usr/bin/ld: ~/mruby/build/host/lib/libmruby.a(variable.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC ~/mruby/build/host/lib/libmruby.a: error adding symbols: Bad value

This is because missing fPIC build option to mruby. I've already fixed it by https://github.com/syucream/ts_mruby/issues/106. Can you try latest master branch?

kinosang commented 7 years ago

Now it failed with recipe for target 'all-recursive' failed when we run make.

make  all-recursive
make[1]: Entering directory '~/ts_mruby'
Making all in test
make[2]: Entering directory '~/ts_mruby/test'
make[2]: *** No rule to make target '../googletest/googlemock/src/*.cc', needed by 'gmock-all.o'.  Stop.
make[2]: Leaving directory '~/ts_mruby/test'
Makefile:358: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '~/ts_mruby'
Makefile:299: recipe for target 'all' failed
make: *** [all] Error 2
syucream commented 7 years ago

@kinosang Please do git submodule init && git submodule update before make

kinosang commented 7 years ago

@syucream It works, thank you.