Gentooインストールファイルをインストールする †
Gentooベースシステムのインストール †
- GLIBCのロケール
landisk / # mkdir -p /etc/portage
landisk / # echo "sys-libs/glibc userlocales" >> /etc/portage/package.use
/etc/locales.build へ下記を追加
en_US/ISO-8859-1
en_US.UTF-8/UTF-8
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15
ja_JP.EUC-JP/EUC-JP
ja_JP.UTF-8/UTF-8
ja_JP/EUC-JP
- Native POSIX Threading Library (NPTL) を指定
- /etc/make.conf に下記を追加
USE="nptl"
コメント欄 †
- 勝手ながらコメント欄つけました。stage1はstage2,stage3+αを経由する必要があります。オフィシャルのハンドブックを参考にしていただけると幸いです。rebootする前にchrootして環境を構築するカタチになります。 -- matsuu?
- sh用ハンドブックは用意できてませんが、ほぼx86のハンドブックに従えば構築できるはずです(kernelはsh-sourcesで読み替え、bootloaderはまだ用意できてません)。 -- matsuu?
- それらしきドキュメントをみつけました。「5. Gentooインストールファイルをインストールする」この手順に沿ってやってみます。 -- 管理人?
- nptlはUSEフラグで設定可能です。/etc/make.confにUSE="nptl"を追加してやればnptlでコンパイルされます。 -- matsuu?
- ひと段落したら、matsuuさんの使っているmake.confを公開してくだりませんか?gentoo素人の私にとっては、自由度が大きすぎて制御しきれないのです。汗 -- 管理人?
- 何のオプションもつけずほぼデフォルト状態です。make.conf -- matsuu?
#comment
↓過去のメモ †
こける。
terminal.o: In function `terminal_goto_xy':
terminal.c:(.text+0x90): undefined reference to `tgoto'
terminal.c:(.text+0x98): undefined reference to `tputs'
terminal.o: In function `terminal_clear_to_eol':
terminal.c:(.text+0x194): undefined reference to `tputs'
terminal.o: In function `terminal_clear_screen':
terminal.c:(.text+0x1f4): undefined reference to `tputs'
terminal.o: In function `terminal_up_line':
terminal.c:(.text+0x254): undefined reference to `tputs'
terminal.o: In function `terminal_down_line':
terminal.c:(.text+0x2b4): undefined reference to `tputs'
terminal.o:terminal.c:(.text+0x314): more undefined references to `tputs' follow
terminal.o: In function `terminal_delete_lines':
terminal.c:(.text+0x4c0): undefined reference to `tgoto'
terminal.c:(.text+0x4c4): undefined reference to `tputs'
terminal.o: In function `terminal_insert_lines':
terminal.c:(.text+0x580): undefined reference to `tgoto'
terminal.c:(.text+0x584): undefined reference to `tputs'
terminal.o: In function `terminal_get_screen_size':
terminal.c:(.text+0x77c): undefined reference to `tgetnum'
terminal.o: In function `terminal_initialize_terminal':
terminal.c:(.text+0x904): undefined reference to `tgetent'
terminal.c:(.text+0x954): undefined reference to `tgetstr'
terminal.c:(.text+0x95c): undefined reference to `BC'
terminal.c:(.text+0x960): undefined reference to `PC'
terminal.c:(.text+0x974): undefined reference to `ospeed'
terminal.c:(.text+0xbc0): undefined reference to `ospeed'
terminal.c:(.text+0xc18): undefined reference to `tgetstr'
terminal.c:(.text+0xc64): undefined reference to `tgetflag'
terminal.o: In function `terminal_prep_terminal':
terminal.c:(.text+0xe54): undefined reference to `tputs'
terminal.o: In function `terminal_unprep_terminal':
terminal.c:(.text+0xf68): undefined reference to `tputs'
collect2: ld returned 1 exit status
make[3]: *** [ginfo] Error 1
make[3]: Leaving directory `/var/tmp/portage/texinfo-4.8-r1/work/texinfo-4.8/info'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/texinfo-4.8-r1/work/texinfo-4.8/info'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/texinfo-4.8-r1/work/texinfo-4.8'
make: *** [all] Error 2
下記configureのワーニングが原因?
/usr/lib/下ライブラリを見に行ってくれないような気がする。
checking build system type... sh4-unknown-linux-gnu
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lterminfo... no
configure: WARNING: probably need a terminal library, one of: ncurses curses termlib termcap terminfo
解析 †
- エラーログ詳細
configure:6388: checking for tgetent in -lcurses
configure:6418: sh4-unknown-linux-gnu-gcc -o conftest -O2 -m4 conftest.c -lcurses >&5
/lib/libcurses.so: undefined reference to `__fpscr_values@GLIBC_2.2'
collect2: ld returned 1 exit status
configure:6424: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "GNU Texinfo"
| #define PACKAGE_TARNAME "texinfo"
| #define PACKAGE_VERSION "4.8"
| #define PACKAGE_STRING "GNU Texinfo 4.8"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "texinfo"
| #define VERSION "4.8"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define STDC_HEADERS 1
| #define HAVE_FCNTL_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_PWD_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_TERMCAP_H 1
| #define HAVE_TERMIO_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_FCNTL_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_WAIT_H 1
| #define GWINSZ_IN_SYS_IOCTL 1
| #define RETSIGTYPE void
| #define HAVE_DECL_MEMCHR 1
| #define HAVE_DECL_STRCOLL 1
| #define HAVE_DECL_STRERROR 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_STRCOLL 1
| #define HAVE_VPRINTF 1
| #define HAVE_BZERO 1
| #define HAVE_GETCWD 1
| #define HAVE_MEMSET 1
| #define HAVE_SETVBUF 1
| #define HAVE_SIGACTION 1
| #define HAVE_SIGPROCMASK 1
| #define HAVE_SIGSETMASK 1
| #define HAVE_STRCHR 1
| #define HAVE_MEMCPY 1
| #define HAVE_MEMMOVE 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRNCASECMP 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char tgetent ();
| int
| main ()
| {
| tgetent ();
| ;
| return 0;
| }
ちなみに __fpscr_values は何処にあるかというと。。
debian26上でgccを "-v" オプション付で実行し、リンクしてるLibを全部表示させてみる。
そして、全てのLibを nm コマンドでなめて、__fpscr_valuesを探す。
landisk:~# gcc -v -o conftest -O2 -m4 conftest.c -lcurses
省略…
/usr/lib/gcc/sh4-linux/3.4.4/collect2 --eh-frame-hdr -m shlelf_linux
-dynamic-linker /lib/ld-linux.so.2 -o conftest
/usr/lib/gcc/sh4-linux/3.4.4/../../../crt1.o
/usr/lib/gcc/sh4-linux/3.4.4/../../../crti.o
/usr/lib/gcc/sh4-linux/3.4.4/crtbegin.o
-L/usr/lib/gcc/sh4-linux/3.4.4
-L/usr/lib/gcc/sh4-linux/3.4.4
-L/usr/lib/gcc/sh4-linux/3.4.4/../../..
/tmp/cciAIf9t.o
-lcurses
-lgcc --as-needed -lgcc_s
--no-as-needed -rpath-link /lib:/usr/lib -lc -lgcc
--as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/sh4-linux/3.4.4/crtend.o
/usr/lib/gcc/sh4-linux/3.4.4/../../../crtn.o
landisk:~# nm /usr/lib/gcc/sh4-linux/3.4.4/../../../crt1.o
0000002c t L_abort
00000024 t L_fini
00000020 t L_init
00000028 t L_libc_start_main
0000001c t L_main
00000000 R _IO_stdin_used
00000000 D __data_start
00000004 D __fpscr_values
U __libc_csu_fini
U __libc_csu_init
U __libc_start_main
00000000 T _start
U abort
00000000 W data_start
U main
debian26では、/usr/lib/crt1.o に含まれることが判明。
gentooの /usr/lib/crt1.o には、、、、存在するな〜!あれ?
ちなみに、crt1.o は、glibc の一部。
gentooでも同じように、"-v" オプション付で実行してみる。
landisk ~ # sh4-unknown-linux-gnu-gcc -v -o conftest -O2 -m4 conftest.c -lcurses
省略…
/usr/libexec/gcc/sh4-unknown-linux-gnu/3.4.4/collect2 --eh-frame-hdr -m shlelf_linux
-dynamic-linker /lib/ld-linux.so.2 -o conftest
/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/../../../crt1.o
/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/../../../crti.o
/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/crtbegin.o
-L/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4
-L/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4
-L/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/../../../../sh4-unknown-linux-gnu/lib
-L/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/../../.. /tmp/cccNCZOg.o
-lcurses -lgcc -lgcc_eh -rpath-link /lib:/usr/lib -lc -lgcc -lgcc_eh
/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/crtend.o
/usr/lib/gcc/sh4-unknown-linux-gnu/3.4.4/../../../crtn.o
/lib/libcurses.so: undefined reference to `__fpscr_values@GLIBC_2.2'
collect2: ld returned 1 exit status
どうやら、__fpscr_values は存在するが、名前の解決ができないらしい。
/lib/libcurses.so ってことは、ダイナミックライブラリ側に解決手段を持っているのかな〜?よ〜わからん!!
debian26でlibcの実体 /lib/libc-2.3.5.so をチェック。
landisk:~# objdump -T /lib/libc-2.3.5.so | grep fpscr
001164c8 w DO .data 00000008 GLIBC_2.2 __fpscr_values
gentooでも、同様にチェック。
landisk ~ # objdump -T /lib/libc-2.3.5.so | grep fpscr
存在しない。。。きっと、これだな!
- matsuuさんへ
下記にdebian26で使っているglibc-2.3.5用パッチを置いています。
もし宜しければ、確認してみてもらえないでしょうか?
http://eggplant.ddo.jp/www/download/debian26/source/glibc/additional-patch/
- その後の調査で…
glibcは正しいような気がしてきました。1st-stageのラベルミスマッチの原因は、推測ですが、
gentoo以外の環境でビルドしたライブラリをパッケージングしているからかも?
- その他
- glibc-cvsでは、
GLIBC_PRIVATE __fpscr_valuesになっているようです。
debian26ではGLIBC_2.2となっていますが、これは間違いのようです。
これは今後深刻な問題に発展するかもしれない!!。
debian26(FC2や3も)の環境を使っている限り無問題ではあるけれど…
- 多分下記パッチでOK!
--- glibc-2.3.5/sysdeps/sh/sh4/Versions~ 1970-01-01 09:00:00.000000000 +0900
+++ glibc-2.3.5/sysdeps/sh/sh4/Versions 2005-01-12 11:58:13.000000000 +0900
@@ -0,0 +1,5 @@
+ld {
+ GLIBC_PRIVATE {
+ __fpscr_values;
+ }
+}
--- glibc-2.3.5/sysdeps/sh/dl-machine.h~ 2004-10-26 04:04:03.000000000 +0900
+++ glibc-2.3.5/sysdeps/sh/dl-machine.h 2005-10-13 22:07:08.000000000 +0900
@@ -459,6 +459,12 @@ _dl_start_user:\n\
.long _rtld_local@GOT\n\
.L_dl_fini:\n\
.long _dl_fini@GOT\n\
+ .type __fpscr_values,@object\n\
+ .global __fpscr_values\n\
+__fpscr_values:\n\
+ .long 0\n\
+ .long 0x80000\n\
+ .weak __fpscr_values\n\
.previous\n\
");
旧コメント欄 †
- あれ?ダメですか?なんでだろう... -- matsuu?
- __fpscr_values@GLIBC_2.2が解決できないみたいです。どうやって対策するんだったけかな?思い出せない。。。 -- 管理人?
- stage1ファイルの生成はgentooネイティブで実施しているんですが...うーん。stage2も用意してみたのですがいかがでしょうか?すんません。 -- matsuu?
- あ、だめかも... -- matsuu?
- stage2でもダメっぽいです。objdunpやmnを駆使して、
「GLIBC_2.2 __fpscr_values」となっているライブラリをgentoo環境でリビルドすれば、その世界で閉じた環境が作れると思います。 ←嘘かも 結果的に、SH-LinuxのFC版やウチのdebian26版と非互換になってしまうかもしれませんが、それが本来あるべき姿だと思います。debian26も将来的には修正しなければ…。問題を気付かせて頂き、ありがとうございます。 -- 管理人?
- stage1-sh4-20050712.tar.bz2は__fpscr__values@GLIBC_2.2が含まれています。20050712は自分もそこから構築した実績があるので大丈夫だと思います。 -- matsuu?
- そのglibcは何処の物ですか?debian26の物?もしそうなら、glibcを固定(ビルド対象から除外)すれは、、それでうまく行きそうです。ところで、gentooの方針として、glibc(__fpscr__values)はどうしますか?debian26では、memo/__fpscr_valuesの方針で行こうと思っていますが。 -- 管理人?
- gentooにはfedoraの__fpscr__valuesパッチを取り込んでたつもりですが、どこかでうまく行ってなかったようです。正直なところ私自身はよくわかってないので判断できないのですが、追随する方向で検討してみます。 -- matsuu?
- /usr/portage/sys-libs/glibc/files/digest-glibc-2.3.5.20050722で参照されるglibc-2.3.5-branch-update-20050722.patch.bz2には、__fpscr_valuesのパッチが含まれていますね。もしこれを使用しているのなら問題なさそうです。 -- 管理人?
#comment