[疑难] gdc 使用问题。

sleets 2007-10-11

版本
cl@ns /web/work/dlang# gdc -v
Using built-in specs.
Target: x86_64-portbld-freebsd7.0
Configured with: ./../gcc-4.1-20070910/configure --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --disable-shared --enable-languages=c,c++,d --enable-thread-lib=-lpthread --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ x86_64-portbld-freebsd7.0
Thread model: posix
gcc version 4.1.3 20070910 (prerelease   (gdc 0.24, using dmd 1.020))


错误命令
cl@ns /web/work/dlang# gdmd test.d
/usr/local/lib/libgphobos.a(deh.o)(.text+0xa2): In function `_D3gcc3deh17parse_lsda_headerFPS3gcc6unwind15_Unwind_ContextPhPS3gcc3deh16lsda_header_infoZPh':
../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:431: undefined reference to `_Unwind_GetRegionStart'
/usr/local/lib/libgphobos.a(deh.o)(.text+0x1d5): In function `_D3gcc3deh15personalityImplFiT3gcc6unwind14_Unwind_ActionmPS3gcc6unwind17_Unwind_ExceptionPS3gcc6unwind15_Unwind_ContextZk':
../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:171: undefined reference to `_Unwind_GetLanguageSpecificData'
/usr/local/lib/libgphobos.a(deh.o)(.text+0x225):../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:180: undefined reference to `_Unwind_GetIP'
/usr/local/lib/libgphobos.a(deh.o)(.text+0x39e):../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:405: undefined reference to `_Unwind_SetGR'
/usr/local/lib/libgphobos.a(deh.o)(.text+0x3ae):../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:407: undefined reference to `_Unwind_SetGR'
/usr/local/lib/libgphobos.a(deh.o)(.text+0x3b9):../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:409: undefined reference to `_Unwind_SetIP'
/usr/local/lib/libgphobos.a(deh.o)(.text+0x599): In function `_d_throw':
../.././../gcc-4.1-20070910/libphobos/gcc/deh.d:101: undefined reference to `_Unwind_RaiseException'
/usr/local/lib/libgphobos.a(object.o)(.text+0x1ef4): In function `_D6object6Object14notifyRegisterMFDFC6ObjectZvZv':
../.././../gcc-4.1-20070910/libphobos/internal/object.d:190: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(string.o)(.text+0x376c): In function `_D3std6string9isNumericFYb':
../.././../gcc-4.1-20070910/libphobos/std/string.d:3449: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(string.o)(.text+0x432d): In function `_D3std6string7sformatFAaYAa':
../.././../gcc-4.1-20070910/libphobos/std/string.d:2695: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(string.o)(.text+0x4432): In function `_D3std6string6formatFYAa':
../.././../gcc-4.1-20070910/libphobos/std/string.d:2661: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(stdio.o)(.text+0x11c): In function `_D3std5stdio7writefxFPS3std1c5stdio6_iobufAC8TypeInfoG1S3gcc8builtins13__va_list_tagiZv':
../.././../gcc-4.1-20070910/libphobos/std/stdio.d:137: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(stdio.o)(.text+0x1d0):../.././../gcc-4.1-20070910/libphobos/std/stdio.d:252: more undefined references to `_Unwind_Resume' follow
/usr/local/lib/libgphobos.a(unwind.o)(.text+0x1e8): In function `base_of_encoded_value':
../.././../gcc-4.1-20070910/libphobos/gcc/unwind.d:310: undefined reference to `_Unwind_GetTextRelBase'
/usr/local/lib/libgphobos.a(unwind.o)(.text+0x201):../.././../gcc-4.1-20070910/libphobos/gcc/unwind.d:314: undefined reference to `_Unwind_GetRegionStart'
/usr/local/lib/libgphobos.a(unwind.o)(.text+0x20d):../.././../gcc-4.1-20070910/libphobos/gcc/unwind.d:312: undefined reference to `_Unwind_GetDataRelBase'
/usr/local/lib/libgphobos.a(thread.o)(.text+0x104): In function `_D3std6thread6Thread11threadstartUPvZPv':
../.././../gcc-4.1-20070910/libphobos/std/thread.d:987: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(thread.o)(.text+0x7a9): In function `_D3std6thread6Thread8pauseAllFZv':
../.././../gcc-4.1-20070910/libphobos/std/thread.d:863: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(thread.o)(.text+0xc4a): In function `_D3std6thread6Thread5startMFZv':
../.././../gcc-4.1-20070910/libphobos/std/thread.d:604: undefined reference to `_Unwind_Resume'
/usr/local/lib/libgphobos.a(dgccmain2.o)(.text+0x148): In function `_d_run_main':
../.././../gcc-4.1-20070910/libphobos/internal/dgccmain2.d:93: undefined reference to `_Unwind_Resume'


