Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge mpfr fails on arm-unknown-linux-gnu
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message

Joined: 02 Oct 2006
Posts: 9
Location: Linz, Austria

PostPosted: Wed Jan 02, 2008 2:47 pm    Post subject: emerge mpfr fails on arm-unknown-linux-gnu Reply with quote


i've just tried to crosscompile gentoo and started with this:
xemerge system

using the emerge wrapper from the embedded gentoo handbook [1].

the package mpfr breaks the build with this error:
        then mv -f ".deps/remquo.Tpo" ".deps/remquo.Plo"; else rm -f ".deps/remquo.Tpo"; exit 1; fi
 arm-unknown-linux-gnu-gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I. -march=armv5 -O2 -pipe -ffloat-store -MT yn.lo -MD -MP -MF .deps/yn.Tpo -c yn.c -o yn.o >/dev/null 2>&1
 arm-unknown-linux-gnu-gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I. -march=armv5 -O2 -pipe -ffloat-store -MT remquo.lo -MD -MP -MF .deps/remquo.Tpo -c remquo.c  -fPIC -DPIC -o .libs/remquo.o
 arm-unknown-linux-gnu-gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I. -march=armv5 -O2 -pipe -ffloat-store -MT remquo.lo -MD -MP -MF .deps/remquo.Tpo -c remquo.c -o remquo.o >/dev/null 2>&1
