Skip to content

Commit 7c5a79e

Browse files
committed
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
1 parent 727e901 commit 7c5a79e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ $(PLATFORM_D):
834834
@exit > $@
835835

836836
exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT)
837-
$(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ $<
837+
$(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(LDFLAGS) $(OUTFLAG)$@ $< $(LIBS)
838838
$(Q) $(POSTLINK)
839839
$(Q) ./miniruby$(EXEEXT) \
840840
-e 'prog, dest = ARGV; dest += "/ruby"' \

ruby-runner.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ insert_env_path(const char *envname, const char *paths, size_t size, int prepend
4343
setenv(envname, env, 1);
4444
}
4545

46+
/* force to link libm for fiddle test */
47+
#include <math.h>
48+
double (*const ruby_libm_func)(double) = log;
49+
4650
#define EXTOUT_DIR BUILDDIR"/"EXTOUT
4751
int
4852
main(int argc, char **argv)

0 commit comments

Comments
 (0)