[lfs-support] LFS-7.0 Chapter 6.16. MPC-0.9 FYI

Baho Utot baho-utot at columbus.rr.com
Thu Jan 19 05:26:55 PST 2012


On Wednesday 18 January 2012 09:16:27 pm Ken Moffat wrote:
[putolin]

>  I disagree with the first part.  I don't have the book open in front
> of me (just shutting down, but this looked important enough to take a
> look).
>
>  I use ./configure --prefix=/usr and I also have 'unset CFLAGS'
> before this because of the following comment:
>
> # checking whether the gcc linker
> # (/tools/x86_64-unknown-linux-gnu/bin/ld -m elf_x86_64) supports
> # shared libraries... ./configure: line 8413: : supported targets:.*
> # elf: command not found  no
> #
> http://lists.gforge.inria.fr/pipermail/mpc-discuss/2011-February/000809.htm
>l # and then
> #
> http://lists.gforge.inria.fr/pipermail/mpc-discuss/2011-February/000819.htm
>l
>
>  From that, and with my buildscript functions to rename static libs
> to .hidden and to note what now exists which is newer than when I
> began to build the package (might not catch all the headers), I see
> the following were installed:
>
> /usr/include/mpc.h
> /usr/lib/libmpc.a.hidden
> /usr/lib/libmpc.la
> /usr/lib/libmpc.so
> /usr/lib/libmpc.so.2
> /usr/lib/libmpc.so.2.0.0
> /usr/share/info/dir
> /usr/share/info/mpc.info

I believe I may have found the problema

When I build it with the following

MAKEFLAGS="-j4"
CFLAGS="-march=i686 -mtune=i686 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
export CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS

It will _NOT_ build the shared libraries

usr/lib/libmpc.so.2
usr/lib/libmpc.so.2.0.0
usr/lib/libmpc.so

Removing the CFLAGS and CXXFLAGS will result in the libraries being built

Here is a partial diff between the two build logs, 
The first is without CFLAGS set <
The second with CFLAGS set >

< mv -f .deps/sqrt.Tpo .deps/sqrt.Plo
< /bin/sh ../libtool --tag=CC   --mode=compile 
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..     -march=i686 -mtune=i686 -O2 -pipe -fomit-frame-pointer -MT 
tanh.lo -MD -MP -MF .deps/tanh.Tpo -c -o tanh.lo tanh.c

 mv -f .deps/sqrt.Tpo .deps/sqrt.Plo
> /bin/sh ../libtool --tag=CC   --mode=compile 
gcc -DHAVE_CONFIG_H -I. -I..     -march=i686 -mtune=i686 -O2 -pipe -fomit-frame-pointer -MT 
tan.lo -MD -MP -MF .deps/tan.Tpo -c -o tan.lo tan.c


As you see the only difference is 

gcc -std=gnu99 - without CFLAGS set 
gcc  - with CFLAGS set


This is at the bottom where the shared library is created

