From: Mitsuo Igarashi Date: 2000-10-01T21:48:28+09:00 Subject: [ruby-list:25273] Re: ruby1.6.1(cygwin) が動作しません Koji Doi wrote. |Koji Doiです. | Sat, 30 Sep 2000 16:43:44 +0900 の | [ruby-list:25268] ruby1.6.1(cygwin) が動作しません | に関するメールにお答えします。 | |> 入手したruby1.6.1のソースをcygwin1.1でビルドしたところ、.exeや.dllは |>できたのですが、試しに実行(ruby --version)したところ、一般保護違反が発 |>生しました。(下にあるのは、そのときのワトソン博士のログです)どうやっ |>たら動作するバイナリができるでしょうか。 | |私もおなじ所でハマりました...(^^; | |ただ...ちょっと読んでいたので原因に思いあたったので回避しました. | |Cygwin1.1.4 のバグで, DLLがちゃんと生成できないそうです. |参照:http://www.jaist.ac.jp/~fujieda/cygwin/netrelease.shtml#changes1.1.4 | |対処法も同じページに載っています. これって、 以下のことですね。 Subject: [ruby-dev:10593] latest Cygwin From: WATANABE Hirofumi Date: Mon, 7 Aug 2000 09:50:59 +0900 >わたなべです. >最近 cygwin は CVS で update してるんですけど, どうも > がバグってるようで, 正しい DLL が作れ >ません. _cygwin_dll_entry の prototype が間違っていて本体が >extern "C" にならないので, C からは _cygwin_dll_entry がundefined になりま す. >libcygwin.a にはこの間違った _cygwin_dll_entry が入っています.全体を作りな おすのが面倒な>ら, 添付のパッチを当てて >libcygwin.a に追加してしまいましょう.% cat >dll_entry.c#include >DECLARE_CYGWIN_DLL(DllMain)% gcc -c dll_entry.c >% ar rv /lib/libcygwin.a dll_entry.oCygwin DLL 1.1.4 がリリースされましたが , 直ってません>. わたくしの cygwin1.1.4 はこのpatchを当ててあります。 それでも [ruby-list:25270] に書いたように、一応 error が出ました。 このptachの件を書き忘れていましたので。 わたなべひろふみ wrote. |:どうして、--shared-enable  かは、どなたか教えてください。 | |実質的には --shared-enable しないと使いものにならないので, |それでしかテストしてないというあたりが敗因かな. | これは、以下のことで良いのでしょうか? ruby からは外れますが。 Cygwin: A Free Win32 Porting Layer for UNIXR Applications 5. The Cygwin Architecture Now we turn to an analysis of the actual architecture of the Cygwin library. When a binary linked against the library is executed, the Cygwin DLL is loaded into the application's text segment. Because we are trying to emulate a UNIX kernel which needs access to all processes running under it, the first Cygwin DLL to run creates shared memory areas that other processes using separate instances of the DLL can access. This is used to keep track of open file descriptors and assist fork and exec, among other purposes. In addition to the shared memory regions, every process also has a per_process structure that contains information such as process id, user id, signal masks, and other similar process-specific information. ----------=========--------- Mitsuo Igarashi mitsu5@ruby.famille.ne.jp