Menu

#559 GraphicsMagick 1.3.29 build fails at linking time with many "undefined reference" errors

v1.0_(example)
closed-invalid
None
5
2018-05-15
2018-05-14
No

Trying to build GraphicsMagick 1.3.29 for Rosa Linux Fresh R10 (a Mandriva derivative) x86_64.
Our build process always passes the --no-undefined option to the linker, but this with 1.3.29 causes the build to fail at linking time with many "undefined references".

This happens in two distinct spots:
1) while linking libGraphicsMagickWand.so.2.9.0:


libtool: relink: gcc -shared -Wl,--as-needed -fPIC -DPIC wand/.libs/wand_libGraphicsMagickWand_la-drawing_wand.o wand/.libs/wand_libGraphicsMagickWand_la-magick_compat.o wand/.libs/wand_libGraphicsMagickWand_la-magick_wand.o wand/.libs/wand_libGraphicsMagickWand_la-pixel_wand.o -fopenmp -O2 -gdwarf-4 -fstack-protector -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,now -Wl,-z -Wl,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -Wl,--hash-style=gnu -fopenmp -pthread -Wl,-rpath -Wl,/usr/lib64 -L/usr/lib64 -L/tmp/abf/rpmbuild/BUILDROOT/graphicsmagick-1.3.29-1-rosa2016.1.x86_64-buildroot/usr/lib64 -lGraphicsMagick -llcms2 -lfreetype -lXext -lSM -lICE -lX11 -llzma -lbz2 -lz -lltdl -lgomp -lpthread -lm -Wl,-soname -Wl,libGraphicsMagickWand.so.2 -Wl,-version-script -Wl,wand/.libs/libGraphicsMagickWand.ver -o wand/.libs/libGraphicsMagickWand.so.2.9.0
wand/.libs/wand_libGraphicsMagickWand_la-drawing_wand.o: In function MagickDrawGetClipPath': /tmp/abf/rpmbuild/BUILD/GraphicsMagick-1.3.29/wand/drawing_wand.c:857: undefined reference toDrawInfoGetClipPath'
wand/.libs/wand_libGraphicsMagickWand_la-drawing_wand.o: In function MagickDrawSetClipPath': /tmp/abf/rpmbuild/BUILD/GraphicsMagick-1.3.29/wand/drawing_wand.c:896: undefined reference toDrawInfoGetClipPath'
collect2: error: ld returned 1 exit status


See the attached full log of a failed build.

2) While compiling auto/Graphics/Magick/Magick.so, with a boatload of undefined references warnings about a bunch of Perl_* symbols:


Perl_xs_version_bootcheck Perl_sv_2iv_flags Perl_sv_setnv Perl_stack_grow Perl_av_len Perl_my_cxt_init Perl_warn_nocontext PL_thr_key Perl_sv_setpv Perl_newSVnv Perl_sv_bless Perl_sv_2pv_flags PL_charclass Perl_sv_isobject Perl_croak_xs_usage Perl_sv_2nv_flags Perl_av_push Perl_newSVpv Perl_get_sv Perl_croak_nocontext Perl_call_list Perl_xs_apiversion_bootcheck Perl_mg_set Perl_newXS_flags Perl_sv_2mortal Perl_sv_2io Perl_av_fetch Perl_newRV Perl_newSV_type Perl_sv_catpv Perl_sv_free2 Perl_newSViv Perl_sv_setiv Perl_sv_newmortal


This one does not seem to affect the linking step, though...

I can easily workaround both underlinking issues by making our build system to not pass --no-undefined to the linker; however I'm signaling it here because I'm not sure that all the symbols missing at build time will be present at run time to avoid troubles to the final user...
If all the above symbols are provided by some internal GraphicsMagick component and then always present at runtime, this issue could be moot.

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2018-05-14

    On Mon, 14 May 2018, Giovanni Mariani wrote:

    Trying to build GraphicsMagick 1.3.29 for Rosa Linux Fresh R10 (a Mandriva derivative) x86_64.
    Our build process always passes the --no-undefined option to the linker, but this with 1.3.29 causes the build to fail at linking time with many "undefined references".

    The DrawInfoGetClipPath() function is a new function added to
    libGraphicsMagick for this release. The most likely cause of the
    problem is that there is a previously existing libGraphicsMagick.so on
    the system which is being used by mistake while linking.

    Pay close attention to -I and -L options which mention installed
    system directories. At first glance at the build log I see that
    -I/usr/include and -L/usr/lib64 (which should already be defaults for
    the compiler) are being used. These seem suspect to me.

    Bob

     
  • Giovanni Mariani

    You are right: removing the previous libraries from my build system fixed the issue...
    I guess this ticked can be closed: sorry for the noise.

     
    • Bob Friesenhahn

      Bob Friesenhahn - 2018-05-14

      On Mon, 14 May 2018, Giovanni Mariani wrote:

      You are right: removing the previous libraries from my build system fixed the issue...
      I guess this ticked can be closed: sorry for the noise.

      It does indicate that there is a weakness in the build system.

      Hopefully it is not induced by libtool as delivered with
      GraphicsMagick (you are using a modified libtool).

      Bob

       
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-05-15
    • status: open --> closed-invalid
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-05-15

    Build was using older GraphicsMagick library from system.

     

Log in to post a comment.

MongoDB Logo MongoDB