トップ «前の日記(2006年12月27日) 最新 次の日記(2006年12月30日)» 編集
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|10|12|
2009|02|03|06|07|10|11|12|
2010|01|02|03|04|07|09|10|11|12|
2011|01|03|04|05|06|07|08|10|
2012|01|06|08|09|10|12|
2013|01|02|03|04|07|09|11|12|
2014|01|03|04|05|06|09|
2015|04|
2016|01|08|
ここは旧えびめもです。えびめも2に移行します(2016/12/1)

2006年12月29日

sh4 debian etch

gcc-4.1_4.1.1ds2-21 に挑戦
/root/build/gcc-4.1/gcc-4.1-4.1.1ds2/build/./gcc/xgcc 
-B/root/build/gcc-4.1/gcc-4.1-4.1.1ds2/build/./gcc/ 
-B/usr/sh4-unknown-linux-gnu/bin/ -B/usr/sh4-unknown-linux-gnu/lib/ 
-isystem /usr/sh4-unknown-linux-gnu/include -isystem /usr/sh4-unknown-linux-gnu/sys-include 
-O2 -g -O2  -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wno-strict-prototypes -Wno-error -isystem ./include  -I. -I. 
-I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include 
-I../../src/gcc/../libcpp/include 
-aux-info SYSCALLS.c.X -S -o tmp-SYSCALLS.s SYSCALLS.c
cc1: internal compiler error: no multiarch mapping for multilib ()
う〜む。 xgcc が動かないらしい。
src/gcc/c-incpath.c を見ると
const struct multiarch_mapping multiarch_mappings[]
= {
#include "multiarch.inc"
  { 0, 0 }
};
のあたりかな。。。

sh4 debian etch

gcc-4.0 を参考にして
--- src/gcc/c-incpath.c~        2006-12-29 02:42:01.000000000 +0900
+++ src/gcc/c-incpath.c 2006-12-29 16:39:09.000000000 +0900
@@ -152,86 +152,88 @@
 add_standard_paths (const char *sysroot, const char *iprefix,
                    const char *imultilib, int cxx_stdinc)
 {
   const struct default_include *p;
   size_t len;
   const char *multiarch;
 
   if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0)
     {
       /* Look for directories that start with the standard prefix.
         "Translate" them, i.e. replace /usr/local/lib/gcc... with
         IPREFIX and search them first.  */
       for (p = cpp_include_defaults; p->fname; p++)
        {
          if (!p->cplusplus || cxx_stdinc)
            {
              /* Should we be translating sysrooted dirs too?  Assume
                 that iprefix and sysroot are mutually exclusive, for
                 now.  */
              if (sysroot && p->add_sysroot)
                continue;
              if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
                {
                  char *str = concat (iprefix, p->fname + len, NULL);
+#if 0 /* EBIHARA */
                  if (p->multilib == 1 && imultilib)
                    str = concat (str, dir_separator_str, imultilib, NULL);
                  if (p->multilib == 2)
                    {
                      multiarch = multilib_to_multiarch (imultilib);
                      if (!multiarch)
                        continue;
                      str = concat (str, dir_separator_str, multiarch, NULL);
                    }
+#endif /* EBIHARA */
                  add_path (str, SYSTEM, p->cxx_aware, false);
                }
            }
        }
     }
 
   for (p = cpp_include_defaults; p->fname; p++)
     {
       if (!p->cplusplus || cxx_stdinc)
        {
          char *str;
 
          /* Should this directory start with the sysroot?  */
          if (sysroot && p->add_sysroot)
            str = concat (sysroot, p->fname, NULL);
          else
            str = update_path (p->fname, p->component);
-
+#if 0 /* EBIHARA */
          if (p->multilib == 1 && imultilib)
            str = concat (str, dir_separator_str, imultilib, NULL);
 
          if (p->multilib == 2)
            {
              multiarch = multilib_to_multiarch (imultilib);
              if (!multiarch)
                continue;
              str = concat (str, dir_separator_str, multiarch, NULL);
            }
-
+#endif /* EBIHARA */
          add_path (str, SYSTEM, p->cxx_aware, false);
        }
     }
 }
強引に上のようにして xgcc が動くようになった。先に進む。
../../src/gcc/fix-header.c: In function 'read_scan_file':
../../src/gcc/fix-header.c:670: warning: passing argument 4 of 'register_include_chains' makes pointer from integer without a cast
../../src/gcc/fix-header.c:670: error: too few arguments to function 'register_include_chains'
む。これってコンパイルできないんじゃねーのか?調べて直す。
--- src/gcc/fix-header.c~       2005-06-25 11:02:01.000000000 +0900
+++ src/gcc/fix-header.c        2006-12-29 16:48:49.000000000 +0900
@@ -666,7 +666,7 @@
     exit (FATAL_EXIT_CODE);
 
   register_include_chains (scan_in, NULL /* sysroot */, NULL /* iprefix */,
-                          true /* stdinc */, false /* cxx_stdinc */,
+                          0, true /* stdinc */, false /* cxx_stdinc */,
                           false /* verbose */);
 
   /* We are scanning a system header, so mark it as such.  */

sh4 debian etch

あ。なんだか gcc-4.1.1 コンパイル成功したらしい。 .deb パッケージはまだ無理だけど。
# gcc -v
Using built-in specs.
Target: sh4-unknown-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++ 
--prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release 
--with-multilib-list=m4
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)