RPM

linking rpmconstant needs @LTLIBINTL@ and librpm

Bug #1243469 reported by Tim Mooney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
Fix Released
Medium
Jeff Johnson

Bug Description

I'm building rpm from CVS (2013-10-22) on x86_64-pc-solaris2.11 with the Oracle Studio 12.3 compiler.

There are a couple of issues when linking rpmconstant:

gmake all-am
gmake[1]: Entering directory `/local/src/RPM/SOURCES/rpm-20131016/rpm/rpmconstant'
/bin/bash ../libtool --tag=CC --mode=link cc -m64 -xtarget=generic -m64 -xarch=generic -Xa -xc99=all -KPIC -I/usr/local/include -I/usr/local/gnu/include -KPIC -DPIC -v -xO0 -g -D_GNU_SOURCE -D_REENTRANT -L/usr/local/lib/64 -L/usr/local/gnu/lib/64 -L/local/lib/64 -L/usr/lib/amd64 -L/local/lib/64 -L/usr/lib/amd64 -o rpmconstant constant.o librpmconstant.la -lpcreposix -lpcre -lreadline -ldb_sql-5.1 -ldb-5.1 -lneon -lexpat -lcrypto -llzma -lbz2 -lz -lpopt -lpthread -lsocket -lnsl -lelf -lpopt -lssl -lcrypto -lsocket -lnsl -lc -lnsl -lsocket -lz -lssl -lcrypto -lsocket -lnsl -lc -lproxy -lexpat -lneon -lpcre
libtool: link: cc -m64 -xtarget=generic -m64 -xarch=generic -Xa -xc99=all -KPIC -I/usr/local/include -I/usr/local/gnu/include -KPIC -DPIC -v -xO0 -g -D_GNU_SOURCE -D_REENTRANT -o .libs/rpmconstant constant.o -L/usr/local/lib/64 -L/usr/local/gnu/lib/64 -L/local/lib/64 -L/usr/lib/amd64 ./.libs/librpmconstant.so -L../beecrypt /local/src/RPM/SOURCES/rpm-20131016/rpm/rpmio/.libs/librpmio.so -lm /local/src/RPM/SOURCES/rpm-20131016/rpm/misc/.libs/librpmmisc.so -lpcreposix -lreadline /local/lib/64/libdb_sql-5.1.so /local/lib/64/libdb-5.1.so -lresolv /local/lib/64/liblzma.so -lbz2 -lpthread -lelf /local/lib/64/libpopt.so /local/lib/64/libneon.so -lz -lssl -lcrypto -lsocket -lnsl -lc -lproxy -lexpat -lpcre -mt -xopenmp -R/usr/local/lib/64 -R/local/lib/64
cc: Warning: Optimizer level changed from 0 to 3 to support parallelized code.
ld: warning: symbol 'aes' has differing types:
    (file /local/src/RPM/SOURCES/rpm-20131016/rpm/rpmio/.libs/librpmio.so type=FUNC; file /local/src/RPM/SOURCES/rpm-20131016/rpm/misc/.libs/librpmmisc.so type=OBJT);
    /local/src/RPM/SOURCES/rpm-20131016/rpm/rpmio/.libs/librpmio.so definition taken
Undefined first referenced
 symbol in file
rpmdsInit constant.o
rpmdsNext constant.o
rpmdsType constant.o
libintl_textdomain /local/src/RPM/SOURCES/rpm-20131016/rpm/rpmio/.libs/librpmio.so
rpmdsSearch constant.o
rpmdsResult constant.o
rpmdsIx constant.o
libintl_bindtextdomain /local/src/RPM/SOURCES/rpm-20131016/rpm/rpmio/.libs/librpmio.so
rpmdsDNEVR constant.o
libintl_dgettext /local/src/RPM/SOURCES/rpm-20131016/rpm/rpmio/.libs/librpmio.so
rpmdsSetResult constant.o
ld: fatal: symbol referencing errors. No output written to .libs/rpmconstant
gmake[3]: *** [rpmconstant] Error 2

The libintl_* symbols are missing because the rpmconstant/Makefile.am doesn't include @LTLIBINTL@ after librpmio like some of the other directories do.

The rpmds* symbols are apparently provided by librpm.

The attached patch resolves the issue for me, though you may have a better method of accomplishing the same thing.

Tags: solaris
Revision history for this message
Tim Mooney (tim-mooney) wrote :
Revision history for this message
Jeff Johnson (n3npq) wrote :

This isn't quite the right patch, but won't hurt anything.

FYI: the design goal is/was to establish all additional libraries
using *.la in this order:
    rpmbuild -> rpmlib -> rpmdb -> rpmio -> rpmmisc
where the majority of additional external libraries are linked
(or included within) -lrpmmisc.

The problem is that libtool and linkers aren't (test, after years of effort) to
get it right.

Meanwhile the patch is included until linkage breaks "the other way". There
have neem like 3-4 flip-flops like your patch in Makefile.am over the years.

Changed in rpm:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Jeff Johnson (n3npq)
milestone: none → 5.4.13
Revision history for this message
Tim Mooney (tim-mooney) wrote :

If it's not the right thing, then let's see if we can get something better! I would rather take a couple iterations to get this right (now) than have this cause problems or even confusion down the road.

Ultimately, the goal of the patch is

- include the necessary libtool glob to append libintl after librpmio, for platforms (like Solaris) that don't have GNU-compatible gettext routines in libc (i.e. an additional library is needed). This is modeled after the way other Makefile.am's are set up in other subdirectories of the RPM source tree.

- include librpm in the link, since rpmconstant requires several of the rpmds* symbols.

I guess it's not clear to me how linking rpmconstant would have worked on any platform before this patch -- it needs rpmdsInit and friends to link. Is it getting librpm automatically on Linux, by virtue of some transitive relationship?

I'm definitely willing to spend more time on this to get it right, but it appears I'll need at least a little coaching, because I don't really understand how it would work (even on Linux) without at least the librpm portion of the patch.

Revision history for this message
Jeff Johnson (n3npq) wrote :

@LTLIBINTL@ isn't needed on linux because the routines are in glibc.

On non-linux systems, like MacOSX and FBSD, its highly likely that
libintl is added implicitly by some other project. Disabling i18 entirely
is another plausible explanation for success without @LTLIBINTL@
in rpmconstant/Makefile.am.

If you wish to try a strictly correct patch, try removing
    @WITH_NEON_LIBS@
and see what happens. There is no a priori need for -lneon in
rpm constant that I am aware of.

What SHOULD happen is that librpmmisc.la
will implicitly supply additional linkage flags (--with-neon=external) or
resolve symbols directly (--with-neon=internal). But the *.la mechanism
is highly dependent on the libtool/automake/autoconf/gettext versions
used.

What also makes it very hard to Do The Right Thing is the need to build
against a very large number of platforms, with various versions of software,
and with a mixture of build options, in order to demonstrate a complete
solution.

Jeff Johnson (n3npq)
Changed in rpm:
milestone: 5.4.13 → 5.4.14
Jeff Johnson (n3npq)
Changed in rpm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.