LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Problem building fst on a multilib system (http://www.linuxquestions.org/questions/slackware-14/problem-building-fst-on-a-multilib-system-4175448770/)

insectiod 02-05-2013 06:14 PM

Problem building fst on a multilib system
 
Im using Slackware 14.0 64 bit, and I installed the multilib packages from Alien Bob, following his guide. It seems to work fine because I could build both 32 bit wine and 32 bit jack-audio-connection-kit without any problems. However when I try to build the package fst from slackbuilds.org I run into trouble.

This is the error message I get:

Code:

winegcc -mwindows -o fst audiomaster.o fst.o fstinfofile.o gtk.o jfst.o fpsparser.o vstwin.o    -L/usr/lib32 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgi
o-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 -ljack -lpthread -lrt  -L/
usr/X11R6/lib -lpthread -lrt -lX11 -m32  -luuid
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/X11R6/lib/libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib/libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/../lib/libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib64/libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libjack.so when searching for -ljack
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: cannot find -ljack
collect2: error: ld returned 1 exit status
winegcc: gcc failed
make: *** [fst] Error 2

So there is a problem with libjack.so. But I do have a 32 bit version of that library installed:
Code:

>>>grep libjack /var/log/packages/jack-audio-connection-kit-compat32-0.121.3-x86_64-1_SBocompat32
usr/lib/libjack.la
usr/lib/libjackserver.so.0.0.28
usr/lib/libjackserver.la
usr/lib/libjack.so.0.0.28
>>>ls -l /usr/lib/libjack.so
lrwxrwxrwx 1 root root 17 Feb  6 00:26 /usr/lib/libjack.so -> libjack.so.0.0.28

So why doesn't it build?

psionl0 02-05-2013 06:36 PM

It looks like you didn't edit the slackbuild and change the line that has
LIBDIRSUFFIX="64" to
LIBDIRSUFFIX=""

Don't forget to run ". /etc/profile.d/32dev.sh" (including the dot) first.

insectiod 02-05-2013 09:06 PM

Thanks, I actually did edit the slackbuild like you explained. Here's what I did:

Code:

>. /etc/profile.d/32dev.sh
>which gcc
/usr/bin/32/gcc

Edit the slackbuild:
added this line:
Code:

ARCH=x86_64
And changed this part:
Code:

elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX=""

Running the slackbuild script it creates the package without problems:
Code:

Slackware package /tmp/jack-audio-connection-kit-0.121.3-x86_64-1_SBo.tgz created
Code:

>sudo convertpkg-compat32 -i /tmp/jack-audio-connection-kit-0.121.3-x86_64-1_SBo.tgz
Package created:  /tmp/jack-audio-connection-kit-compat32-0.121.3-x86_64-1_SBocompat32.txz

Code:

>sudo installpkg /tmp/jack-audio-connection-kit-compat32-0.121.3-x86_64-1_SBocompat32.txz
>file /usr/lib/libjack.so.0.0.28
/usr/lib/libjack.so.0.0.28: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

The part that confuses me is that according to the instructions here, under the headline compiling 32bit programs, it says that I should set ARCH to x86_64. I tried building it with the ARCH=i686 instead and I do get a 32 bit version of libjack. But if possible it would be nice not to overwrite the 64 bit version of jack, which I suspect will happen if I just install the i686 version. How is multilib compiling supposed to work, should a 32 bit package be build because i run /etc/profile.d/32dev.h, even though the the ARCH variable is set to 64?

ponce 02-05-2013 11:29 PM

If a 32bit application needs some other 32bit dep to build that is not in standard slackware, and then not in the compat32 packages distributed by Alien, general path to follow is to install its x86_64 version and the corrisponding compat32 package together.

This is more or less how I do it:
I have three of them that I use this way here, OpenAL, jack and lua (I use the first two for wine and the other for etlegacy): for each of them I built a 32bit package on a slackware 32bit virtual machine (I don't usually build 32bit packages on multilib) that I after converted on the target system in a compat32 package on the target system with multilib with
Code:

convertpkg-compat32 -i my32bitpackage.txz
and I installed there both the resulting package and the x86_64 version.

Then, to build wine, I source /etc/profile.d/32dev.sh and I use ARCH=x86_64: the resulting binary is 32bit
Code:

$ file /usr/bin/wine                   
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped


psionl0 02-06-2013 02:07 AM

Quote:

Originally Posted by insectiod (Post 4885181)
Thanks, I actually did edit the slackbuild like you explained. Here's what I did:
< - - - snip - - ->
Code:

>sudo convertpkg-compat32 -i /tmp/jack-audio-connection-kit-0.121.3-x86_64-1_SBo.tgz

Did you use sudo for making your package?

I suspect that each time you ran sudo you lost the environment that was setup by . /etc/profile.d/32dev.sh so that although it used /usr/lib instead of /usr/lib64 it still generated a 64-bit package.

Run su - and THEN run . /etc/profile.d/32dev.sh and it should generate a 32-bit library. (Don't forget that dot at the beginning is important).

psionl0 02-06-2013 02:40 AM

Quote:

Originally Posted by insectiod (Post 4885181)
How is multilib compiling supposed to work, should a 32 bit package be build because i run /etc/profile.d/32dev.h, even though the the ARCH variable is set to 64?

Yes.

Just to test it out, I made both 32-bit and 64-bit versions of jack-audio-connection-kit and it worked:
Code:

~# ls /var/log/packages/jack*
/var/log/packages/jack-audio-connection-kit-0.121.3-x86_64-1_SBo
/var/log/packages/jack-audio-connection-kit-compat32-0.121.3-x86_64-1_SBocompat32
~# file /usr/lib64/libjack.so.0.0.28
/usr/lib64/libjack.so.0.0.28: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
~# file /usr/lib/libjack.so.0.0.28
/usr/lib/libjack.so.0.0.28: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped


insectiod 02-06-2013 04:43 AM

Thanks psionl0, you where right, changing user to root and then sourcing /etc/profile.d/32dev.sh and running the slackbuild fixed the problem.

Just out of curiosity, does anyone know the purpose of setting ARCH to x86_64? I tried setting it to i686 and that also worked in this case.

psionl0 02-06-2013 07:44 AM

It looks like problem [SOLVED] ;). Alien Bob is smarter than me so if he says, set ARCH to x86_64 then I set ARCH to x86_64.

BTW the only time I use sudo is when I select a menu item or click on a WBAR icon that needs root privileges to run (eg "shutdown"). From the terminal, I almost always use su.

phenixia2003 02-06-2013 07:57 AM

Hello,

Quote:

Originally Posted by insectiod (Post 4885385)
Thanks psionl0, you where right, changing user to root and then sourcing /etc/profile.d/32dev.sh and running the slackbuild fixed the problem.

Just out of curiosity, does anyone know the purpose of setting ARCH to x86_64?

This is clearly explained into the section "Compiling 32-bit programs" from Eric's multilib wiki page :

Quote:

1. You will have to define the ARCH variable as 'x86_64' even though you are compiling a 32-bit program!
This is related to the triplet of “$ARCH-slackware-linux” which is normally used in the “configure” command. Also, try setting the ARCH to for instance “i486” and you will see that the CFLAGS definition for that architecture will result in gcc errors like ”compiler can not create executables”. This is related to the design of a SlackBuild script. Rather than editing the script and change/remove CFLAGS definitions, you can set the ARCH to “x86_64” and save yourself some time. The real work is being done by the 32dev.sh script.
Cheers.

--
SeB


All times are GMT -5. The time now is 06:06 AM.