[前][次][番号順一覧][スレッド一覧]

ruby-changes:51744

From: nobu <ko1@a...>
Date: Thu, 12 Jul 2018 11:14:05 +0900 (JST)
Subject: [ruby-changes:51744] nobu:r63956 (trunk): exe/ruby: link libm for fiddle test

nobu	2018-07-12 11:14:00 +0900 (Thu, 12 Jul 2018)

  New Revision: 63956

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63956

  Log:
    exe/ruby: link libm for fiddle test
    
    * common.mk (exe/ruby): $(LIBS) should come after the source file
      due to the ld spec.
    
    * ruby-runner.c (ruby_libm_func): force to link libm for fiddle
      test.

  Modified files:
    trunk/common.mk
    trunk/ruby-runner.c
Index: common.mk
===================================================================
--- common.mk	(revision 63955)
+++ common.mk	(revision 63956)
@@ -834,7 +834,7 @@ $(PLATFORM_D): https://github.com/ruby/ruby/blob/trunk/common.mk#L834
 	@exit > $@
 
 exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT)
-	$(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ $<
+	$(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(LDFLAGS) $(OUTFLAG)$@ $< $(LIBS)
 	$(Q) $(POSTLINK)
 	$(Q) ./miniruby$(EXEEXT) \
 	    -e 'prog, dest = ARGV; dest += "/ruby"' \
Index: ruby-runner.c
===================================================================
--- ruby-runner.c	(revision 63955)
+++ ruby-runner.c	(revision 63956)
@@ -43,6 +43,10 @@ insert_env_path(const char *envname, con https://github.com/ruby/ruby/blob/trunk/ruby-runner.c#L43
     setenv(envname, env, 1);
 }
 
+/* force to link libm for fiddle test */
+#include <math.h>
+double (*const ruby_libm_func)(double) = log;
+
 #define EXTOUT_DIR BUILDDIR"/"EXTOUT
 int
 main(int argc, char **argv)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]