LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Compile a 64bit library (https://www.linuxquestions.org/questions/solaris-opensolaris-20/compile-a-64bit-library-4175610403/)

abourke 07-22-2017 09:47 AM

Compile a 64bit library
 
Hi,

Im trying to compile the murrine theme engine.
So far I can only make 32bit versions.
I need a 64bit version.

I Downloaded the source here:
https://github.com/GNOME/murrine

And I tried compiling after running this command:
export CFLAGS=-m64

But it only generates a 32bit binary. So how do I make a 64bit version?

Rickkkk 07-22-2017 10:29 AM

Hey abourke - not sure this is going to get the best attention in the Newbie forum. Maybe the Linux - Software or Linux - General forums ?

Sorry I can't be of any help to you.

norobro 07-22-2017 10:46 AM

Are you running a 32 bit distro?

Had to tweak autogen.sh a little, but otherwise it compiled fine here:
Code:

~$ uname -m
x86_64
~/test_area/murrine-master$ file .libs/libmurrine.so
libmurrine.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=31244c9c5ea93d884660a8a96ff078fccead0150, not stripped


abourke 07-23-2017 03:00 AM

Wow! Awesome, Can you show me how to do it?

abourke 07-23-2017 03:02 AM

Im running a 64bit distro (Solaris 11.3)
Problem I have is that Java apps require a 64bit theme engine.
Rest of Solaris uses 32bit gtk2 theme engine.

aragorn2101 07-24-2017 03:33 AM

Please post the output of the following command on your machine:
Code:

uname -a
and please tell us what steps you are exactly following to compile Murrine.

abourke 07-25-2017 05:18 AM

uname -a gives me:
Quote:

SunOS Adventure 5.11 11.3 i86pc i386 i86pc
I unzip the zip file from
https://github.com/GNOME/murrine

Then I change directory to it.

Then I export my path to include
Quote:

export PATH=$PATH:/usr/local/bin
because I was getting this error:
Quote:

configure: error: GNU gettext tools not found; required for intltool
So I compiled it and placed it in /usr/local/bin

To compile Murrine:
Quote:

./configure --target=x86_64-solaris-gcc "CFLAGS=-m64" "CXXFLAGS=-m64" "LDFLAGS=-m64" && make
That returns:
Quote:

Now type 'make' to compile murrine.
Making all in schema
LC_ALL=C /usr/bin/intltool-merge -x -u -c ../po/.intltool-merge-cache ../po murrine.xml.in murrine.xml
Found cached translation database
Merging translations into murrine.xml.
CREATED murrine.xml
Then
Quote:

make install
Returns:
Quote:

Making install in schema
test -z "/usr/local/share/gtk-engines" || /usr/bin/gmkdir -p "/usr/local/share/gtk-engines"
/usr/bin/ginstall -c -m 644 murrine.xml '/usr/local/share/gtk-engines'
test -z "/usr/local/lib/gtk-2.0/2.10.0/engines" || /usr/bin/gmkdir -p "/usr/local/lib/gtk-2.0/2.10.0/engines"
/bin/sh ./libtool --mode=install /usr/bin/ginstall -c libmurrine.la '/usr/local/lib/gtk-2.0/2.10.0/engines'
libtool: install: /usr/bin/ginstall -c .libs/libmurrine.so /usr/local/lib/gtk-2.0/2.10.0/engines/libmurrine.so
libtool: install: chmod +x /usr/local/lib/gtk-2.0/2.10.0/engines/libmurrine.so
libtool: install: /usr/bin/ginstall -c .libs/libmurrine.lai /usr/local/lib/gtk-2.0/2.10.0/engines/libmurrine.la
Finally:
Quote:

file /usr/local/lib/gtk-2.0/2.10.0/engines/libmurrine.so
Returns:
Quote:

ELF 32-bit LSB dynamic lib 80386 Version 1, dynamically linked, not stripped

Rickkkk 07-25-2017 07:04 AM

Hi again abourke - I'll let others here more familiar with Solaris confirm, but it seems to me your uname -a output indicates that you are running a 32-bit version of Solaris. I would have expected to see something resembling "x86_64" somewhere instead of just i386.

See for example the output of the same command on my 64-bit Arch system:

Code:

[rick@RickSP3 ~]$ uname -a
Linux RickSP3 4.11.9-1-ARCH #1 SMP PREEMPT Wed Jul 5 18:23:08 CEST 2017 x86_64 GNU/Linux
[rick@RickSP3 ~]$

... Could this be the root of your problems compiling in 64-bit ?

Can someone confirm ?

pan64 07-25-2017 07:47 AM

yes, it looks like a 32bit system and also the result lib is compiled for a 32bit system.
If I remember well you need to use a cross-compiler to be able to compile for a different target system.

aragorn2101 07-26-2017 12:30 AM

Quote:

SunOS Adventure 5.11 11.3 i86pc i386 i86pc
Yup, 32-bit system it is.

And if I'm not mistaken, if your OS is 64-bit you can cross-compile for a 32-bit system but if the OS is 32-bit you cannot make 64-bit binaries by cross-compiling.

So, you probably need a 64-bit OS.

abourke 07-27-2017 04:47 AM

yes I think it must be 32bit. That explains my problem. I dont know how I missed that. I thought Oracle stopped distributing 32 bit Solaris.

sundialsvcs 07-27-2017 08:43 AM

Quote:

Originally Posted by aragorn2101 (Post 5739930)
And if I'm not mistaken, if your OS is 64-bit you can cross-compile for a 32-bit system but if the OS is 32-bit you cannot make 64-bit binaries by cross-compiling.

Actually, you can. The gcc compiler suite is capable of cross-compiling, but makefiles and so-forth will normally detect that you're running a 32-bit system and default to 32-bit output for the architecture they detect. You must alter the makefile and/or provide additional options to make, in order to do any sort of cross-platform compile (where the target is not to be the present host).

Be mindful, however, that a 32-bit CPU cannot run a 64-bit binary! (But a 64-bit CPU can run a 32-bit binary.)

abourke 07-30-2017 06:21 AM

It looks like it is a 64bit OS after all:

Quote:

isainfo
amd64 i386
So what should I do to compile?

Rickkkk 07-30-2017 09:16 AM

Quote:

Originally Posted by abourke (Post 5741678)
It looks like it is a 64bit OS after all:



So what should I do to compile?

I am unfamiliar with that command, but I'm guessing that it may be reporting that you have 64-bit hardware running a 32-bit OS.

pan64 07-30-2017 10:15 AM

Why do you need a 64bit lib? If you have a 64bit system try to compile this lib on that host.


All times are GMT -5. The time now is 04:58 PM.