系统
cl@ns /web/work/dlang# uname -v
FreeBSD 7.0-CURRENT #0: Tue Oct  9 14:31:03 CST 2007     cl@ns.xwall.cn:/usr/obj/usr/src/sys/changlong


sleets 2007-10-11
gdc -c test.d
没问题,连接的时候就错了。
oldrev 2007-10-11
貌似 FreeBSD7 还没发布啊?自己编译GDC试试?估计现在没人能帮上忙。
qiezi 2007-10-12
gdc里面有个lib64目录,把里面的libphobos拷到/usr/local/lib下就可以了.
sleets 2007-10-12
先谢谢楼上2位的关注,

我搜索libgphobos.a只发现了一个。 搜索带phobos名字的文件有下面2个。其中第一个不是库文件,但是有可执行权限。
./include/d/4.1.3/x86_64-portbld-freebsd7.0/phobos-ver-syms
./lib/libgphobos.a

执行后有以下警告
cl@ns /usr/local/include/d/4.1.3/x86_64-portbld-freebsd7.0# /usr/local/include/d/4.1.3/x86_64-portbld-freebsd7.0/phobos-ver-syms
Unix: not found
GNU_Semaphore_POSIX: not found
GNU_Need_nan: not found
GNU_Need_exp2_log2: not found
GNU_Need_execvpe: not found
GNU_Need_spawnvp: not found
GNU_Have_strtold: not found
GNU_BsdSockets_salen: not found
GNU_CBridge_Stdio: not found
GNU_Unix_Have_MMap: not found
GNU_Unix_Have_getpwnam_r: not found


x86目录下有以下文件
cl@ns /usr/local/include/d/4.1.3/x86_64-portbld-freebsd7.0# find . -name "*"
./gcc
./gcc/config.d
./gcc/configunix.d
./phobos-ver-syms


在gdc编译目录搜索到的libgphobos.a复制过去问题依旧。
cl@ns /usr/ports/lang/gdc/work# find . -name "*phobos*"
./gcc-4.1-20070910/gcc/d/phobos
./gcc-4.1-20070910/gcc/d/phobos/phobos-ver-syms.in
./gcc-4.1-20070910/gcc/d/phobos/phobos.d
./gcc-4.1-20070910/gcc/d/phobos/phoboslicense.txt
./gcc-4.1-20070910/libphobos
./gcc-4.1-20070910/libphobos/phobos-ver-syms.in
./gcc-4.1-20070910/libphobos/phobos.d
./gcc-4.1-20070910/libphobos/phoboslicense.txt
./build/x86_64-portbld-freebsd7.0/libphobos
./build/x86_64-portbld-freebsd7.0/libphobos/phobos-ver-syms
./build/x86_64-portbld-freebsd7.0/libphobos/libgphobos.a

sleets 2007-10-12
这个ports我刚才在i386下编译了下,没有任何问题。在google上找一些人说是amd64连接有问题,具体的解决方法没找到。
qiezi 2007-10-12
噢.我是在64位linux下测试的,freebsd没测试过.
Global site tag (gtag.js) - Google Analytics