1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* Makefile.in (miniruby): renames and then removes, to get rid of

EPERM on cygwin and mingw.

* Makefile.in ($(LIBRUBY_SO)): use wildcard option of objcopy.

* configure.in (DLDFLAGS): do not export all symbols.

* cygwin/GNUmakefile.in (RUBYDEF): rejects symbols prefixex with
  Init_.

* win32/mkexports.rb (Exports::Mingw): includes all symbols except for
  prefixed with Init_ as well as mswin32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-01-20 06:32:36 +00:00
parent e77a0b7b24
commit 2d03f7274f
5 changed files with 31 additions and 18 deletions

View file

@ -1,3 +1,18 @@
Tue Jan 20 15:32:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (miniruby): renames and then removes, to get rid of
EPERM on cygwin and mingw.
* Makefile.in ($(LIBRUBY_SO)): use wildcard option of objcopy.
* configure.in (DLDFLAGS): do not export all symbols.
* cygwin/GNUmakefile.in (RUBYDEF): rejects symbols prefixex with
Init_.
* win32/mkexports.rb (Exports::Mingw): includes all symbols except for
prefixed with Init_ as well as mswin32.
Tue Jan 20 13:03:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (hash): fixed the tail bytes handling in the aligned

View file

@ -123,7 +123,7 @@ all:
.NOEXPORT:
miniruby$(EXEEXT):
@$(RM) $@
@-if test -f $@; then mv -f $@ $@.old; $(RM) $@.old; fi
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@ -141,9 +141,7 @@ $(LIBRUBY_A):
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
@-test "$(OBJDUMP)" = "" || test "$(OBJCOPY)" = "" || { \
set dummy `$(OBJDUMP) -t $@ | sed '/^[^ ]* g/!d;s/.* //;/^\(Init_\|vm_\)/!d;s/^/-L /'`; \
shift; test "$$#" = 0 || $(OBJCOPY) "$$@" $@; }
-$(OBJCOPY) -w -L '@EXPORT_PREFIX@Init_*' $@
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true

View file

@ -1478,7 +1478,7 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes;;
cygwin*|mingw*) : ${LDSHARED="${CC} -shared "'$(if $(filter-out -g -g0,$(debugflags)),,-s)'}
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
rb_cv_dlopen=yes ;;
hiuxmpp) : ${LDSHARED='ld -r'} ;;
@ -1871,6 +1871,7 @@ case "$target_os" in
cygwin*)
if test x"$enable_shared" = xyes; then
LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}${TEENY}.dll
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
fi
;;
mingw*)

View file

@ -5,7 +5,7 @@ ENABLE_SHARED=@ENABLE_SHARED@
DLLWRAP = @DLLWRAP@ --target=@target_os@
ifeq (@target_os@,cygwin)
DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
@ -29,7 +29,7 @@ WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
RUBYDEF = $(RUBY_SO_NAME).def
RUBYDEF = $(DLL_BASE_NAME).def
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
@ -63,22 +63,25 @@ GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
$(OBJS) $(MAINOBJ): win32.h
endif
$(LIBRUBY_SO): $(RUBYDEF)
$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
ifeq (@target_os@,cygwin)
@NM@ --extern --defined $(LIBRUBY_A) | \
$(MINIRUBY) -n -e 'BEGIN{puts "VERSION $(MAJOR).$(MINOR)","EXPORTS"}' \
-e 'puts $$1 if / [CDT] _((?!Init_).*)$$/' > $@
else
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
endif
clean-local::
@$(RM) $(RUBYDEF)
endif
ifeq (@target_os@,cygwin)
cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A)
@NM@ --extern --defined $(LIBRUBY_A) | \
$(MINIRUBY) -ne 'BEGIN{puts "VERSION $(MAJOR).$(MINOR)","EXPORTS"}; puts $$1+"=$(@F)."+$$1 if / [CDT] _(.*)$$/' >rubydll.def
@DLLWRAP@ -s --def=rubydll.def -o $@
@rm -f rubydll.def
cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF)
@DLLWRAP@ -s --def=$(RUBYDEF) -o $@
endif
clean-local::

View file

@ -143,15 +143,11 @@ class Exports::Mingw < Exports
def each_export(objs)
objdump(objs) do |l|
yield $1 if / [[:upper:]] _(.*)$/ =~ l
yield $1 if / [[:upper:]] _((?!Init_).*)$/ =~ l
end
yield "strcasecmp", "_stricmp"
yield "strncasecmp", "_strnicmp"
end
def symbols()
@syms.select {|k, v| v}.sort.collect {|k, v| "#{k}=#{v}"}
end
end
END {