FreeRadius - part2 compilation errors and integrating C++ module into C Radius Stack.

1. make new module makefile to contain following statements.

RLM_LIBS        = $(some_path)//lib/obj.o -lstdc++ -fPIC -mimpure-text -z muldefs

CC=g++

2.  why -mimpure-text and -fPIC required?

“fatal: relocations remain against allocatable but non-writable sections” while using Java native interface/C++ interface/module?

-mimpure-text suppresses the “relocations remain against allocatable but non-writable sections” linker error message. However, the necessary relocations will trigger copy-on-write, and the shared object is not actually shared across processes. Instead of using -mimpure-text, you should compile all source code with -fpic or -fPIC.
the solution seems to be to add the -fpic option to generate position-independent code.

 3. -z muldef will suppress duplicate variable declerations.


more info.
https://www.illumos.org/issues/3336
http://stackoverflow.com/questions/18812584/how-to-solve-fatal-relocations-remain-against-allocatable-but-non-writable-sec
https://isocpp.org/wiki/faq/mixing-c-and-cpp#call-cpp
http://lists.cistron.nl/pipermail/freeradius-devel/2009-July/004774.html

No comments :

Post a Comment