aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-12 02:14:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-12 02:14:00 +0000
commit7c5a79efba23cb861dcdb98ffef2227ae9a49bd4 (patch)
tree3d29877b757194bdcbeb7bcaf1e780755b0092b6
parent727e90172bc01b5fc637bc633dd0bfd6d01f4d22 (diff)
downloadruby-7c5a79efba23cb861dcdb98ffef2227ae9a49bd4.tar.gz
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--common.mk2
-rw-r--r--ruby-runner.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/common.mk b/common.mk
index 340f0a9bab..287241e2ed 100644
--- a/common.mk
+++ b/common.mk
@@ -834,7 +834,7 @@ $(PLATFORM_D):
@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"' \
diff --git a/ruby-runner.c b/ruby-runner.c
index 99be4a0013..b5a2e50659 100644
--- a/ruby-runner.c
+++ b/ruby-runner.c
@@ -43,6 +43,10 @@ insert_env_path(const char *envname, const char *paths, size_t size, int prepend
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)