Conference Room SAD
[thread display] [new arrival display] [word search] [past log] [管理用]

Subject Re: Intel MacにおけるSADの現状
Date: 2006/04/20(Thu) 14:46:54
ContributorShin-ichi Yoshimoto < >

> 最後の名前解決こけてしまいます。
> 原因は時間が出来たら調べてみますが、これまで出なかったパターンです。

これは以下のパッチで解決します。

--- gcc/config/darwin-crt3.c.orig 2006-04-05 16:22:09.000000000 +0900
+++ gcc/config/darwin-crt3.c 2006-04-10 18:37:32.000000000 +0900
@@ -518,15 +518,11 @@

int atexit (atexit_callback func) __attribute__((visibility("hidden")));

-/* Use __dso_handle to allow even bundles that call atexit() to be unloaded
- on 10.4. */
-extern void __dso_handle;
-
int
atexit (atexit_callback func)
{
struct one_atexit_routine r;
r.callback.ac = func;
r.has_arg = 0;
- return atexit_common (&r, &__dso_handle);
+ return atexit_common (&r, NULL);
}

そして、SADのmakeにも成功しますが、

mkdir -p /Users/yosimoto/SAD/src/oldsad-amorita-snapshot-563/Documents/example
/Users/yosimoto/SAD/src/oldsad-amorita-snapshot-563/bin/gs /Users/yosimoto/SAD/src/oldsad-amorita-snapshot-563/script/help2HTML.sad
make[2]: *** [/Users/yosimoto/SAD/src/oldsad-amorita-snapshot-563/Documents/SADHelp.html] Illegal instruction (core dumped)
make[1]: *** [all] Error 2
make: *** [all] Error 2

といったように、何かスクリプトを動かすとcore dumpします。試しに、全く何も書いていないスクリプトをgdb上で走らせてみると

% cat test.sad
%
% ./gs
GNU gdb 6.3.50-20050815 (Apple version gdb-467) (Wed Mar 22 19:04:00 GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) run -c test.sad
Starting program: /Users/yosimoto/SAD/src/oldsad-amorita-snapshot-557/obj/i386-Darwin8/sad1.exe -c test.sad
Reading symbols for shared libraries .++ done

Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x8fe136e4 in __dyld_stub_binding_helper_interface ()
(gdb) bt
#0 0x8fe136e4 in __dyld_stub_binding_helper_interface ()
#1 0x00001000 in ?? ()
#2 0x001ac9d2 in main (argc=3, argv=0xbffff624) at ../../../gcc/libgfortran/fmain.c:18
(gdb) up
#1 0x00001000 in ?? ()
(gdb) up
#2 0x001ac9d2 in main (argc=3, argv=0xbffff624) at ../../../gcc/libgfortran/fmain.c:18
18 MAIN__ ();
(gdb) l
13 /* Set up the runtime environment. */
14 set_args (argc, argv);
15
16 /* Call the Fortran main program. Internally this is a function
17 called MAIN__ */
18 MAIN__ ();
19
20 /* Bye-bye! */
21 return 0;
22 }
(gdb) quit
The program is running. Exit anyway? (y or n) y

というように、mainを呼ぶ所で死んでいます。ということで、SADが悪いのかgfortranが悪いのかを切り
分けるため、gfortranをtestsuiteにかけてみました。

% make check-f95
Making a new config file...
echo "set tmpdir /Users/yosimoto/src/obj/gcc/testsuite" >> ./tmp0
test -d testsuite || mkdir testsuite
test -d testsuite/gfortran || mkdir testsuite/gfortran
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd ../../gcc/gcc; ${PWDCMD-pwd}` ; export srcdir ; \
cd testsuite/gfortran; \
rm -f tmp-site.exp; \
sed '/set tmpdir/ s|testsuite|testsuite/gfortran|' \
< ../../site.exp > tmp-site.exp; \
/bin/sh ${srcdir}/../move-if-change tmp-site.exp site.exp; \
EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo ${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ; \
if [ -f ${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \
export TCL_LIBRARY ; fi ; \
`if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool gfortran )
WARNING: Couldn't find the global config file.
Test Run By yosimoto on Thu Apr 20 14:07:42 2006
Native configuration is i386-apple-darwin8.6.1

=== gfortran tests ===

Schedule of variations:
unix

Running target unix
Using /usr/pkg/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/pkg/share/dejagnu/config/unix.exp as generic interface file for target.
Using /Users/yosimoto/src/gcc/gcc/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /Users/yosimoto/src/gcc/gcc/testsuite/gfortran.dg/dg.exp ...
FAIL: gfortran.dg/assign_2.f90 -O0 (test for excess errors)
Running /Users/yosimoto/src/gcc/gcc/testsuite/gfortran.dg/gomp/gomp.exp ...
Running /Users/yosimoto/src/gcc/gcc/testsuite/gfortran.dg/vect/vect.exp ...
Running /Users/yosimoto/src/gcc/gcc/testsuite/gfortran.fortran-torture/compile/compile.exp ...
Running /Users/yosimoto/src/gcc/gcc/testsuite/gfortran.fortran-torture/execute/execute.exp ...

=== gfortran Summary ===

# of expected passes 12821
# of unexpected failures 1
# of expected failures 7
# of unresolved testcases 1
# of unsupported tests 46
/Users/yosimoto/src/obj/gcc/testsuite/gfortran/../../gfortran version 4.2.0 20060420 (experimental)

make: [check-gfortran] Error 1 (ignored)

となるので、まあ、gfortranは比較的まともそうには見えるんですがCC自体が駄目かもしれないので
引き続き調査続行、と行った感じです。


- 関連一覧ツリー (Click ▼ to display all articles in a thread.)