Menu

#6 Linker error on 1.1.3

v1.0_(example)
closed-fixed
linking (1)
5
2019-07-28
2019-06-05
No

I'm noticing linking errors on openSUSE Tumbleweed:

/usr/bin/c++ -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -DNDEBUG -O3 -DNDEBUG -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,libLASi.so.2 -o libLASi.so.2.0.0 CMakeFiles/LASi.dir/drawGlyph.cpp.o CMakeFiles/LASi.dir/glyphMgr.cpp.o CMakeFiles/LASi.dir/psDoc.cpp.o CMakeFiles/LASi.dir/util.cpp.o /usr/lib64/libpangoft2-1.0.so /usr/lib64/libfontconfig.so /usr/lib64/libpango-1.0.so /usr/lib64/libfreetype.so -lm 
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/LASi.dir/psDoc.cpp.o: in function `ContextMgr::~ContextMgr()':
/home/abuild/rpmbuild/BUILD/libLASi-1.1.3/src/contextMgr.h:30: undefined reference to `g_object_unref'
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/LASi.dir/psDoc.cpp.o: in function `LASi::PostscriptDocument::for_each_glyph_do(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void (LASi::PostscriptDocument::*)(std::pair<LASi::PostscriptDocument::GlyphId const, FreetypeGlyphMgr> const&, void*), void*, bool)':
/home/abuild/rpmbuild/BUILD/libLASi-1.1.3/src/psDoc.cpp:502: undefined reference to `g_list_free'
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/libLASi-1.1.3/src/psDoc.cpp:502: undefined reference to `g_list_free'
collect2: error: ld returned 1 exit status

Not sure why this doesn't happen on older targets, but the attached patch solves it for me.

1 Attachments

Discussion

  • Alan W. Irwin

    Alan W. Irwin - 2019-06-06

    On 2019-06-05 11:33-0000 Luigi Baldoni wrote:

    I'm noticing linking errors on openSUSE Tumbleweed:
    [...]
    /home/abuild/rpmbuild/BUILD/libLASi-1.1.3/src/contextMgr.h:30: undefined reference to g_object_unref' [...] /home/abuild/rpmbuild/BUILD/libLASi-1.1.3/src/psDoc.cpp:502: undefined reference tog_list_free'
    /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/libLASi-1.1.3/src/psDoc.cpp:502: undefined reference to `g_list_free'
    collect2: error: ld returned 1 exit status
    ~~~

    Not sure why this doesn't happen on older targets, but the attached patch solves it for me.

    Hi Luigi:

    Thanks for your libLASi-1.1.3 bug report. And good catch!

    I have fixed this issue in our latest svn version of the code (see
    https://sourceforge.net/p/lasi/code/230/). See that link for the
    full analysis including the likely reason why this bug has been
    covered up for at least a decade until now! This fix should get into
    the next bug-fix release for libLASi (which should be fairly soon
    because there is one other minor release issue I want to fix which is
    to include some standard release version macros in LASi.h just in case
    some time further down the road there are more bug fix releases, and
    some programmer wants to distinguish between this release and those
    further possibilities using compiler preprocessing capabilities.)

    I am closing this bug as fixed. Note, that my fix (revision 230) is
    even simpler than yours and is more explicit about the glib-2.0 direct
    dependency so it should be preferred assuming my fix works for you as
    well. But if by some chance my fix does not fix the underlinking
    issue you discovered on openSUSE, I strongly encourage you to open
    this bug report again, and we can take the discussion from there.

    Alan


    Alan W. Irwin

    Programming affiliations with the FreeEOS equation-of-state
    implementation for stellar interiors (freeeos.sf.net); the Time
    Ephemerides project (timeephem.sf.net); PLplot scientific plotting
    software package (plplot.org); the libLASi project
    (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
    and the Linux Brochure Project (lbproject.sf.net).


    Linux-powered Science


     
    • Luigi Baldoni

      Luigi Baldoni - 2019-06-06

      I'm sorry, but r230 doesn't solve the problem with building libLASi itself.

       
      • Alan W. Irwin

        Alan W. Irwin - 2019-06-06

        On 2019-06-06 08:58-0000 Luigi Baldoni wrote:

        I'm sorry, but r230 doesn't solve the problem with building libLASi itself.

        Hi Luigi:

        I now know why r230 was not the correct solution, and I think I know what
        the correct solution is. However, to confirm that I am trying to put together a
        test case (where system pkg-config on Debian Buster does not reference
        gobject-2.0 or glib-2.0 similar to the openSUSE result), but I haven't
        finalized that test case. But when I do, I expect to be able to
        replicate not only the error you found, but also verify my planned fix
        solves the libLASi underlinking issue for that test case. I also plan to
        fix a number of other small libLASi issues before releasing 1.1.4.
        But just before finalizing that release (likely next week) I will ask
        you to test that result just to confirm that 1.1.4 will be working
        correctly on openSUSE.

        Until then,

        Alan

         
  • Alan W. Irwin

    Alan W. Irwin - 2019-06-06
    • status: open --> closed-fixed
     
  • Alan W. Irwin

    Alan W. Irwin - 2019-06-08
    • status: closed-fixed --> open
     
  • Alan W. Irwin

    Alan W. Irwin - 2019-06-08

    Since the original fix in r230 was not correct, and because it is taking several days to fix this issue properly, change status appropriately.

     

    Last edit: Alan W. Irwin 2019-06-08
  • Alan W. Irwin

    Alan W. Irwin - 2019-07-27
    • status: open --> closed-fixed
    • assigned_to: Alan W. Irwin
     
  • Alan W. Irwin

    Alan W. Irwin - 2019-07-27

    I am changing the status of this bug report to closed-fixed since all my extensive testing on Debian Buster indicates that is the case. And I have decided to move ahead with the forthcoming release of 1.1.4 in the next few days based on this bug fix (and several other less important bug fixes). However, if you do have time to test revision 233 in exactly the way I indicated for your other bug report in the next few days, that should provide helpful confirmation for the release that this linking bug is now gone on all Linux platforms.

     
    • Luigi Baldoni

      Luigi Baldoni - 2019-07-28

      I can confirm this bug to be fixed in r233.

       

Log in to post a comment.