From 3bcf570a17d25783187c8aa3413bf48425b29619 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Sat, 6 Jun 2015 08:57:33 +0900 Subject: Fix build on MIPS of linux MIPS of Linux platform is supported frexpl(3). This fixes to use the frexpl that are provided with gcc if user wants to build on MIPS of Linux platform. Signe-doff-by: Nobuhiro Iwamatsu --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fmt_fp.c') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index ef2f19dd5..a634edb34 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -90,7 +90,7 @@ fmt_u(uint32_t x, char *s) typedef char compiler_defines_long_double_incorrectly[9-(int)sizeof(long double)]; #endif -#if defined(__CYGWIN32__) || defined(__NetBSD__) || defined(mips) +#if (defined(__CYGWIN32__) || defined(__NetBSD__) || defined(mips)) && !defined(__linux__) static long double frexpl (long double x, int *eptr) { -- cgit v1.2.3 From 0b50b4a5005c3233b88b09f196034352ebdfc515 Mon Sep 17 00:00:00 2001 From: xuejianqing Date: Mon, 6 Jul 2015 12:51:57 +0800 Subject: fix androideabi cross-compile error : undefined reference to 'frexpl' --- src/fmt_fp.c | 9 +++------ tasks/toolchains/androideabi.rake | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/fmt_fp.c') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index a634edb34..b467435a3 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -90,12 +90,9 @@ fmt_u(uint32_t x, char *s) typedef char compiler_defines_long_double_incorrectly[9-(int)sizeof(long double)]; #endif -#if (defined(__CYGWIN32__) || defined(__NetBSD__) || defined(mips)) && !defined(__linux__) -static long double -frexpl (long double x, int *eptr) -{ - return frexp(x, eptr); -} +#if ((defined(__CYGWIN32__) || defined(__NetBSD__) || defined(mips)) && !defined(__linux__)) || defined(__android__) +#undef frexpl +#define frexpl frexp #endif static int diff --git a/tasks/toolchains/androideabi.rake b/tasks/toolchains/androideabi.rake index 61881ca31..7cdb9e43a 100644 --- a/tasks/toolchains/androideabi.rake +++ b/tasks/toolchains/androideabi.rake @@ -109,8 +109,8 @@ MRuby::Toolchain.new(:androideabi) do |conf| ANDROID_CC = path_to_toolchain + '/bin/' + toolchain_prefix + 'gcc' ANDROID_LD = path_to_toolchain + '/bin/' + toolchain_prefix + 'gcc' ANDROID_AR = path_to_toolchain + '/bin/' + toolchain_prefix + 'ar' - ANDROID_CFLAGS = GCC_COMMON_CFLAGS + %W(-mandroid --sysroot="#{SYSROOT}") + ARCH_CFLAGS - ANDROID_LDFLAGS = GCC_COMMON_LDFLAGS + %W(-mandroid --sysroot="#{SYSROOT}") + ARCH_LDFLAGS + ANDROID_CFLAGS = GCC_COMMON_CFLAGS + %W(-D__android__ -mandroid --sysroot="#{SYSROOT}") + ARCH_CFLAGS + ANDROID_LDFLAGS = GCC_COMMON_LDFLAGS + %W(-D__android__ -mandroid --sysroot="#{SYSROOT}") + ARCH_LDFLAGS when 'clang' then # clang is not supported yet. when 'clang31', 'clang3.1' then -- cgit v1.2.3 From 67e187f0f883789131c596ccc56980c32471bbbf Mon Sep 17 00:00:00 2001 From: takkaw Date: Thu, 16 Jul 2015 18:40:07 +0900 Subject: 64bit Cygwin also doesn't have frexpl(3) --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fmt_fp.c') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index b467435a3..b27ebd6e9 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -90,7 +90,7 @@ fmt_u(uint32_t x, char *s) typedef char compiler_defines_long_double_incorrectly[9-(int)sizeof(long double)]; #endif -#if ((defined(__CYGWIN32__) || defined(__NetBSD__) || defined(mips)) && !defined(__linux__)) || defined(__android__) +#if ((defined(__CYGWIN__) || defined(__NetBSD__) || defined(mips)) && !defined(__linux__)) || defined(__android__) #undef frexpl #define frexpl frexp #endif -- cgit v1.2.3