Belphegor の巣窟 - Cross Compiler From Scratchって名付けてみるテスト - mipselなマシン用


export TARGET=mipsel-elf-linux
export ARCHIVE=/xgcc/archive
export SOURCE=/xgcc/src
export BUILD=/xgcc/build
export TOOLS=/xgcc

mkdir -p $ARCHIVE $SOURCE $BUILD

binutils 2.15 (ftp://ftp.iij.ad.jp/pub/GNU/binutils/binutils-2.15.tar.gz)

cd $SOURCE
tar zxvf $ARCHIVE/binutils-2.15.tar.gz
mkdir $BUILD/binutils
cd $BUILD/binutils
$SOURCE/binutils-2.15/configure --target=$TARGET --prefix=$TOOLS/$TARGET
make all
make install
PATH=$PATH:$TOOLS/$TARGET/bin
export PATH

Linux カーネルの準備 (http://pserver.sbc.co.jp/pserver/source/linux-2.4.17-HG01S.tar.gz)

cd $SOURCE
tar zxvf $ARCHIVE/linux-2.4.17-HG01S.tar.gz
cd linux
make menuconfig
(そのまま Exit で終了する。"Do you wish to save your new kernel configuration?" は No と答える)
echo "$TARGET-" > .hhl_cross_compile
make dep
(includeだけを用意する)

gcc 3.3.4 (仮版) (ftp://ftp.iij.ad.jp/pub/GNU/gcc/gcc-3.3.4/gcc-core-3.3.4.tar.gz)

cd $SOURCE
tar jxvf $ARCHIVE/gcc-core-3.3.4.tar.bz2
mkdir $BUILD/gcc
cd $BUILD/gcc
$SOURCE/gcc-3.3.4/configure --target=$TARGET --prefix=$TOOLS/$TARGET --enable-languages="c" --with-gnu-as --with-gnu-ld --disable-threads --disable-shared
# --enable-shared --disable-threads --with-newlib
make all
make install

glibc 2.2.5 (ftp://ftp.iij.ad.jp/pub/GNU/glibc/glibc-2.2.5.tar.gz, ftp://ftp.iij.ad.jp/pub/GNU/glibc/glibc-linuxthreads-2.2.5.tar.gz)

cd $SOURCE
tar zxvf $ARCHIVE/glibc-2.2.5.tar.gz
cd glibc-2.2.5
tar zxvf $ARCHIVE/glibc-linuxthreads-2.2.5.tar.gz
mkdir $BUILD/glibc
cd $BUILD/glibc
CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib $SOURCE/glibc-2.2.5/configure --host=$TARGET --with-headers=$SOURCE/linux/include --enable-add-ons --prefix=$TOOLS/$TARGET/$TARGET
# error: parse error before "__thread"
# sprintf.c:37: error: `va_start' used in function with fixed args
# sscanf.c:37: error: `va_start' used in function with fixed args
# ../sysdeps/unix/sysv/linux/errlist.c:41: error: weak declaration of `_old_sys_nerr' must precede definition
# ../sysdeps/mips/dl-machine.h:396:9: missing terminating " character
# dl-runtime.c: In function `__dl_runtime_resolve':
# dl-runtime.c:229: error: assignment of read-only location
# internals.h:555: error: parse error before "__thread" への対策
pushd $SOURCE/glibc-2.2.5
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 glibc-mipsel-patch-2.2.5.patch.bz2
QlpoOTFBWSZTWcOnR1QACFFfgHowbP//+3//3/6////4YAs8fNs13WlxTsHK
5BOc6KpWhkoUAGzBJERGTU9Kek/VN6nqYk8iNM0GjRPSBoZqA9QGTQAShATI
yE0g0kP0p6j1AA0YQZG1AaBkD1NNDmjRoaYQDTAmmgDIaGIA0YjQwRkAEmpQ
Q1CbUNGjR6TRoMQAAGgZNGgaGgaDmjRoaYQDTAmmgDIaGIA0YjQwRkAEiITQ
ImExIxKe1MCnpqep6jygHqAB6hoAaC4MUkRATSAQJQcPBuVZ0hl1MBZWly6K
qg5l3v3zeiqiK3BfiomoGwzcJTEYZKSYMwzcG/w+askyZ9GGEtf8aFMs8tVG
Nw31dY2tlgwmfAqcZinMC1t1m2wspgcceKY3euAsSMWXhFxt03Vq8MIMJSR3
CQMSQ+TQcg8ZgiMxFmEMVoUtTvftuosgptKnSdv5X7g+sfg5D2dANbwCjhrb
sxj2czaOiXTgY4zVOTWK0tQwTNygo17hi8Xl0zRcYniFxo9YHH4nwh75+Mso
OGB09ABwAg7hbmgeGHJpxVXAem21EZtBHRfvmoZeVd+pOUUbrL7l0mlmIEkL
GMVER4yyGXtx4YyYdHVxQ7H3tbN4KuxWaKNJDueOIxgT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AZX7
ih+hvkO2sAQI8nQ5J7Lb9O7aVJ8MxcA7lyCqjioxFAbgDyAXOJYUDBQgY0Pg
burA8W7uEbqbV3QQ2mp7Gy5DGlIQlYVosKZoYISRkeJlulcdTPakZpaCLgDO
guy4qCMQS2DDPD4ZFEirA4rNKzAerijCIpMQh9dnQpya9ZyOW05BvDgDA1RA
EAcS45yQtNqYoANnUxevtmttkrsRv4L2d9AmjpSgdNhcOQ0uu8IltEmSWdwG
WAa3vz7wHZBLRYBZmOQ9rqEsUoyrwCqGxVUDE2oqcmlAzDi5mY75IBWeP3zD
iiS5XK5axAxwMWpJK3EF4FUCEwJRRo6DLGiBYhkMVloVSXqaNo0KWxNPmioq
FkSAoMjIGQJiwyaecZbVU1TGOIF3SuIdL2FQSJVCgiU0GWjyvNnljAfuA9J8
dtw+hh1FlTfDLihzgZuWZsm5XD0MSBqKnEEbQNMC94NnBcZDyDBsZeFzYr8w
MAP6XElIKmJw6xz76ZnZQJlCDIjM/+LuSKcKEhh06OqA
====
EOF
popd
make all
make install

gcc 3.3.4 (本バージョン) (ftp://ftp.iij.ad.jp/pub/GNU/gcc/gcc-3.3.4/gcc-3.3.4.tar.gz)

cd $SOURCE
tar zxvf $ARCHIVE/gcc-3.3.4.tar.gz
mkdir $BUILD/gcc
cd $BUILD/gcc
$SOURCE/gcc-3.3.4/configure --enable-languages="c,c++" --target=$TARGET --prefix=$TOOLS/$TARGET --disable-shared --disable-threads
make all
make install

Linux カーネルの準備 (http://pserver.sbc.co.jp/pserver/source/linux-2.4.17-HG01S.tar.gz)
# カーネルヘッダのインストール

cd $SOURCE/linux
cp -Rv include/asm-mips $TOOLS/$TARGET/$TARGET/include
mv $TOOLS/$TARGET/$TARGET/include/asm-mips $TOOLS/$TARGET/$TARGET/include/asm
cp -Rv include/linux $TOOLS/$TARGET/$TARGET/include

## ここからアプリケーション構築

busybox 0.60.3 -> coreutils 5.2.1 (ftp://ftp.iij.ad.jp/pub/GNU/coreutils/coreutils-5.2.1.tar.bz2)
# フラッシュメモリなどのように容量の少ないストレージではないので

cd $SOURCE
tar xvjf $ARCHIVE/coreutils-5.2.1.tar.bz2
mkdir $BUILD/coreutils
cd $BUILD/coreutils
# uptimeが失敗するのでjm_cv_have_proc_uptime=yesを強制
jm_cv_have_proc_uptime=yes CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib $SOURCE/coreutils-5.2.1/configure --prefix=/usr --host=$TARGET
make all
find . -type f -and -perm +u+x | xargs --max-args=1 $TARGET-strip -g
mkdir -p $SOURCE/targetroot/usr
# 仮想ルートへインストール
make install prefix=$SOURCE/targetroot/usr
# 不要なファイルを削除
pushd $SOURCE/targetroot
rm -fR usr/info usr/man usr/share
popd
# あとは $SOURCE/targetroot 以下を実機へ転送する。

# galileo では /bin/ 以下にユーザランドのアプリケーションがいろいろいるのでいったん削除
/usr/bin/rm -f /bin/chgrp /bin/chown /bin/chmod /bin/cp /bin/dd /bin/ln /bin/ls /bin/mkdir
/usr/bin/rm -f /bin/mknod /bin/mv /bin/readlink /bin/rm /bin/rmdir /bin/sync /bin/touch
/usr/bin/rm -f /bin/cat /bin/date /bin/echo /bin/false /bin/hostname /bin/kill /bin/pwd
/usr/bin/rm -f /bin/sleep /bin/true
# 念のためシンボリックリンク
for binname in chgrp chown chmod cp dd ln ls mkdir mknod mv readlink rm rmdir \
sync touch cat date echo false hostname kill pwd sleep true; do ln -s /usr/bin/$binname /bin/$binname; done

zlib 1.1.4 -> 1.2.1-dospatch (http://www.gzip.org/zlib/zlib-1.2.1.tar.gz)

cd $SOURCE
tar xvzf $ARCHIVE/zlib-1.2.1.tar.gz
cd zlib-1.2.1
# DOS攻撃対策パッチ (infback.c, inflate.c)
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 zlib-1.2.1-d.o.s.patch.bz2
QlpoOTFBWSZTWSvhJT4AASBfgEIyQH//e3UBEAC/795SQAG8AAYAAaAAMmgA
ADQGAAGgADJoAAA0BgABoAAyaAAANAFUSCaYhNTaDIyhkw1HpGJmp6lhnL0U
eBaojkrbGlU2s61WsZWVKitEYpREXlEO1vfh8N7SbWha2Zlf5fKVTBU4NbBa
o+Fi9kWOrVM9vGZ6Drb2LBrLEdQvJUR9u5OBW7q37FPDplc0oS6or6xgPa2Z
mZnmNz7uy1KU3DFVGeo8iTxMSh5ueObUaVQyHkpYmbbsE2lJGgrW3pYqsytT
GylzBfbknnTF12WqFd3nKZp3uh2OZuSXodxRsfpwVOCVqjE+rcjc9FSHue48
S97NqjcKj4eqt7JVsr5Q1PQZkRxWFTiuYGhoSoSlElzIN61cyno4Di/z1NLO
Zn0dbkMzUra0lqFTK1JR3pc6tyJYJMy8wdKWxrSlpYs6ixUhciLnQwURYMrk
/4u5IpwoSBXwkp8A
====
EOF
CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib CFLAGS=-O2 ./configure --shared --prefix=/usr
# libz.a が作成されない不具合への対応
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 Makefile.patch.bz2
QlpoOTFBWSZTWXcrKe0AAIpfgAAwRW//8XA3mAC/75cUMAD2UGNDQ0AGQ0AA
AAAGoyAmo2iGhiaA0A0AAJRCp6n6jKemm1RmowDRMhifpB6R7lcAl9N0ygqZ
LCtgApDhV5MHRXUfPKOzVySJP9gjh+XvggJYqa1sQNiZE/LaGVUivS0ZiF5B
tNBNUtiPUcEb1uaLC/Yah5wafdZvwkAcKapm628axxOPYEA8LtxMgJSgKATo
nvDZQydcFhSO/1t9wnjr1CJEea5Gm05RE6bhI/4caXiMF0zpkGRB/guQvJ8c
Q6SCXZ/CIMJDnoTeBoWg6YLg0UKUwkN3mCtRtBfV3cEl8i7kinChIO5WU9o=
====
EOF
make all libz.a
mkdir -p $SOURCE/targetroot/usr
make install prefix=$SOURCE/targetroot/usr
# リンクライブラリのインストール
cp libz.a $TOOLS/$TARGET/$TARGET/lib
# ヘッダファイルのインストール
mv $SOURCE/targetroot/usr/include/* $TOOLS/$TARGET/$TARGET/include
# 不要なファイルを削除
rm -fR $SOURCE/targetroot/usr/share/man
# 例によって $SOURCE/targetroot 以下を実機へ転送する。

busybox 0.60.3 -> util-linux 2.12i (ftp://ftp.kernel.org/pub/linux/utils/util-linux/util-linux-2.12i.tar.bz2)

cd $SOURCE
tar xvjf $ARCHIVE/util-linux-2.12i.tar.bz2
cd util-linux-2.12i
CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib ./configure --prefix=/usr --host=$TARGET
# クロスコンパイル用の修正 (MCONFIG)
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 MCONFIG.patch.bz2
QlpoOTFBWSZTWdkFqyoAAEXfgAIwXP//+mvj2wC/797kMAFqZTBqekaqfpMU
9PVNA9TGo9QGgeiNlMQeImgaJo1U/TEpsoeFMmTIAZB6g00BgBKmQEoPanqJ
5T1BoBoAGQAbRNCGvtu6IqW2vSHwQ2W0sB1QmpEmDqo+1uoPzHEQaLiFvDgg
r2xcLq/lFhKHAkA/jgrrlq3MecDk+YdXXLiwQwkXkO1O4kd+7fPkmHXEwiG7
bjEebp5L/OkTiWrQMP8GuEA6abwZm31Oe0Uexw1AVg45BwtGL1yBcQcHiwIq
1tGkRpgsnllNeNHDVVxFiCYq5v6yZPYSFICPLW5O/lRMph384tt0W3szC+sI
aby8+2RvEzlDQPHfig9jTAC6crtXYqINqJIG32WrSQNPPweTvwgsk1pC9dUP
T3R/GsdcRD7iqM1ESpP1Kp/NTeGb641g6krq1ELmbnaSHWqpIwUcR2iBYxxZ
dmwxBMQmshkEaiQk1f6MJsg/QqJY2UquB4iORyhpMMXrDqdObgcC5Wz2ORSi
UZEKltJXGe7TSpU84ZBs8jpHDFaCeHsMJO0MoYLUYFEYzNEwrj/t3i7kinCh
IbILVlQ=
====
EOF
# mkfs.c:39: error: `NAME_MAX' undeclared (first use in this function)
# column.c:288: error: `LINE_MAX' undeclared (first use in this function)
# への対応 (disk-utils/mkfs.c, text-utils/column.c)
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 mkfs.column.patch.bz2
QlpoOTFBWSZTWc8jUyQAAN5fgAIwWA//9UIln0C/795AMAFy1rASiptJtGpo
AZAABoBk9Q0EqelCepiGQBoAAAGgAKpTJNGmRPUzUYgaAAA9TQ0lMe4IXj6B
k7Ckh5UERPjODkOJCi1fJTiUXjBIBAK3Mld+pdHWXOiQkCJxCGHSRpPCEaaF
yVgXRoUgVhUDNLQG6n1iqqqqfFfI98DEF/FF04Smo2jQUO5nJaeOUeHjONhU
4oo10qxVrhQjhA4A4srAkk8crb0oE9ueEFtOdFAQqci5ExVARjVI6z3wNE4n
aBrD2iJgMgGkGMp4KetJ670izClJUe9Hi3Gxz5toRCvzAUIg8KO6IPnGAzqk
KqN3nSYLWHyZEzPniFw+rW8sCcXRC2lODEZcGGEJGYYtmng2iitUPuIfxKKj
WZSaIlqSgqNFhvyVwpatG9eXp4khRVZC6NxZetLgzTY4sWREV9IvF8FcGOs/
xdyRThQkM8jUyQA=
====
EOF
make all
find . -type f -and -perm +u+x | xargs --max-args=1 $TARGET-strip -g
mkdir -p $SOURCE/targetroot
# 仮想ルートへインストール
make install DESTDIR=$SOURCE/targetroot
# 不要なファイルを削除
pushd $SOURCE/targetroot
rm -fR usr/share/locale
rm -fR usr/share/man
rm -fR usr/share/info
rm -f bin/kill
# 例によって $SOURCE/targetroot 以下を実機へ転送する。

(新規) -> samba 3.0.9 (http://us2.samba.org/samba/ftp/stable/samba-3.0.9.tar.gz)

cd $SOURCE
tar xvzf $ARCHIVE/samba-3.0.9.tar.gz
cd samba-3.0.9
# configure スクリプトの修正
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 configure.patch.bz2
QlpoOTFBWSZTWYd38wUAAKdfgC4wXb///0IliAT/797oMAFkYA0qeKaeo9Ee
kbUaHqGQGgAZAMgCVMggp5TymT0QaA9CDGRD9UyNAAlE1GgpvRPUaQaNAAPU
AD1DZTR6jgFrgF9l0ueZpxUnSZyqAVh+4YH8BIS/EHphHoilullrqnlkCDhB
G/IEcNt1VEADVQ+4BWGwqAwLvtEjDkHsjLJF8vf+5uaZESdmkWwS4a5OgFqu
DOmXpaFWQEvEayGIFcIsBSxazggUlZM5R8JnaBXtkpJVkeEJ7UclBqkluc0R
Z3TDiUUtI4Ch7IYSrYjPETkjHyjHG+QpDSW3SfYNYPDyJ74DWhhTSqUBuDjW
X6wYpF0TJVPsGIBAmMK02MYmcP3tu0BchMoYMjDiZgZyYlRZHv/iGTOKETEP
OFAldZFQ95rWnE1FE4SbwXjIMDzbHQIVpYgZXGmCOB847fCUMlRBMwyI5VIn
FOQB8SNAu0UZZRiQlBeEHhmeDnoKK54KqUpIhQFchUof4u5IpwoSEO7+YKA=
====
EOF
cd source
BUILD_CC=gcc CXX=$TARGET-g++ CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib ./configure --prefix=/usr/local/samba --host=$TARGET --with-smbmount --with-syslog --with-quotas --with-dce-dfs
# いろいろな修正(config.h)
# HAVE_GETTIMEOFDAY_TZ, USE_SETEUID, _LARGEFILE64_SOURCE
# _LARGE_FILES, HAVE_EXPLICIT_LARGEFILE_SUPPORT, HAVE_LONGLONG
# HAVE_DEVICE_MAJOR_FN, HAVE_DEVICE_MINOR_FN, HAVE_FCNTL_LOCK
# HAVE_IFACE_IFCONF, HAVE_KERNEL_CHANGE_NOTIFY, HAVE_KERNEL_OPLOCKS_LINUX
# HAVE_KERNEL_SHARE_MODES, HAVE_MAKEDEV, HAVE_MMAP, HAVE_ROOT
# HAVE_SECURE_MKSTEMP, HAVE_STRUCT_DIRENT64, HAVE_STRUCT_FLOCK64
# SIZEOF_INO_T=8, SIZEOF_OFF_T=8, STAT_STATVFS64
# _FILE_OFFSET_BITS=64, _GNU_SOURCE
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 config.h.patch.bz2
QlpoOTFBWSZTWUIY9zkAAs1fg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VvK4crnzrU
Cq9fW8PyiczRJUwTknxGuYaGjCJQvVmQka2jRlNIS2tu3dlH8hRc19UTJUZE
tR+0nfMQMQGfTAW40uCUHakjZU9xM1iJUJQJDvmV5CNNAKiIM3WaPI24MLcA
uxFyk734Mp2ZqRaqBrhL+LuSKcKEghDHucg=
====
EOF
make all
find . -type f -and -perm +u+x | xargs --max-args=1 $TARGET-strip -g
mkdir -p $SOURCE/targetroot/usr/local/samba
# 仮想ルートへインストール
make install prefix=$SOURCE/targetroot/usr/local/samba
# 不要なファイルを削除、ヘッダファイル群を移動
pushd $SOURCE/targetroot/usr/local/samba
mv include/* $TOOLS/$TARGET/$TARGET/include
rm -fR swat man
popd

ncurses 5.2 -> 5.4 (ftp://ftp.iij.ad.jp/pub/GNU/ncurses/ncurses-5.4.tar.gz)

cd $SOURCE
tar xvzf $ARCHIVE/ncurses-5.4.tar.gz
cd ncurses-5.4
BUILD_CC=gcc CXX=$TARGET-g++ CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib ./configure --prefix=/usr --host=$TARGET --with-shared
make all
find . -type f -and -perm +u+x | xargs --max-args=1 $TARGET-strip -g
mkdir -p $SOURCE/targetroot/usr
# 仮想ルートへインストール
make install prefix=$SOURCE/targetroot/usr
# 不要なファイルを削除、ヘッダファイル/リンクライブラリ群を移動
pushd $SOURCE/targetroot/usr
rm -fR man
mv include/* $TOOLS/$TARGET/$TARGET/include
mv lib/*.a $TOOLS/$TARGET/$TARGET/lib

# ターゲットマシン上で /lib 以下に ncurses ライブラリがあるので削除しておくこと
rm /lib/libncurses.so.5 /lib/libncurses.so.5.2
ln -s /usr/lib/libncurses.so.5 /lib/libncurses.so.5

ftp -> tnftp 20030825 (http://freshmeat.net/redir/tnftp/6042/url_tgz/tnftp-20030825.tar.gz)

cd $SOURCE
tar xvzf $ARCHIVE/tnftp-20030825.tar.gz
cd tnftp-20030825
ac_cv_func_getpgrp_void=yes CC=$TARGET-gcc AR=$TARGET-ar RANLIB=$TARGET-ranlib ./configure --prefix=/usr --host=$TARGET
make all
mkdir -p $SOURCE/targetroot/usr
# 仮想ルートへインストール
make install prefix=$SOURCE/targetroot/usr
# 不要なファイルを削除
pushd $SOURCE/targetroot/usr
rm -fR man

(新規) -> procinfo 18 (ftp://ftp.cistron.nl/pub/people/svm/procinfo-18.tar.gz)

cd $SOURCE
tar xvzf $ARCHIVE/procinfo-18.tar.gz
cd procinfo-18
# termcapではなくncursesをリンク
mv Makefile Makefile.bak
sed "s/LDLIBS = -ltermcap/LDLIBS = -lncurses/g" < Makefile.bak > Makefile
make all CC="$TARGET-gcc -Wall -Wstrict-prototypes"
find . -type f -and -perm +u+x | xargs --max-args=1 $TARGET-strip -g
mkdir -p $SOURCE/targetroot/usr
# 仮想ルートへインストール
make install prefix=$SOURCE/targetroot/usr
# 不要なファイルを削除
pushd $SOURCE/targetroot/usr
rm -fR man

busybox 0.60.3 -> procps 3.2.4 (http://freshmeat.net/redir/procps/8384/url_tgz/procps-3.2.4.tar.gz)

cd $SOURCE
tar xvzf $ARCHIVE/procps-3.2.4.tar.gz
cd procps-3.2.4
# PATH_MAX が未定義になってしまう問題への対応
uudecode -o /dev/stdout << EOF | bzip2 -dc | patch -p1
begin-base64 644 pwdx.c.patch.bz2
QlpoOTFBWSZTWVN0PmYAABndgAIwWA//tUAAPm/fwDAAutg1TamIDQ00DQAA
Aao9Taj1AABoAAAJRFPUe1T1GINNA0AHlPUl15b4xdwUyvVjFQbZui4gGFur
pIHqudVcjEB+A1FfIaoQEGfDdOhuDxhNICga+ESMOFzhZOEt5BPi0O5JOQRH
iMIZggrBsEzk0im2DJmF4CsBYKzWBipaCk6IVOaHqsUJntBe0qE5sd0KFyoW
1czkdS8zDEKpMUvHxtUuQs0NE2ln8XckU4UJBTdD5mA=
====
EOF
make all CC="$TARGET-gcc"
find . -type f -and -perm +u+x | xargs --max-args=1 $TARGET-strip -g
mkdir -p $SOURCE/targetroot/usr
# インストール方法について検討が必要

psmisc

Cross Compiler From Scratchに戻る