Coder Social home page Coder Social logo

Comments (3)

Jehan avatar Jehan commented on June 14, 2024

I can reproduce indeed a link failure during libmypaint-gegl introspection with ld.gold and the link option --as-needed.
By the way binutils-config does not exist on my machine. I assume that's a distribution specific tool. It seems that the equivalent standard way to change the linker would be with CFLAGS="-fuse-ld=gold", right?

Anyway I get a similar error except that the undefined symbol is mypaint_surface_ref here:

/home/jehan/dev/build/libmypaint/gegl/tmp-introspect9pXA2W/.libs/MyPaintGegl-1.3: symbol lookup error: /home/jehan/dev/build/libmypaint/gegl/.libs/libmypaint-gegl.so.0: undefined symbol: mypaint_surface_ref

Now I could not understand the source cause. I tried to play with the options of the command that make is running but did not find what is wrong. Also I am far from being an introspection expert so I don't get all the details of what does this g-ir-scanner command line which breaks (to be run from the gegl/ subdir):

CC="gcc" CFLAGS="-D_POSIX_C_SOURCE=200809L -fuse-ld=gold" LDFLAGS="-Wl,--as-needed -lm" CPPFLAGS="" CXXFLAGS="" /usr/bin/g-ir-scanner --warn-all --pkg="gegl-0.3" --pkg="glib-2.0" --namespace="MyPaintGegl" --nsversion="1.3" --identifier-prefix="MyPaintGegl" --symbol-prefix="mypaint_gegl" --add-include-path="/path/to/src/libmypaint/gegl/.." --add-include-path="/path/to/src/libmypaint/gegl" --add-include-path="./.." --add-include-path="/usr/bin/pkg-config --define-variable=datadir="/usr/local/share" --variable=girdir gobject-introspection-1.0" --namespace=MyPaintGegl --nsversion=1.3 --libtool="/bin/sh ../libtool" --include=GObject-2.0 --include=MyPaint-1.3 --include=Gegl-0.3 --library=libmypaint-gegl.la --library=../libmypaint.la --cflags-begin -I.. -I/path/to/src/libmypaint -I. -I.. -lmypaint --cflags-end /path/to/src/libmypaint/gegl/../glib/mypaint-gegl-glib.h /path/to/src/libmypaint/gegl/mypaint-gegl-surface.h /path/to/src/libmypaint/gegl/../glib/mypaint-gegl-glib.c /path/to/src/libmypaint/gegl/mypaint-gegl-surface.c libmypaint-gegl.la ../libmypaint.la Makefile --output MyPaintGegl-1.3.gir

As soon as you remove "-fuse-ld=gold" or "Wl,--as-needed", it works. So basically if anyone figures out how to run this command successfully with these 2 options, we should be able to fix the Makefile. I spent 30 min on it and did not find any solution.

Also it may simply be a bug in ld.gold. On the web I found similar issues:
https://bugs.archlinux.org/task/40515

from libmypaint.

hartwork avatar hartwork commented on June 14, 2024

By the way binutils-config does not exist on my machine. I assume that's a distribution specific tool. It seems that the equivalent standard way to change the linker would be with CFLAGS="-fuse-ld=gold", right?

-fuse-ld=gold didn't work for me when I tried it first but it seems I can confirm now that

# ./configure CFLAGS="-fuse-ld=gold" LDFLAGS="-Wl,--as-needed" --enable-introspection --enable-gegl
# make clean all

works to trigger the bug.

Also it may simply be a bug in ld.gold. On the web I found similar issues:
https://bugs.archlinux.org/task/40515

Maybe.

What I don't get is why despite line

libmypaint_gegl_la_LIBS = $(GEGL_LIBS)

or

libmypaint_gegl_la_LIBS = $(GEGL_LIBS) ../libmypaint.la

in gegl/Makefile.am, file gegl/.libs/libmypaint-gegl.so does not end up being linked against GEGL or libmypaint, not without gold, not without as-needed, never. Why? See:

# ./configure --enable-introspection --enable-gegl && make clean all
[..]
# lddtree gegl/.libs/libmypaint-gegl.so
libmypaint-gegl.so => gegl/.libs/libmypaint-gegl.so (interpreter => none)
    libm.so.6 => /lib64/libm.so.6
        ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
    libpthread.so.0 => /lib64/libpthread.so.0
    libc.so.6 => /lib64/libc.so.6

That case doesn't error out though.

from libmypaint.

achadwick avatar achadwick commented on June 14, 2024

Closed by 94f059d.

from libmypaint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.