[pgsql-jp: 38644] Postgresqlのrpm作成について
tamotsu sohara
soara @ agate.plala.or.jp
2007年 8月 11日 (土) 09:26:53 JST
曽原と申します。
Postgresqlのrpmを作成しようとしているのですが
うまくいきません。
どなたか解決方法をわかる方がいたら教えてください。
よろしくお願いします。
【対象環境について】
os : CentoOS 5 FINAL
gcc : 4.1.1
postgres : 8.2.4
【作成手順】
1.root以外のユーザでpostgresql.orgより
postgresql-8.2.4-1PGDG.src.rpm入手
2.root以外のユーザでrpm -i postgresql-8.2.4-1PGDG.src.rpmでファイルを展開
3.root以外のユーザでrpmbuild -ba postgresql-8.2.specでrpm作成
最初は以下のメッセージがでたので
configure: error: thread test program failed
This platform is not thread-safe. Check the file 'config.log'for the
exact reason.
You can use the configure option --enable-thread-safety-force to force
threads to be enabled. But you must then run the program in
src/test/thread and add locking function calls to your applications to
guarantee thread safety.
rpmbuild -ba postgresql-8.2.specの
configure option --enable-thread-safety-forceを追加して
rpmbuild -ba postgresql-8.2.spec実行したら上記エラーは消えましたが
ここでエラーが発生
【エラー内容】
gcc -I../../include -I../../../../../src/interfaces/ecpg/include -I../../../../../src/interfaces/libpq -I../../../../../src/include -D_GNU_SOURCE -I/usr/include -O2 -g -march=i386 -mcpu=i686 -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS test1.c -L../../ecpglib -L../../pgtypeslib -L../../../../../src/port -L/usr/lib -lecpg -lpgtypes -L../../../../../src/interfaces/libpq -lpq -lpgport -lpam -lssl -lcrypto -lkrb5 -lz -lreadline -ltermcap -lcrypt -ldl -lm -o test1
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
../../ecpglib/libecpg.so: undefined reference to `pthread_key_create'
../../../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_sigmask'
../../ecpglib/libecpg.so: undefined reference to `pthread_once'
../../ecpglib/libecpg.so: undefined reference to `pthread_getspecific'
../../ecpglib/libecpg.so: undefined reference to `pthread_setspecific'
collect2: ld はステータス 1 で終了しました
make[5]: *** [test1] エラー 1
make[5]: ディレクトリ `/home/niigatalinux/rpm/BUILD/postgresql-8.2.4/src/interfaces/ecpg/test/connect' から出ます
make[4]: *** [all] エラー 2
make[4]: ディレクトリ `/home/niigatalinux/rpm/BUILD/postgresql-8.2.4/src/interfaces/ecpg/test' から出ます
make[3]: *** [all] エラー 2
make[3]: ディレクトリ `/home/niigatalinux/rpm/BUILD/postgresql-8.2.4/src/interfaces/ecpg' から出ます
make[2]: *** [all] エラー 2
make[2]: ディレクトリ `/home/niigatalinux/rpm/BUILD/postgresql-8.2.4/src/interfaces' から出ます
make[1]: *** [all] エラー 2
make[1]: ディレクトリ `/home/niigatalinux/rpm/BUILD/postgresql-8.2.4/src' から出ます
make: *** [all] エラー 2
エラー: /var/tmp/rpm-tmp.28914 の不正な終了ステータス (%build)
RPM ビルドエラー:
/var/tmp/rpm-tmp.28914 の不正な終了ステータス (%build)
なにかpthreadxxxxxの関数がないと言っているようなのですが
その他のようにソースから実行するとエラーになりません。
どこを直せばよいのでしょうか。
また、--enable-thread-safety-forceが悪いのでしょうか。
【その他】
ソースpostgresql-8.2.4.tar.gzを入手して
gunzip postgresql-8.2.4.tar.gz
tar xvf postgresql-8.2.4.tar
mv postgresql-8.2.4 /usr/local/src/postgresql
./configre
make
make install
で正常に終了されます。
./configreの中でtest1.cはコンパイルエラーにならない。
gcc -I../../include -I../../../../../src/interfaces/ecpg/include -I../../../../../src/interfaces/libpq -I../../../../../src/include -D_GNU_SOURCE -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing test1.c -L../../ecpglib -L../../pgtypeslib -L../../../../../src/port -Wl,-rpath,'/usr/local/pgsql/lib' -lecpg -lpgtypes -L../../../../../src/interfaces/libpq -lpq -lpgport -lz -lreadline -ltermcap -lcrypt -ldl -lm -o test1
ここまで。
-----------------------------------------------
曽原 保 <soara @ agate.plala.or.jp>
-----------------------------------------------
pgsql-jp メーリングリストの案内