[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

[MD:6273] mingw-runtime 3.6 利用時のビルドエラーへの対応



藤井です。

mingw-runtime 3.6 がリリースされたので、Cygwin をアップデートして 
Meadow のビルドを行ないました。すると、以下のようなリンクエラーが発生
するようになりました。

------------------------------------------------------------
(略)
gcc -o oo-spd/i386/temacs.exe  -g -mno-cygwin  -Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -g -Wl,-subsystem,console -Wl,-entry,_mw32_start -Wl,-Map,oo-spd/i386/temacs.map oo-spd/i386/firstfile.o oo-spd/i386/meadow.res oo-spd/i386/temacs0.a oo-spd/i386/temacs1.a oo-spd/i386/temacw32.a oo-spd/i386/lastfile.a -ladvapi32 -lgdi32 -lcomdlg32 -luser32 -lmpr -lshell32
oo-spd/i386/temacs1.a(fileio.o)(.text+0x2ff4): In function `Fmake_symbolic_link':
/home/fujii/work/Meadow/2.1/src/fileio.c:2775: undefined reference to `_symlink'
oo-spd/i386/temacs1.a(fileio.o)(.text+0x307a):/home/fujii/work/Meadow/2.1/src/fileio.c:2782: undefined reference to `_symlink'
oo-spd/i386/temacs1.a(fileio.o)(.text+0x3809): In function `Ffile_symlink_p':
/home/fujii/work/Meadow/2.1/src/fileio.c:3146: undefined reference to `_readlink'
collect2: ld returned 1 exit status
make[2]: *** [oo-spd/i386/temacs.exe] Error 1
make[2]: Leaving directory `/home/fujii/work/Meadow/2.1/src'
make[1]: *** [bootstrap-temacs] Error 2
make[1]: Leaving directory `/home/fujii/work/Meadow/2.1/src'
make: *** [bootstrap-gmake] Error 2
------------------------------------------------------------

確認したところ、mingw-runtime 3.6 に含まれる sys/stat.h に S_IFLNK、
S_ISLNK マクロの定義が追加されたため、シンボリックリンク関連のコードが
コンパイルされるようになったのが原因のようです。

mingw-runtime 3.6 対策として S_IFLNK によって条件コンパイルを行なって
いる、dired.c、fileio.c および filemode.c で S_IFLNK および S_ISLNK を 
undef するようにしました。

--
藤井 正行 / Masayuki FUJII ( boochang@xxxxxxxxxxxx )