Hi All,
I'm having a problem with a dynamically loaded function that uses the
Octave Native interface. caller() is a function with the DEFUN_DLD
entry point that eventually uses dlopen() to dynamically load another
shared library to do its work.
Output
octave:1> caller
--Progress: in caller.cpp, about to load libtest--
Error in dlopen(): /home/ma20121/vmul/manager/libtest.so: R_PPC_REL24
relocation at 0x0e985054 for symbol `strncpy' out of range
After looking up PowerPC errors I've learned that it can usually be
avoided by compiling with the -fPIC flag (force position independent
code) which forces external function calls to use absolute instead of
relative branches within the compiled instructions.
My problem is that I am compiling all of my code with -fPIC to ensure
this error does not arise. Has anyone worked with Octave on the
PowerPC before and had a relocation error like this?
Here is my build sequence:
g++ -fPIC -shared -o libtest.so test.cpp
(these next two lines are just mkoctfile caller.cpp -v)
g++ -c -fPIC -I/home/ma20121/octave-install/include/octave-2.9.5
-I/home/ma20121/octave-install/include/octave- 2.9.5/octave
-I/home/ma20121/octave-install/include -g -O2 caller.cpp -o caller.o
g++ -shared -Wl,-Bsymbolic -o caller.oct caller.o
-L/home/ma20121/octave-install/lib/octave-2.9.5 -loctinterp -loctave
-lcruft -lreadline -lncurses -ldl
-L/usr/lib/gcc-lib/ppc64-yellowdog-linux/3.2.3
-L/usr/lib/gcc-lib/ppc64-yellowdog-linux/3.2.3/../../../../lib
-L/usr/lib/gcc-lib/ppc64-yellowdog-linux/3.2.3/../../.. -L/lib/../lib
-L/usr/lib/../lib -lz -lfrtbegin -lg2c -lm -lgcc_s
This is a very strange error, but if anyone has any PowerPC and Octave
experience, any help would be greatly appreciated!
Thank You,
Matt
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave