#143 linking and undefined non-weak symbols

release_3.10.x
closed
None
5
2012-09-15
2006-10-13
Ed Hill
No

Hi folks!

I'm a relatively new IT++ user and I'd like to start
by thanking everyone for such a cool and useful tool!

In the process of packaging IT++ for the Fedora
Extras project:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207782
http://fedoraproject.org/wiki/Extras/

we discovered that IT++ is linked with gcc using
the -nostdlib argument which results in undefined
non-weak symbols for the library. This is a minor
detail (apparently, many packages behave similarly)
but it might be something that you could address in
future releases.

The main benefits that one would get from the
elimination of the undefined non-weak symbols are
better support from the "prelink" utility used in
some Linux distros, the ability to link with just a
single "-litpp" instead of all the dependent libs,
and more automatic discovery of dependent libs by
tools such as RPM. Details of all these things are
discussed in the submission repurt (bugzilla entry)
above.

So again, many thanks for IT++ !

Discussion

  • Adam Piątyszek

    Adam Piątyszek - 2006-10-13

    Logged In: YES
    user_id=1004597

    Hi Ed!

    Thanks for your work on IT++ RPM package for Fedora. It
    seems that Fedora Core will be the second distribution with
    IT++ on board.

    Since I am the only IT++ developer who prepared the new
    configuration scheme using autotools, I am open for your
    valuable comments in this field.

    To the point...
    I have followed the bug report on RedHat bugzilla and fixed
    the easiest thing: The executable rights of itpp_version.h
    are now 0644 in IT++ SVN repository. Now, I am going to work
    and clean up the redundant libs in itpp-config script and
    itpp.pc file. Just have to test if everything works in non
    standard configurations and installations. So, next IT++
    stable version (3.10.6) should be free of these problems.

    But, I need your help with this "-nostdlib" argument used in
    IT++ linking process. Do you happen to know how to fix this
    properly in an package that use autoconf/automake/libtool
    for portable build process?
    I only managed to find out that this "-nostdlib" switch is
    added when "configure" is created by autoconf...

    Look forward to hearing from you soon!

    BR,
    /ediap

     
  • Ed Hill

    Ed Hill - 2006-10-14

    Logged In: YES
    user_id=79627

    Hi ediap,

    I've looked into it a bit further and these links:

    http://www.ugcs.caltech.edu/manuals/devtool/automake-1.9.6/automake_55.html
    http://www.mail-archive.com/bug-automake@gnu.org/msg00640.html

    describe how the automake/libtool combination
    determine which linker (eg.: ld, gcc, g++) to use
    at any particular point during the build.

    In the file:

    /home/edhill/src/itpp/itpp-svn/itpp/Makefile.am

    the gcc tool is chosen since automake/libtool do not
    "see" the C++ language dependency. So, by adding a
    few lines such as:

    ===================================================================
    --- Makefile.am (revision 676)
    +++ Makefile.am (working copy)
    @@ -42,11 +42,15 @@
    endif

    lib@PACKAGE@_la_SOURCES =
    +# Dummy C++ source to cause C++ linking.
    +nodist_EXTRA_lib@PACKAGE@_la_SOURCES = dummy.cxx
    lib@PACKAGE@_la_LDFLAGS = -version-info
    $(GENERIC_LIBRARY_VERSION)
    lib@PACKAGE@_la_LIBADD =
    $(top_builddir)/@PACKAGE@/base/libbase.la \ $(COMM_LIB) $(FIXED_LIB) $(PROTOCOL_LIB)
    $(SIGNAL_LIB) $(SRCCODE_LIB)

    lib@PACKAGE@_debug_la_SOURCES =
    +# Dummy C++ source to cause C++ linking.
    +nodist_EXTRA_lib@PACKAGE@_debug_la_SOURCES = dummy.cxx
    lib@PACKAGE@_debug_la_LDFLAGS = -version-info
    $(GENERIC_LIBRARY_VERSION)
    lib@PACKAGE@_debug_la_LIBADD =
    $(top_builddir)/@PACKAGE@/base/libbase_debug.la \ $(COMM_D_LIB) $(FIXED_D_LIB) $(PROTOCOL_D_LIB)
    $(SIGNAL_D_LIB) \

    it forces automake/libtool to recognize the C++
    dependency and, as a result, use a C++ linker.

    Now, I'm not suggesting that the above is the best fix.
    Its just one quick possible way. I think it might (?)
    be better to specify an actual C++ file instead of the
    dummy one. But thats just a minor detail... :-)

    Anyway, thank you so much for taking the time to sort
    through that (long-ish) Fedora submission and fix the
    one little permission issue. I'll keep an eye on the
    IT++ releases and update the FE RPM when the next one
    ships [btw, is there some place I can sign up for
    email alerts when new IT++ releases happen?]
    .

    Oh, and is there any chance that Fedora could be
    mentioned along with Gentoo on the main web page?
    With the "itpp" package now in Fedora Extras, users
    can simply run:

    sudo yum install itpp-devel itpp-doc

    and they'll have it!

    Ed

     
  • Adam Piątyszek

    Adam Piątyszek - 2006-10-15

    Logged In: YES
    user_id=1004597

    Hi Ed!

    Thans for your prompt ansewer and valuable hints how to
    solve the linking problem.
    Since, there are no C++ source files in "itpp" subdirectory,
    I decided to use this dummy solution, described in the
    automake manual. This fixes the problem of undefined symbols.

    Besides, I have also had a look at itpp.pc and itpp-config
    issues, and I am afraid the explicit external libs, which
    are found during the configuration process are necessary for
    static linking. And, since IT++ can be only linked as a
    static library under Cygwin or MinGW, I can not clean up
    this libs.

    As for the new release announcements, you can use the RSS
    feed from IT++ web pages, where news are posted after each
    important change/release. Besides, you can monitor the files
    released in the SourceForge service by using the "Monitor"
    option of the interesting package, for instance to monitor
    "itpp" package you need to click this link:
    https://sourceforge.net/project/filemodule_monitor.php?filemodule_id=29334

    BTW, we are planning to publish 3.10.6 bug-fix release
    either tonight or within next 2-3 days.

    As for the information with FC packages, I would be glad if
    you could prepare a short description, similar to the one
    about Gentoo ebuilds and send it to my private email. You
    can click the following link to see the wiki source of the
    page:
    http://itpp.sourceforge.net/index.php?wiki=Download&edit=Yes

    BR,
    /ediap

    PS. I am closing this bug report with status Fixed.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks