Hi Maxim,
On Wed, Jul 22, 2009 at 06:49:00PM +0400, Maxim Kuvyrkov wrote:
>Hello,
>
>As described in thread
>http://lists.uclibc.org/pipermail/uclibc/2009-July/042670.html,
>uClibc build is currently broken on m68k. The attached patch ports
slightly OT, but you seem to have an m68k box..
I once tried to build GMP for a toolchain that defaults to coldfire
-- picked a 5475 randomly -- and had to fallback to the C impl in gmp
(http://repo.or.cz/w/buildroot.git?a=blob_plain;f=package/gmp/m68k-coldfire-for-libgmp.02.patch;hb=HEAD
attached)
Perhaps you could give gmp-4.3.1 a try if you have a minute and
eventually take care of pushing a fix upstream?
TIA,
diff -rduNp gmp-4.3.1.oorig/configure gmp-4.3.1/configure
--- gmp-4.3.1.oorig/configure 2009-05-12 08:12:45.000000000 +0200
+++ gmp-4.3.1/configure 2009-08-18 18:13:53.000000000 +0200
@@ -2851,10 +2851,27 @@ echo "include_mpn(\`ia64/ia64-defs.m4')"
# Motorola 68k
#
m68k-*-* | m68[0-9][0-9][0-9]-*-*)
- cat >>confdefs.h <<\_ACEOF
+
+ if test "x$ac_cv_host_cpu_family_coldfire" = "x"; then
+# ideally we would look if the CPP defined __mcoldfire__
+for __cfla in $CFLAGS;
+do
+ case $__cfla in
+ -mcpu=5*) ac_cv_host_cpu_family_coldfire=yes;;
+ esac
+done
+ fi
+ if test "x$ac_cv_host_cpu_family_coldfire" = "xyes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_HOST_CPU_FAMILY_coldfire 1
+_ACEOF
+
+ else
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_HOST_CPU_FAMILY_m68k 1
_ACEOF
+ fi
echo "include_mpn(\`m68k/m68k-defs.m4')" >> $gmp_tmpconfigm4i
@@ -2881,6 +2898,9 @@ echo "include_mpn(\`m68k/m68k-defs.m4')"
m680[234]0 | m68360) path="m68k/mc68020 m68k" ;;
*) path="m68k" ;;
esac
+ if test "x$ac_cv_host_cpu_family_coldfire" = "xyes"; then
+ path="m68k/m5200 m68k" ; path="m68k/m5200"
+ fi
;;
@@ -10436,7 +10456,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 10439 "configure"' > conftest.$ac_ext
+ echo '#line 10459 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -12178,11 +12198,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12181: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12201: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12185: \$? = $ac_status" >&5
+ echo "$as_me:12205: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12468,11 +12488,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12471: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12491: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12475: \$? = $ac_status" >&5
+ echo "$as_me:12495: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12572,11 +12592,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12575: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12595: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12579: \$? = $ac_status" >&5
+ echo "$as_me:12599: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14958,7 +14978,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14961 "configure"
+#line 14981 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15058,7 +15078,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 15061 "configure"
+#line 15081 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17482,11 +17502,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17485: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17505: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17489: \$? = $ac_status" >&5
+ echo "$as_me:17509: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17586,11 +17606,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17589: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17609: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17593: \$? = $ac_status" >&5
+ echo "$as_me:17613: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19148,11 +19168,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19151: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19171: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:19155: \$? = $ac_status" >&5
+ echo "$as_me:19175: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -19252,11 +19272,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19255: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19275: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19259: \$? = $ac_status" >&5
+ echo "$as_me:19279: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21444,11 +21464,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21447: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21467: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21451: \$? = $ac_status" >&5
+ echo "$as_me:21471: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21734,11 +21754,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21737: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21757: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21741: \$? = $ac_status" >&5
+ echo "$as_me:21761: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21838,11 +21858,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21841: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21861: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21845: \$? = $ac_status" >&5
+ echo "$as_me:21865: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
diff -rduNp gmp-4.3.1.oorig/configure.in gmp-4.3.1/configure.in
--- gmp-4.3.1.oorig/configure.in 2009-05-12 08:12:12.000000000 +0200
+++ gmp-4.3.1/configure.in 2009-08-18 18:11:26.000000000 +0200
@@ -247,6 +247,7 @@ AH_VERBATIM([HAVE_HOST_CPU_1],
For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
#undef HAVE_HOST_CPU_FAMILY_alpha
#undef HAVE_HOST_CPU_FAMILY_m68k
+#undef HAVE_HOST_CPU_FAMILY_coldfire
#undef HAVE_HOST_CPU_FAMILY_power
#undef HAVE_HOST_CPU_FAMILY_powerpc
#undef HAVE_HOST_CPU_FAMILY_x86
@@ -729,7 +730,21 @@ case $host in
# Motorola 68k
#
M68K_PATTERN)
- AC_DEFINE(HAVE_HOST_CPU_FAMILY_m68k)
+
+ if test "x$ac_cv_host_cpu_family_coldfire" = "x"; then
+# ideally we would look if the CPP defined __mcoldfire__
+for __cfla in $CFLAGS;
+do
+ case $__cfla in
+ -mcpu=5*) ac_cv_host_cpu_family_coldfire=yes;;
+ esac
+done
+ fi
+ if test "x$ac_cv_host_cpu_family_coldfire" = "xyes"; then
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_coldfire)
+ else
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_m68k)
+ fi
GMP_INCLUDE_MPN(m68k/m68k-defs.m4)
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_cflags_optlist="arch"
@@ -754,6 +769,9 @@ case $host in
[m680[234]0 | m68360]) path="m68k/mc68020 m68k" ;;
*) path="m68k" ;;
esac
+ if test "x$ac_cv_host_cpu_family_coldfire" = "xyes"; then
+ path="m68k/m5200 m68k" ; path="m68k/m5200"
+ fi
;;
diff -rduNp gmp-4.3.1.oorig/gmp-impl.h gmp-4.3.1/gmp-impl.h
--- gmp-4.3.1.oorig/gmp-impl.h 2009-05-12 08:12:12.000000000 +0200
+++ gmp-4.3.1/gmp-impl.h 2009-08-18 18:11:26.000000000 +0200
@@ -3341,7 +3341,7 @@ double mpn_get_d __GMP_PROTO ((mp_srcptr
seem to put the operand through memory as hoped. */
#if (HAVE_HOST_CPU_FAMILY_m68k || HAVE_HOST_CPU_FAMILY_x86 \
- || defined (__amd64__))
+ || defined (__amd64__) || HAVE_HOST_CPU_FAMILY_coldfire)
#define FORCE_DOUBLE(d) \
do { volatile double __gmp_force = (d); (d) = __gmp_force; } while (0)
#else
diff -rduNp gmp-4.3.1.oorig/mpn/m68k/README gmp-4.3.1/mpn/m68k/README
--- gmp-4.3.1.oorig/mpn/m68k/README 2009-05-12 08:12:12.000000000 +0200
+++ gmp-4.3.1/mpn/m68k/README 2009-08-18 18:11:26.000000000 +0200
@@ -29,6 +29,7 @@ CODE ORGANIZATION
m68k m68000, m68010, m68060
m68k/mc68020 m68020, m68030, m68040, and CPU32
+ m68k/m5200 coldfire (e.g. 5475)
The m5200 "coldfire", which is m68000 less a few instructions, currently has
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc