LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   libgdiplus (2.10.9) Slackbuild fails (https://www.linuxquestions.org/questions/slackware-14/libgdiplus-2-10-9-slackbuild-fails-4175529346/)

metaschima 12-27-2014 12:41 PM

libgdiplus (2.10.9) Slackbuild fails
 
So I'm trying to compile this mono dependency and I'm having problems on Slackware64 14.1.

http://slackbuilds.org/repository/14...es/libgdiplus/
Code:

make[2]: Leaving directory `/tmp/SBo/libgdiplus-2.10.9/src'
Making all in tests
make[2]: Entering directory `/tmp/SBo/libgdiplus-2.10.9/tests'
gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -I../src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm      -I/usr/include/freetype2    -I/usr/include/libexif      -O2 -fPIC -pthread -MT testgdi.o -MD -MP -MF .deps/testgdi.Tpo -c -o testgdi.o testgdi.c
mv -f .deps/testgdi.Tpo .deps/testgdi.Po
/bin/sh ../libtool --tag=CC  --mode=link gcc  -O2 -fPIC -pthread  -o testgdi testgdi.o ../src/libgdiplus.la -lpthread -lfontconfig -lm -ldl
libtool: link: gcc -O2 -fPIC -pthread -o .libs/testgdi testgdi.o  ../src/.libs/libgdiplus.so -lpthread /usr/lib64/libfontconfig.so -lm -ldl -pthread
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: testgdi.o: undefined reference to symbol 'g_free'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: note: 'g_free' is defined in DSO /usr/lib64/libglib-2.0.so.0 so try adding it to the linker command line
/usr/lib64/libglib-2.0.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [testgdi] Error 1
make[2]: Leaving directory `/tmp/SBo/libgdiplus-2.10.9/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/SBo/libgdiplus-2.10.9'
make: *** [all] Error 2

I propose the following patch
Code:

--- libgdiplus.SlackBuild        2014-12-27 12:39:07.360499783 -0600
+++ libgdiplus.SlackBuild.new        2014-12-27 12:39:46.785006909 -0600
@@ -71,6 +71,7 @@
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
+LIBS="$LIBS -lglib-2.0 -lX11"
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
 ./configure \
@@ -83,11 +84,6 @@
  --disable-static \
  --build=$ARCH-slackware-linux
 
-# Quick fix borrowed from:
-# https://www.slacky.eu/asche64/pkgreports/
-sed -i "s/^LIBS = -lpthread -lfontconfig $/\
-          LIBS = -lpthread -lfontconfig -lglib-2.0 -lX11/" tests/Makefile
-
 make
 make install-strip DESTDIR=$PKG

This seems to work fine.

willysr 12-27-2014 01:01 PM

perhaps you are running multilib?
Code:

/usr/lib64/libglib-2.0.so.0: could not read symbols: Invalid operation

metaschima 12-27-2014 01:29 PM

Not running multilib, it does the same thing on all my systems, only one of them has multilib and there is no difference.

willysr 12-27-2014 02:08 PM

can you check if you have x86 packages installed on your x86_64 machine?
i have just successfuly build libgdiplus on slackware64-14.1 VM

Code:

libgdiplus:
  MD5SUM check for libgdiplus-2.10.9.tar.bz2 ... OK
  Building package libgdiplus-2.10.9-x86_64-2_SBo.tgz ... OK


metaschima 12-27-2014 02:15 PM

On my current machine I have no 32-bit packages and no 32-bit support enabled, the error also is not about 32-bit.

55020 12-27-2014 02:20 PM

It builds fine here, and that patch does not do what you think it does.

When you set LIBS="$LIBS -lglib-2.0 -lX11", LIBS is a bash variable that is ignored by the Makefile. The Makefile ignores any environment variable named LIBS, but your bash variable is not even an environment variable. You probably wanted to say LDFLAGS instead of LIBS, and you should have put a backslash at the end of the line to make it an environment variable, and if you had done all that... it would have had the same effect as the sed command in the original SlackBuild.

In fact, the sed command exists to solve your real problem, which is this classic "underlinking" error:
Quote:

/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: testgdi.o: undefined reference to symbol 'g_free'
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: note: 'g_free' is defined in DSO /usr/lib64/libglib-2.0.so.0 so try adding it to the linker command line
... and the original SlackBuild with the sed command works fine here. It's almost as if you were not using the original SlackBuild to begin with...

metaschima 12-27-2014 03:21 PM

I think I found something relevant, if I unset LIBS, the slackbuild works. I set
Code:

export LIBS="-lm -ldl"
in .bashrc. This is to fix some builds that don't export these, kinda like this one, but in this case it is a different library.

Either way I don't like the quick fix in this slackbuild, a better fix is needed.


All times are GMT -5. The time now is 12:47 PM.