(cd . && ./ > get_patches.c || rm -f get_patches.c
if /bin/sh ./libtool --tag=CC --mode=compile arm-unknown-linux-gnu-gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I.     -march=armv5 -O2 -pipe -ffloat-store -MT get_patches.lo -MD -MP -MF ".deps/get_patches.Tpo" -c -o get_patches.lo get_patches.c; \
        then mv -f ".deps/get_patches.Tpo" ".deps/get_patches.Plo"; else rm -f ".deps/get_patches.Tpo"; exit 1; fi
 arm-unknown-linux-gnu-gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I. -march=armv5 -O2 -pipe -ffloat-store -MT get_patches.lo -MD -MP -MF .deps/get_patches.Tpo -c get_patches.c  -fPIC -DPIC -o .libs/get_patches.o
 arm-unknown-linux-gnu-gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I. -march=armv5 -O2 -pipe -ffloat-store -MT get_patches.lo -MD -MP -MF .deps/get_patches.Tpo -c get_patches.c -o get_patches.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC --mode=link arm-unknown-linux-gnu-gcc  -march=armv5 -O2 -pipe -ffloat-store   -o -rpath /usr/lib -version-info 2:0:1 exceptions.lo extract.lo uceil_exp2.lo uceil_log2.lo ufloor_log2.lo add.lo add1.lo add_ui.lo agm.lo clear.lo cmp.lo cmp_abs.lo cmp_si.lo cmp_ui.lo comparisons.lo div_2exp.lo div_2si.lo div_2ui.lo div.lo div_ui.lo dump.lo eq.lo exp10.lo exp2.lo exp3.lo exp.lo frac.lo get_d.lo get_exp.lo get_str.lo init.lo inp_str.lo isinteger.lo isinf.lo isnan.lo isnum.lo const_log2.lo log.lo mul_2exp.lo mul_2si.lo mul_2ui.lo mul.lo mul_ui.lo neg.lo next.lo out_str.lo const_pi.lo pow.lo pow_si.lo pow_ui.lo print_raw.lo print_rnd_mode.lo random2.lo random.lo reldiff.lo round_prec.lo set.lo setmax.lo setmin.lo set_d.lo set_dfl_prec.lo set_exp.lo set_rnd.lo set_f.lo set_prc_raw.lo set_prec.lo set_q.lo set_si.lo set_str.lo set_str_raw.lo set_ui.lo set_z.lo sqrt.lo sqrt_ui.lo sub.lo sub1.lo sub_ui.lo rint.lo ui_div.lo ui_sub.lo urandomb.lo get_z_exp.lo swap.lo factorial.lo cosh.lo sinh.lo tanh.lo acosh.lo asinh.lo atanh.lo atan.lo cmp2.lo exp_2.lo asin.lo const_euler.lo cos.lo sin.lo tan.lo fma.lo fms.lo hypot.lo log1p.lo expm1.lo log2.lo log10.lo ui_pow.lo ui_pow_ui.lo minmax.lo dim.lo signbit.lo copysign.lo setsign.lo gmp_op.lo init2.lo acos.lo sin_cos.lo set_nan.lo set_inf.lo powerof2.lo gamma.lo set_ld.lo get_ld.lo cbrt.lo volatile.lo fits_sshort.lo fits_sint.lo fits_slong.lo fits_ushort.lo fits_uint.lo fits_ulong.lo fits_uintmax.lo fits_intmax.lo get_si.lo get_ui.lo zeta.lo cmp_d.lo erf.lo inits.lo inits2.lo clears.lo sgn.lo check.lo sub1sp.lo version.lo mpn_exp.lo mpfr-gmp.lo mp_clz_tab.lo sum.lo add1sp.lo free_cache.lo si_op.lo cmp_ld.lo set_ui_2exp.lo set_si_2exp.lo set_uj.lo set_sj.lo get_sj.lo get_uj.lo get_z.lo iszero.lo cache.lo sqr.lo int_ceil_log2.lo isqrt.lo strtofr.lo pow_z.lo logging.lo mulders.lo get_f.lo round_p.lo erfc.lo atan2.lo subnormal.lo const_catalan.lo root.lo sec.lo csc.lo cot.lo eint.lo sech.lo csch.lo coth.lo round_near_x.lo constant.lo abort_prec_max.lo stack_interface.lo lngamma.lo zeta_ui.lo set_d64.lo get_d64.lo jn.lo yn.lo remquo.lo get_patches.lo  -lgmp
arm-unknown-linux-gnu-gcc -shared  .libs/exceptions.o .libs/extract.o .libs/uceil_exp2.o .libs/uceil_log2.o .libs/ufloor_log2.o .libs/add.o .libs/add1.o .libs/add_ui.o .libs/agm.o .libs/clear.o .libs/cmp.o .libs/cmp_abs.o .libs/cmp_si.o .libs/cmp_ui.o .libs/comparisons.o .libs/div_2exp.o .libs/div_2si.o .libs/div_2ui.o .libs/div.o .libs/div_ui.o .libs/dump.o .libs/eq.o .libs/exp10.o .libs/exp2.o .libs/exp3.o .libs/exp.o .libs/frac.o .libs/get_d.o .libs/get_exp.o .libs/get_str.o .libs/init.o .libs/inp_str.o .libs/isinteger.o .libs/isinf.o .libs/isnan.o .libs/isnum.o .libs/const_log2.o .libs/log.o .libs/mul_2exp.o .libs/mul_2si.o .libs/mul_2ui.o .libs/mul.o .libs/mul_ui.o .libs/neg.o .libs/next.o .libs/out_str.o .libs/const_pi.o .libs/pow.o .libs/pow_si.o .libs/pow_ui.o .libs/print_raw.o .libs/print_rnd_mode.o .libs/random2.o .libs/random.o .libs/reldiff.o .libs/round_prec.o .libs/set.o .libs/setmax.o .libs/setmin.o .libs/set_d.o .libs/set_dfl_prec.o .libs/set_exp.o .libs/set_rnd.o .libs/set_f.o .libs/set_prc_raw.o .libs/set_prec.o .libs/set_q.o .libs/set_si.o .libs/set_str.o .libs/set_str_raw.o .libs/set_ui.o .libs/set_z.o .libs/sqrt.o .libs/sqrt_ui.o .libs/sub.o .libs/sub1.o .libs/sub_ui.o .libs/rint.o .libs/ui_div.o .libs/ui_sub.o .libs/urandomb.o .libs/get_z_exp.o .libs/swap.o .libs/factorial.o .libs/cosh.o .libs/sinh.o .libs/tanh.o .libs/acosh.o .libs/asinh.o .libs/atanh.o .libs/atan.o .libs/cmp2.o .libs/exp_2.o .libs/asin.o .libs/const_euler.o .libs/cos.o .libs/sin.o .libs/tan.o .libs/fma.o .libs/fms.o .libs/hypot.o .libs/log1p.o .libs/expm1.o .libs/log2.o .libs/log10.o .libs/ui_pow.o .libs/ui_pow_ui.o .libs/minmax.o .libs/dim.o .libs/signbit.o .libs/copysign.o .libs/setsign.o .libs/gmp_op.o .libs/init2.o .libs/acos.o .libs/sin_cos.o .libs/set_nan.o .libs/set_inf.o .libs/powerof2.o .libs/gamma.o .libs/set_ld.o .libs/get_ld.o .libs/cbrt.o .libs/volatile.o .libs/fits_sshort.o .libs/fits_sint.o .libs/fits_slong.o .libs/fits_ushort.o .libs/fits_uint.o .libs/fits_ulong.o .libs/fits_uintmax.o .libs/fits_intmax.o .libs/get_si.o .libs/get_ui.o .libs/zeta.o .libs/cmp_d.o .libs/erf.o .libs/inits.o .libs/inits2.o .libs/clears.o .libs/sgn.o .libs/check.o .libs/sub1sp.o .libs/version.o .libs/mpn_exp.o .libs/mpfr-gmp.o .libs/mp_clz_tab.o .libs/sum.o .libs/add1sp.o .libs/free_cache.o .libs/si_op.o .libs/cmp_ld.o .libs/set_ui_2exp.o .libs/set_si_2exp.o .libs/set_uj.o .libs/set_sj.o .libs/get_sj.o .libs/get_uj.o .libs/get_z.o .libs/iszero.o .libs/cache.o .libs/sqr.o .libs/int_ceil_log2.o .libs/isqrt.o .libs/strtofr.o .libs/pow_z.o .libs/logging.o .libs/mulders.o .libs/get_f.o .libs/round_p.o .libs/erfc.o .libs/atan2.o .libs/subnormal.o .libs/const_catalan.o .libs/root.o .libs/sec.o .libs/csc.o .libs/cot.o .libs/eint.o .libs/sech.o .libs/csch.o .libs/coth.o .libs/round_near_x.o .libs/constant.o .libs/abort_prec_max.o .libs/stack_interface.o .libs/lngamma.o .libs/zeta_ui.o .libs/set_d64.o .libs/get_d64.o .libs/jn.o .libs/yn.o .libs/remquo.o .libs/get_patches.o  /usr/lib/  -march=armv5 -Wl,-soname -Wl, -o .libs/
/usr/lib/ could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-libs/mpfr-2.3.0_p4/work/mpfr-2.3.0'
make: *** [all-recursive] Error 1
 * ERROR: dev-libs/mpfr-2.3.0_p4 failed.
 * Call stack:
 *    , line 1701:  Called dyn_compile
 *    , line 1039:  Called qa_call 'src_compile'
 *    , line   44:  Called src_compile
 *   mpfr-2.3.0_p4.ebuild, line   46:  Called die
 * The specific snippet of code:
 *      emake || die
 *  The die message:
 *   (no error message)
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-libs/mpfr-2.3.0_p4/temp/build.log'.

the problem is that mpfr tries to link against /usr/lib/ and not against /usr/arm-unknown-linux-gnu/usr/lib/ which would be the correct one in my SYSROOT. i couldn't fix the ebuild or the package itself. maybe somebody could give me a pointer on what i could try to make mpfr compile.

thx, simon

ps.: this is my xemerge --info

xemerge  --info
Portage (default-linux/arm/2007.0, gcc-4.2.2, glibc-2.5-r4, 2.6.23-gentoo-r3 i686)
System uname: 2.6.23-gentoo-r3 i686 Genuine Intel(R) CPU 2140 @ 1.60GHz
Timestamp of tree: Tue, 01 Jan 2008 01:47:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.10-r5
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r3
CFLAGS="-march=armv5 -O2 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=armv5 -O2 -pipe"
FEATURES="buildpkg candy ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
USE="acl arm berkdb bitmap-fonts bzip2 cli cracklib crypt cups fortran iconv ipv6 isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl ppds pppd python readline reflection session spl ssl tcpd truetype-fonts type1-fonts unicode xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="chips dummy fbdevglint mach64 mga nv r128 radeon s3 s3virge savage sisusb tdfx trident v4l vga voodoo"

Back to top
View user's profile Send private message

Joined: 04 Mar 2004
Posts: 516

PostPosted: Wed Jan 09, 2008 6:45 pm    Post subject: Reply with quote

Hi Simon,

I know these problems. I usually pause the emerge after configure has finished
(ctrl-z) and have a look at the various Makefiles. Chances are there are some
LDFLAGS which can be corrected. Or, emerge problematic packages on the target

I do the latter on my SH4 and MIPS systems. You should be able to emerge
a native arm toolchain on your x86 host (it worked for sh4 and mips32 at least
with binutils-2.18, gcc-4.2.2 glibc-2.7-r1) then throw in distcc and let the x86 host
help with compilation. Depending on processor speed it can take a while (building
xorg-server- on the 200MHz SH4 takes 2-3 hours with distcc help), but
most of the packages in portage can be emerge fine (unless you run into
gcc/binutils bugs or code which assumes x86 is the only arch in the universe).

Back to top
View user's profile Send private message

Joined: 12 Sep 2003
Posts: 56
Location: Montréal, Québec

PostPosted: Fri Jan 25, 2008 12:06 pm    Post subject: Reply with quote

Hi Simon,

I've encountered the same error that you have, and I've posted a patch to the gentoo-embedded list:

The odd thing is, after compiling properly, the 'make install' portion now bails out saying that it can't find .libs/libmpfr.lai

 >>> Source compiled.
 >>> Test phase [not enabled]: dev-libs/mpfr-2.3.0_p3

 >>> Install mpfr-2.3.0_p3 into
/var/tmp/portage/dev-libs/mpfr-2.3.0_p3/image/ category dev-libs
/usr/bin/install -c .libs/libmpfr.lai
/usr/bin/install: cannot stat `.libs/libmpfr.lai': No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 1

I guess I'll have to just copy .libs/ to .libs/libmpfr.lai, but I'm waiting on some input from the gentoo-embedded list to see if this is worth-while, or if there is some more elegant solution.



    tc-is-cross-compiler && epatch "${FILESDIR}"/${PN}-${MY_PV}_p${PLEVEL}-disable-rpath.patch || die "disable rpath failed"


--- Makefile.in_old     2008-01-25 02:59:01.000000000 +0100
+++ 2008-01-25 02:59:21.000000000 +0100
@@ -394,7 +394,7 @@
          rm -f "$${dir}/so_locations"; \
        done $(libmpfr_la_OBJECTS) $(libmpfr_la_DEPENDENCIES)
-       $(LINK) -rpath $(libdir) $(libmpfr_la_LDFLAGS) $(libmpfr_la_OBJECTS) $(libmpfr_la_LIBADD) $(LIBS)
+       $(LINK) $(libmpfr_la_LDFLAGS) $(libmpfr_la_OBJECTS) $(libmpfr_la_LIBADD) $(LIBS)
 tuneup$(EXEEXT): $(tuneup_OBJECTS) $(tuneup_DEPENDENCIES)
        @rm -f tuneup$(EXEEXT)
        $(LINK) $(tuneup_LDFLAGS) $(tuneup_OBJECTS) $(tuneup_LDADD) $(LIBS)

Last edited by cfriedt on Fri Jan 25, 2008 1:44 pm; edited 1 time in total
Back to top
View user's profile Send private message

Joined: 12 Sep 2003
Posts: 56
Location: Montréal, Québec

PostPosted: Fri Jan 25, 2008 1:35 pm    Post subject: Reply with quote

I have another patch which will fix the install problem mentioned before:

--- Makefile.in_old     2008-01-25 14:05:42.000000000 +0100
+++ 2008-01-25 14:06:15.000000000 +0100
@@ -371,6 +371,7 @@
        test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
        @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
+           cp .libs/$$p .libs/$${p}i; \
            f=$(am__strip_dir) \
            echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
            $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \

Here is a quick and dirty way you can apply the patch and emerge the file right away... adjust any of the parameters as necessary.


mkdir -p ${OVERLAYDIR}/${CAT}
cp -aR ${PORTAGEDIR}/${CAT}/mpfr .
wget -O - | patch -p0 -i -

SYSROOT=${SYSROOT} xmerge -av1 =mpfr-2.3.0_p3

You can download the patch from here:
Back to top
View user's profile Send private message

Joined: 02 Oct 2006
Posts: 9
Location: Linz, Austria

PostPosted: Fri Mar 21, 2008 8:08 am    Post subject: Reply with quote


thx for the patch. I'll try it some time. I don't need it now because i figured out that mpfr is only needed if you build gcc with the "fortran" use-flag set. So as i hope i won't need any fortran support i'll be fine.

Another question, were you able to cross compile a native gcc for arm-unknown-linux-gnu?

lg, Simon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum