Hi, I noticed a couple warnings with FFI on Windows Vista with VC++ 9: .\src\x86\win32.asm(842) : warning A6004:procedure argument or local not referenced : FORCEFRAME .\src\x86\win32.asm(995) : warning A6004:procedure argument or local not referenced : FORCEFRAME Thread.c Thread.c(224) : warning C4101: ''res'' : unreferenced local variable Thread.c(255) : warning C4101: ''res'' : unreferenced local variable Thread.c(254) : warning C4101: ''state'' : unreferenced local variable I also seem to be having trouble with 1.8.7. It builds fine, but won''t load: irb(main):001:0> require ''ffi'' LoadError: 127: The specified procedure could not be found. - Init_ffi c:/rubyvc9/lib/ruby/site_ruby/1.8/i386-msvcr90/ffi.so from c:/rubyvc9/lib/ruby/site_ruby/1.8/i386-msvcr90/ffi.so from (irb):1 from :0 I tried both the manual approach and the "gem install" approach. Seems to be ok on my 1.9.2 built with VC9, though. Regards, Dan
Hi, 2012/1/20 Daniel Berger <djberg96 at gmail.com>:> Hi, > > I noticed a couple warnings with FFI on Windows Vista with VC++ 9: > > .\src\x86\win32.asm(842) : warning A6004:procedure argument or local not > referenced : FORCEFRAME > .\src\x86\win32.asm(995) : warning A6004:procedure argument or local not > referenced : FORCEFRAME > > Thread.c > Thread.c(224) : warning C4101: ''res'' : unreferenced local variable > Thread.c(255) : warning C4101: ''res'' : unreferenced local variable > Thread.c(254) : warning C4101: ''state'' : unreferenced local variable > > I also seem to be having trouble with 1.8.7. It builds fine, but won''t load: > > irb(main):001:0> require ''ffi'' > LoadError: 127: The specified procedure could not be found. ? - Init_ffi > c:/rubyvc9/lib/ruby/site_ruby/1.8/i386-msvcr90/ffi.so > ? ? ? ?from c:/rubyvc9/lib/ruby/site_ruby/1.8/i386-msvcr90/ffi.so > ? ? ? ?from (irb):1 > ? ? ? ?from :0 > > I tried both the manual approach and the "gem install" approach. Seems to be > ok on my 1.9.2 built with VC9, though. >I think the warnings are ignorable. require ''ffi'' is actulally require ''ffi.rb''. And in ffi.rb, you can see require ''ffi_c''. I cannot understand why "ffi.so" is created. /ext/ffi_c/extconf.rb creates Makefile for ffi_c.so. Could you show me the generated Makefile? Regards, Park Heesob
Hi <snip>> require ''ffi'' is actulally require ''ffi.rb''. > And in ffi.rb, you can see require ''ffi_c''. > > I cannot understand why "ffi.so" is created. > /ext/ffi_c/extconf.rb creates Makefile for ffi_c.so. > Could you show me the generated Makefile?VC++ 9 on Windows Vista ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mswin32_90] I ran ruby extconf.rb using the latest from your repo:>ruby extconf.rbchecking for ffi.h... no checking for ffi.h in /usr/local/include... no checking for rb_thread_blocking_region()... no checking for ruby_thread_has_gvl_p()... no checking for ruby_native_thread_p()... no checking for rb_thread_call_with_gvl()... no creating extconf.h creating Makefile Here''s the Makefile: SHELL = /bin/sh #### Start of system configuration section. #### srcdir = . topdir = c:/rubyvc9/lib/ruby/1.8/i386-mswin32_90 hdrdir = $(topdir) VPATH = $(srcdir);$(topdir);$(hdrdir) DESTDIR = c: exec_prefix = $(prefix) prefix = $(DESTDIR)/rubyvc9 sharedstatedir = $(DESTDIR)/etc mandir = $(prefix)/man oldincludedir = $(DESTDIR)/usr/include bindir = $(exec_prefix)/bin libexecdir = $(exec_prefix)/libexec sitedir = $(prefix)/lib/ruby/site_ruby vendorarchdir = $(vendorlibdir)/$(sitearch) includedir = $(prefix)/include infodir = $(prefix)/info vendorlibdir = $(vendordir)/$(ruby_version) sysconfdir = $(prefix)/etc libdir = $(exec_prefix)/lib sbindir = $(exec_prefix)/sbin rubylibdir = $(libdir)/ruby/$(ruby_version) vendordir = $(prefix)/lib/ruby/vendor_ruby archdir = $(rubylibdir)/$(arch) sitearchdir = $(sitelibdir)/$(sitearch) datadir = $(prefix)/share localstatedir = $(DESTDIR)/var sitelibdir = $(sitedir)/$(ruby_version) CC = cl -W3 -nologo LIBRUBY = $(RUBY_SO_NAME).lib LIBRUBY_A = $(RUBY_SO_NAME)-static.lib LIBRUBYARG_SHARED = $(LIBRUBY) LIBRUBYARG_STATIC = $(LIBRUBY_A) RUBY_EXTCONF_H = extconf.h CFLAGS = -MD -O2b2xty- INCFLAGS = -I. -I. -Ic:/rubyvc9/lib/ruby/1.8/i386-mswin32_90 -I. DEFS = CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE CXXFLAGS = $(CFLAGS) ldflags = dldflags = -link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH) archflag = DLDFLAGS = $(ldflags) $(dldflags) $(archflag) LDSHARED = cl -W3 -nologo -LD AR = lib -nologo EXEEXT = .exe RUBY_INSTALL_NAME = ruby RUBY_SO_NAME = msvcr90-ruby18 arch = i386-mswin32_90 sitearch = i386-msvcr90 ruby_version = 1.8 ruby = c:/rubyvc9/bin/ruby RUBY = $(ruby:/=\) RM = $(RUBY) -run -e rm -- -f MAKEDIRS = @$(RUBY) -run -e mkdir -- -p INSTALL = @$(RUBY) -run -e install -- -vp INSTALL_PROG = $(INSTALL) -m 0755 INSTALL_DATA = $(INSTALL) -m 0644 COPY = copy > nul #### End of system configuration section. #### preload = libpath = . $(libdir) LIBPATH = -libpath:"." -libpath:"$(libdir)" DEFFILE = $(TARGET)-$(arch).def CLEANFILES = mkmf.log DISTCLEANFILES = vc*.pdb $(DEFFILE) extout = extout_prefix = target_prefix = LOCAL_LIBS = ./libffi/.libs/libffi_convenience.lib LIBS = $(LIBRUBYARG_SHARED) oldnames.lib user32.lib advapi32.lib shell32.lib wsock32.lib SRCS = AbstractMemory.c ArrayType.c Buffer.c Call.c ClosurePool.c DataConverter.c DynamicLibrary.c ffi.c Function.c FunctionInfo.c LastError.c MappedType.c MemoryPointer.c MethodHandle.c Platform.c Pointer.c Struct.c StructByReference.c StructByValue.c StructLayout.c Thread.c Type.c Types.c Variadic.c OBJS = AbstractMemory.obj ArrayType.obj Buffer.obj Call.obj ClosurePool.obj DataConverter.obj DynamicLibrary.obj ffi.obj Function.obj FunctionInfo.obj LastError.obj MappedType.obj MemoryPointer.obj MethodHandle.obj Platform.obj Pointer.obj Struct.obj StructByReference.obj StructByValue.obj StructLayout.obj Thread.obj Type.obj Types.obj Variadic.obj TARGET = ffi_c DLLIB = $(TARGET).so EXTSTATIC = STATIC_LIB = BINDIR = $(bindir) RUBYCOMMONDIR = $(sitedir)$(target_prefix) RUBYLIBDIR = $(sitelibdir)$(target_prefix) RUBYARCHDIR = $(sitearchdir)$(target_prefix) TARGET_SO = $(DLLIB) CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map CLEANOBJS = *.obj *.lib *.s[ol] *.pdb *.exp *.bak all: $(DLLIB) static: $(STATIC_LIB) clean: @-$(RM) $(CLEANLIBS:/=\) $(CLEANOBJS:/=\) $(CLEANFILES:/=\) distclean: clean @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES:/=\) realclean: distclean install: install-so install-rb install-so: $(RUBYARCHDIR) install-so: $(RUBYARCHDIR)/$(DLLIB) $(RUBYARCHDIR)/$(DLLIB): $(DLLIB) $(INSTALL_PROG) $(DLLIB:/=\) $(RUBYARCHDIR:/=\) install-rb: pre-install-rb install-rb-default install-rb-default: pre-install-rb-default pre-install-rb: Makefile pre-install-rb-default: Makefile $(RUBYARCHDIR): $(MAKEDIRS) $@ site-install: site-install-so site-install-rb site-install-so: install-so site-install-rb: install-rb .SUFFIXES: .c .m .cc .cxx .cpp .obj {$(hdrdir)}.cc{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(topdir)}.cc{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(srcdir)}.cc{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) .cc.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(hdrdir)}.cxx{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(topdir)}.cxx{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(srcdir)}.cxx{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) .cxx.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(hdrdir)}.cpp{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(topdir)}.cpp{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(srcdir)}.cpp{}.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) .cpp.obj: $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/) {$(hdrdir)}.c{}.obj: $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/) {$(topdir)}.c{}.obj: $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/) {$(srcdir)}.c{}.obj: $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/) .c.obj: $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/) $(DLLIB): $(DEFFILE) $(OBJS) Makefile @-$(RM) $@ $(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS) -implib:$(*F:.so=)-$(arch).lib -pdb:$(*F:.so=)-$(arch).pdb -def:$(DEFFILE) @if exist $(@).manifest mt -nologo -manifest $(@).manifest -outputresource:$(@);2 @if exist $(@).manifest $(RM) $(@:/=\).manifest $(DEFFILE): $(RUBY) -e "puts ''EXPORTS'', ''Init_$(TARGET)''" > $@ $(OBJS): {.;$(VPATH)}ruby.h {.;$(VPATH)}defines.h $(RUBY_EXTCONF_H) LIBFFI_HOST=--host=i686-mswin32_90 !include $(srcdir)/libffi.vc.mk
2012/1/21 Daniel Berger <djberg96 at gmail.com>:> Hi > > <snip> > >> require ''ffi'' is actulally require ''ffi.rb''. >> And in ffi.rb, you can see require ''ffi_c''. >> >> I cannot understand why "ffi.so" is created. >> /ext/ffi_c/extconf.rb creates Makefile for ffi_c.so. >> Could you show me the generated Makefile? > > VC++ 9 on Windows Vista > ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mswin32_90] > > I ran ruby extconf.rb using the latest from your repo: > >>ruby extconf.rb > checking for ffi.h... no > checking for ffi.h in /usr/local/include... no > checking for rb_thread_blocking_region()... no > checking for ruby_thread_has_gvl_p()... no > checking for ruby_native_thread_p()... no > checking for rb_thread_call_with_gvl()... no > creating extconf.h > creating Makefile > > Here''s the Makefile:...>Your Makefile looks OK. In Makefile, TARGET and DLLIB defined as like this: TARGET = ffi_c DLLIB = $(TARGET).so So, after runng Makefile, the result so file is not "ffi.so" but "ffi_c.so", isn''t it? What''s the output of "nmake install"? In my environment, C:\work\ffi-ffi-a48ba61\ext\ffi_c>nmake install Microsoft(R) Program Maintenance Utility Version 9.00.30729.01 Copyright (c) Microsoft Corporation. All rights reserved. install -c -p -m 0755 ffi_c.so c:\lib\ruby\site_ruby\1.8\i386-msvcr90 Regards, Park Heesob
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel- > bounces at rubyforge.org] On Behalf Of Heesob Park > Sent: Friday, January 20, 2012 6:04 PM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] MSVC and FFI build warnings > > 2012/1/21 Daniel Berger <djberg96 at gmail.com>: > > Hi > > > > <snip> > > > >> require ''ffi'' is actulally require ''ffi.rb''. > >> And in ffi.rb, you can see require ''ffi_c''. > >> > >> I cannot understand why "ffi.so" is created. > >> /ext/ffi_c/extconf.rb creates Makefile for ffi_c.so. > >> Could you show me the generated Makefile? > > > > VC++ 9 on Windows Vista > > ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mswin32_90] > > > > I ran ruby extconf.rb using the latest from your repo: > > > >>ruby extconf.rb > > checking for ffi.h... no > > checking for ffi.h in /usr/local/include... no > > checking for rb_thread_blocking_region()... no > > checking for ruby_thread_has_gvl_p()... no > > checking for ruby_native_thread_p()... no > > checking for rb_thread_call_with_gvl()... no > > creating extconf.h > > creating Makefile > > > > Here''s the Makefile: > ... > > > > Your Makefile looks OK. > > In Makefile, TARGET and DLLIB defined as like this: > TARGET = ffi_c > DLLIB = $(TARGET).so > > So, after runng Makefile, the result so file is not "ffi.so" but > "ffi_c.so", isn''t it? > What''s the output of "nmake install"? > > In my environment, > C:\work\ffi-ffi-a48ba61\ext\ffi_c>nmake install > > Microsoft(R) Program Maintenance Utility Version 9.00.30729.01 > Copyright (c) Microsoft Corporation. All rights reserved. > > install -c -p -m 0755 ffi_c.so c:\lib\ruby\site_ruby\1.8\i386-msvcr90I must have been screwing around with an earlier version and renamed a file manually. It''s working fine now. Sorry for the confusion. Regards, Dan