ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.23k stars 141 forks source link

Installed binary doesn't start on Cygwin #225

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Chibi on Cygwin
2. run `chibi-scheme`

What is the expected output? What do you see instead?
REPL would come up

Nothing, when I've checked with GDB then I've got following message;
During startup program exited with code 0xc0000022.

What version of the product are you using? On what operating system?
$ ./chibi-scheme.exe -V
chibi-scheme 0.7 "nitrogen" (chibi r7rs ratios complex threads full-unicode 
modules dynamic-loading cygwin little-endian)

Please provide any additional information below.
I can run if I use the built binary in build directory (./chibi-scheme)

It seems something wrong with loading shared library but not sure. Following is 
the result of `cygcheck` (not sure if it's useful, though)

Found: D:\cygwin\usr\local\bin\chibi-scheme.exe
D:\cygwin\usr\local\bin\chibi-scheme.exe
  D:\cygwin\usr\local\bin\libchibi-scheme.dll.0.7
    D:\cygwin\bin\cygwin1.dll
      C:\Windows\system32\KERNEL32.dll
        C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
        C:\Windows\system32\ntdll.dll
        C:\Windows\system32\KERNELBASE.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll
    D:\cygwin\bin\cyggcc_s-1.dll

Original issue reported on code.google.com by ktakash...@gmail.com on 30 Jun 2014 at 7:45

GoogleCodeExporter commented 9 years ago
Thanks!  I don't have access to a windows machine, I'll
try to coordinate with someone who does.

This likely has to do with the new soversioning, and the line:

LIBCHIBI_FLAGS = -Wl,--out-implib,libchibi-scheme$(SO).a

where the .a seems suspicious (probably should be .dll).

Original comment by alexsh...@gmail.com on 30 Jun 2014 at 12:25

GoogleCodeExporter commented 9 years ago
The cause was actually file permission of shared file. It seems Cygwin requires 
executable. I've changed Makefile as following;

--- Makefile.org        2014-06-30 21:45:33.786508000 +0200
+++ Makefile    2014-06-30 21:43:54.988857100 +0200
@@ -331,7 +331,7 @@
        $(INSTALL) -m0644 $(INCLUDES) $(DESTDIR)$(INCDIR)/
        $(MKDIR) $(DESTDIR)$(LIBDIR)
        $(MKDIR) $(DESTDIR)$(SOLIBDIR)
-       $(INSTALL) -m0644 libchibi-scheme$(SO).$(SOVERSION) 
$(DESTDIR)$(SOLIBDIR)/
+       $(INSTALL) -m0755 libchibi-scheme$(SO).$(SOVERSION) 
$(DESTDIR)$(SOLIBDIR)/
        $(LN) -s -f $(DESTDIR)$(SOLIBDIR)/libchibi-scheme$(SO).$(SOVERSION) $(DESTDIR)$(SOLIBDIR)/libchibi-scheme$(SO).$(SOVERSION_MAJOR)
        $(LN) -s -f $(DESTDIR)$(SOLIBDIR)/libchibi-scheme$(SO).$(SOVERSION) $(DESTDIR)$(SOLIBDIR)/libchibi-scheme$(SO)
        -$(INSTALL) -m0644 libchibi-scheme.a $(DESTDIR)$(SOLIBDIR)/

Then it worked.

Original comment by ktakash...@gmail.com on 30 Jun 2014 at 7:48

GoogleCodeExporter commented 9 years ago
Thanks!  Patch applied.

Original comment by alexsh...@gmail.com on 30 Jun 2014 at 7:59