libsqlite3.so ãå·®ãæ¿ãã
ã¡ãã£ã¨èãããã®ã§èª¿ã¹ã¦ã¿ãã
ç®ç
ãªãªã¸ãã« libsqlite3.so.0 ãå®è£
ããã®ã§ãããã /module/libsqlite3.so.0 ã¨ãã Python ãã使ããããã«ãããã
Python ã§
import sqlite3
ã¨ããã¨æçµçã« /usr/lib/python2.7/lib-dynload/_sqlite3.so ãèªã¾ããã®ã§ã
ldd _sqlite3.so
ã¨ããã¨ãã« libsqlite3.so.0 ã /module/libsqlite3.so.0 ãæãããã«ããã°ããã
æ®éãªã
åçã©ã¤ãã©ãªãªãã ãã LD_LIBRARY_PATH ãè¨å®ããã®ãã¾ãã¯å¸¸èã
LD_LIBRARY_PATH=/module
ãããå¤ãããªãã
RPATH
å®ã¯ _sqlite3.so ã«ã¯ RPATH ã¨ããæ
å ±ãæ¸ããã¦ãã¦ããããåçã©ã¤ãã©ãªã®å ´æã示ãã¦ããã
manpage dlopen(3) ãèªãã§ãããã¨ãããããåçã©ã¤ãã©ãªã¯ã¾ããã® RPATH ãæ¤ç´¢ããããã«ããã°ããã使ãã
LD_LIBRARY_PATH ãèªã¾ããã®ã¯ãã®æ¬¡ã®åªå
é ä½ãªã®ã§ããã
ãããã£ã¦ããã®å ´å LD_LIBRARY_PATH ã¯æ©è½ããªãã
RPATH ãæ¶ã
以ä¸ã®æ
å ±ã¯å¤åã« Frank's Geo-Geeking: RPATH, RUNPATH and LD_LIBRARY_PATH ãåèã«ãã¦ããã
RPATH æ
å ±ã¯ chrpath(8) ã«ããè¦ããã¨ãã§ããã
chrpath /usr/lib/python2.7/lib-dynload/_sqlite3.so /usr/lib/python2.7/lib-dynload/_sqlite3.so: RPATH=/usr/lib/i386-linux-gnu
ããã§æ°ä»ããã
ã_sqlite3.so ã® RPATH ããªããã¼ã¸ã§ã³ãä½ããããã Python ããèªãããã«ããã°ï¼ã
cp /usr/lib/python2.7/lib-dynload/_sqlite3.so /module/_sqlite3.so chrpath --delete /module/_sqlite3.so export LD_LIBRARY_PATH=/module ldd /module/_sqlite3.so
ãã㧠/module/_sqlite3.so ã /module/libsqlite3.so.0 ãèªãããã«ãªã£ã¦ãããã
ãã¡ãã Python ãã使ãã¨ãã«ã¯
export PYTHONPATH=/module
ãå¿ããã«ã
ã¡ãªã¿ã«
libpthread.so.0 ã§ã¯ãããªåé¡ã¯èµ·ããªããã¨ããã®ããlibpthread.so.0 㯠RPATH ã§æå®ããããã£ã¬ã¯ããªã§ã¯ãªãã¨ããã«ããããã§ããã
ãã®åé¡ã¯ SQLite3 ã¢ã¸ã¥ã¼ã«ã Python çµè¾¼ã¿ã§ãããã¨ã«ãã£ã¦ããã®ã§ã¯ãªãã ãããã