> libtool: compile:  
gcc -DHAVE_CONFIG_H -I. -I.. -march=i686 -mtune=i686 -O2 -pipe -fomit-frame-pointer -MT 
ui_ui_sub.lo -MD -MP -MF .deps/ui_ui_sub.Tpo -c ui_ui_sub.c -o ui_ui_sub.o
409,412c337
< /bin/sh ../libtool --tag=CC   --mode=link 
gcc -std=gnu99  -march=i686 -mtune=i686 -O2 -pipe -fomit-frame-pointer -version-info 
2:0:0 -Wl,-O1 -Wl,--as-needed -o libmpc.la -rpath /usr/lib abs.lo acos.lo 
acosh.lo add.lo add_fr.lo add_si.lo add_ui.lo arg.lo asin.lo asinh.lo atan.lo 
atanh.lo clear.lo cmp.lo cmp_si_si.lo conj.lo cosh.lo div_2exp.lo div.lo 
div_fr.lo div_ui.lo exp.lo fma.lo fr_div.lo fr_sub.lo get.lo get_prec2.lo 
get_prec.lo get_str.lo get_version.lo imag.lo init2.lo init3.lo inp_str.lo 
log.lo mem.lo mul_2exp.lo mul.lo mul_fr.lo mul_i.lo mul_si.lo mul_ui.lo 
neg.lo norm.lo out_str.lo pow.lo pow_fr.lo pow_ld.lo pow_d.lo pow_si.lo 
pow_ui.lo pow_z.lo proj.lo real.lo urandom.lo set.lo set_prec.lo set_str.lo 
set_x.lo set_x_x.lo sin_cos.lo sinh.lo sqr.lo sqrt.lo strtoc.lo sub.lo 
sub_fr.lo sub_ui.lo swap.lo tan.lo tanh.lo uceil_log2.lo ui_div.lo 
ui_ui_sub.lo  -lmpfr -lgmp -lm
< libtool: link: 
gcc -std=gnu99 -shared  .libs/abs.o .libs/acos.o .libs/acosh.o .libs/add.o .libs/add_fr.o .libs/add_si.o .libs/add_ui.o .libs/arg.o .libs/asin.o .libs/asinh.o .libs/atan.o .libs/atanh.o .libs/clear.o .libs/cmp.o .libs/cmp_si_si.o .libs/conj.o .libs/cosh.o .libs/div_2exp.o .libs/div.o .libs/div_fr.o .libs/div_ui.o .libs/exp.o .libs/fma.o .libs/fr_div.o .libs/fr_sub.o .libs/get.o .libs/get_prec2.o .libs/get_prec.o .libs/get_str.o .libs/get_version.o .libs/imag.o .libs/init2.o .libs/init3.o .libs/inp_str.o .libs/log.o .libs/mem.o .libs/mul_2exp.o .libs/mul.o .libs/mul_fr.o .libs/mul_i.o .libs/mul_si.o .libs/mul_ui.o .libs/neg.o .libs/norm.o .libs/out_str.o .libs/pow.o .libs/pow_fr.o .libs/pow_ld.o .libs/pow_d.o .libs/pow_si.o .libs/pow_ui.o .libs/pow_z.o .libs/proj.o .libs/real.o .libs/urandom.o .libs/set.o .libs/set_prec.o .libs/set_str.o .libs/set_x.o .libs/set_x_x.o .libs/sin_cos.o .libs/sinh.o .libs/sqr.o .libs/sqrt.o .libs/strtoc.o .libs/sub.o .libs/sub_fr.o .libs/sub_ui.o .libs/swap.o .libs/tan.o .libs/tanh.o .libs/uceil_log2.o .libs/ui_div.o .libs/ui_ui_sub.o   -lmpfr -lgmp -lm  -march=i686 -mtune=i686 -Wl,-O1 -Wl,--as-needed   -Wl,-soname -Wl,libmpc.so.2 -o .libs/libmpc.so.2.0.0
< libtool: link: (cd ".libs" && rm -f "libmpc.so.2" && 
ln -s "libmpc.so.2.0.0" "libmpc.so.2")
< libtool: link: (cd ".libs" && rm -f "libmpc.so" && 
ln -s "libmpc.so.2.0.0" "libmpc.so")
---
> /bin/sh ../libtool --tag=CC   --mode=link 
gcc  -march=i686 -mtune=i686 -O2 -pipe -fomit-frame-pointer -version-info 
2:0:0 -Wl,-O1 -Wl,--as-needed -o libmpc.la -rpath /usr/lib abs.lo acos.lo 
acosh.lo add.lo add_fr.lo add_si.lo add_ui.lo arg.lo asin.lo asinh.lo atan.lo 
atanh.lo clear.lo cmp.lo cmp_si_si.lo conj.lo cosh.lo div_2exp.lo div.lo 
div_fr.lo div_ui.lo exp.lo fma.lo fr_div.lo fr_sub.lo get.lo get_prec2.lo 
get_prec.lo get_str.lo get_version.lo imag.lo init2.lo init3.lo inp_str.lo 
log.lo mem.lo mul_2exp.lo mul.lo mul_fr.lo mul_i.lo mul_si.lo mul_ui.lo 
neg.lo norm.lo out_str.lo pow.lo pow_fr.lo pow_ld.lo pow_d.lo pow_si.lo 
pow_ui.lo pow_z.lo proj.lo real.lo urandom.lo set.lo set_prec.lo set_str.lo 
set_x.lo set_x_x.lo sin_cos.lo sinh.lo sqr.lo sqrt.lo strtoc.lo sub.lo 
sub_fr.lo sub_ui.lo swap.lo tan.lo tanh.lo uceil_log2.lo ui_div.lo 
ui_ui_sub.lo  -lmpfr -lgmp -lm

This is from the configure.ac file

dnl Setup CC and CFLAGS

dnl Check for user specification of CC or CFLAGS
if test -n "$CFLAGS" || test -n "$CC" ; then
   user_redefine_cc=yes
fi

It looks like if you set CFLAGS you will need to do autoreconf as there must 
be something in the distributed configure script that make it not build the 
shared libiraries when CFLAGS is set.

Salamat po



More information about the lfs-support mailing list