bugGNU gettext - Bugs: bug #57168, libgettextlib uses indirect...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57168: libgettextlib uses indirect linking with libm

Submitter:  Tomasz Kłoczko <kloczek>
Submitted:  Mon 04 Nov 2019 10:16:27 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Tue 05 Nov 2019 02:37:27 AM UTC, comment #1: 

libgettextlib indeed needs to link with -lm, because the function xmlXPathCastNumberToString, defined in xpath.c, invokes log10.

When I build gettext from source on a glibc system, it does so because

1) the command line that builds libgettextlib.la looks like this:

libtool: link: gcc -shared  -fPIC -DPIC  .libs/copy-acl.o ... .libs/xmemdup0.o  -Wl,--whole-archive ./.libs/libxml_rpl.a -Wl,--no-whole-archive  -lacl -lm -LPREFIX/lib  -g -O2   -Wl,-soname -Wl,libgettextlib-20191013.so -o .libs/libgettextlib-20191013.so

As you can see, it contains -lm after the various .o files.

2) As a consequence, the generated libgettextlib.la contains explicit references to -lm:

dependency_libs=' -lacl -lm -LPREFIX/lib'

3) Then the link of a program such as recode_sr_latin will use -lm.

In your case, you have highly unusual command-line options:
- -specs options that may or may not be related.
- -Werror=format-security which we discussed in bug #56360,
- -flto, which is unsupported. In bug #56109, I told you that you need to use "-flto -ffat-lto-objects", not just "-flto".

Bruno Haible <haible>
Group administrator
Mon 04 Nov 2019 10:16:27 PM UTC, original submission:  

make[5]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/gettext-0.20.1/gettext-tools/src'
make[5]: Entering directory '/home/tkloczko/rpmbuild/BUILD/gettext-0.20.1/gettext-tools/src'
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto  -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto -fuse-linker-plugin -o recode-sr-latin recode_sr_latin-recode-sr-latin.o recode_sr_latin-filter-sr-latin.o ../gnulib-lib/libgettextlib.la -L/usr/lib64 -lunistring  
libtool: link: gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto -fuse-linker-plugin -o .libs/recode-sr-latin recode_sr_latin-recode-sr-latin.o recode_sr_latin-filter-sr-latin.o  ../gnulib-lib/.libs/libgettextlib.so -L/usr/lib64 -lacl -lxml2 -lunistring
/usr/bin/ld: ../gnulib-lib/.libs/libgettextlib.so: undefined reference to `log10'
collect2: error: ld returned 1 exit status
make[5]: * [Makefile:2973: recode-sr-latin] Error 1
make[5]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/gettext-0.20.1/gettext-tools/src'

Tomasz Kłoczko <kloczek>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by kloczek (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-05 haible CategoryNone Build
        StatusNone Invalid
        Assigned toNone haible
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code