りぬざうスケッチ

ヘッダファイル等のインストール

最終更新:

zauhack

- view
管理者のみ編集可

クロスコンパイル環境構築 > ヘッダファイル等のインストール


FILES


必要なファイルは ezaurus にあるので持ってくる:

rpm から cpio を取りだすために、rpm2cpio を持ってくる。
当然ながら、すでにインストールされていれば不要。

INSTALL


cd $CROSSDIR
rpm2cpio $(SRCDIR)/linux-headers-arm-sa1100-2.4.6-3.i386.rpm | cpio -i -d -v
rpm2cpio $(SRCDIR)/glibc-arm-2.2.2-0.i386.rpm |  cpio -i -d -v

mkdir arm-linux
mv opt/Embedix/tools/arm-linux/{include,lib} arm-linux
rm -rf opt/

gcc をコンパイルするときにエラーになるので、今のうちに対策をしておく。
gcc 2.x をインストールするのであれば不要かも。
gcc 3 の途中から必要になったっぽい。

cd $INSTDIR
patch < $(SRCDIR)/thread.diff

diff の中身は以下の通り (手パッチの方が早いかも)。
__thread がぶつかるらしいので、適当に変更してやれば OK。
なお、このページの一番下に diff ファイルへのリンクあり。

--- arm-linux/include/pthread.h,orig	Fri Sep 21 11:28:57 2007
+++ arm-linux/include/pthread.h	Fri Sep 21 11:29:41 2007
@@ -160,7 +160,7 @@
 /* Create a thread with given attributes ATTR (or default attributes
    if ATTR is NULL), and call function START_ROUTINE with given
    arguments ARG.  */
-extern int pthread_create (pthread_t *__restrict __thread,
+extern int pthread_create (pthread_t *__restrict __thrd,
 			   __const pthread_attr_t *__restrict __attr,
 			   void *(*__start_routine) (void *),
 			   void *__restrict __arg) __THROW;
@@ -583,7 +583,7 @@
 extern int pthread_setcanceltype (int __type, int *__oldtype) __THROW;
 
 /* Cancel THREAD immediately or at the next possibility.  */
-extern int pthread_cancel (pthread_t __thread) __THROW;
+extern int pthread_cancel (pthread_t __thrd) __THROW;
 
 /* Test for pending cancellation for the current thread and terminate
    the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
--- arm-linux/include/bits/sigthread.h,orig	Fri Sep 21 11:30:08 2007
+++ arm-linux/include/bits/sigthread.h	Fri Sep 21 11:30:20 2007
@@ -33,6 +33,6 @@
 			    __sigset_t *__restrict __oldmask)__THROW;
 
 /* Send signal SIGNO to the given thread. */
-extern int pthread_kill (pthread_t __thread, int __signo) __THROW;
+extern int pthread_kill (pthread_t __thrd, int __signo) __THROW;
 
 #endif	/* bits/sigthread.h */



添付ファイル
記事メニュー
ウィキ募集バナー