Results 1 to 6 of 6

Thread: How to understand or How to check whether o software is 32 or 64 bit

  1. #1
    Join Date
    Dec 2013
    Beans
    105
    Distro
    Xubuntu

    Question How to understand or How to check whether o software is 32 or 64 bit

    Hello everybody,

    I recently was able to install the Geekbench software by using the help provided in this forum (older posts)
    I was not able to install it on my own however because the 32 bit library was missing.

    My question is this, by seeing the below how can i understand or suspect that i am missing a library


    [IMG]/home/hariton/Pictures/Screenshot_2021-10-13_17-31-30.png[/IMG]


    Thanks in advance!

    Edit: for a reason the picture do not work. however what i see in the folder is:
    geekbench5 (green color, thus executable)
    geekbench.plar (white color)
    geekbench_x86_64 (green color, thus executable)
    Last edited by charitosha; October 13th, 2021 at 03:45 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to understand or How to check whether o software is 32 or 64 bit

    Use the "file" command.

    I found a very old backup of a 16.04 desktop that was 32-bit:
    Code:
    # file esniper 
    esniper: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cebbc46154d476652a57ae05666eff10ceb7c342, with debug_info, not stripped
    When I try to run it on a 20.04 system (64-bit only), I see
    Code:
    $ esniper 
    esniper: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
    However, that library as a 64-bit version, exists on the machine:
    Code:
    $ ll /usr/lib/x86_64-linux-gnu/libcurl.so*
    lrwxrwxrwx 1 root root     16 Sep 10 10:28 /usr/lib/x86_64-linux-gnu/libcurl.so.4 -> libcurl.so.4.6.0
    -rw-r--r-- 1 root root 588424 Sep 10 10:28 /usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0
    The 'file' for that library:
    Code:
    $ file /usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0 
    /usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c74e00b5bbd2ef8308c8c53e4e8a0385604ee2b4, stripped
    My 16.04 32-bit backup doesn't have system stuff, so I can't find libcurl.so.4 under /usr/lib/ . I don't backup that area on my systems. I do backup /usr/local/*, but not things that would be installed with a normal installation and patch cycle. Sorry.

    Not certain I've answered your question, but use 'file' to check any compiled library or program for the architecture it uses.

    Just for fun, I looked on a Raspberry Pi - that's an ARM CPU.
    Code:
    $ file /usr/lib/arm-linux-gnueabihf/libcurl.so.4.5.0
    /usr/lib/arm-linux-gnueabihf/libcurl.so.4.5.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=d8406507a355832fb2cc13712575f2dc603dcb7d, stripped
    32-bit ... because that CPU is 32-bit.

    Compiled library and program developers have to worry about these things all the time. Basically it is for C/C++/C#/pascal/rust people. Java and all the scripted language devs don't have to worry about this.

  3. #3
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,471

    Re: How to understand or How to check whether o software is 32 or 64 bit

    Similarly, you can use ldd to list all the shared libraries called by a program.

  4. #4
    Join Date
    Dec 2013
    Beans
    105
    Distro
    Xubuntu

    Re: How to understand or How to check whether o software is 32 or 64 bit

    Thanks both of you for the reply!

    What i like from the ldd command is that it list all the required shared libraries (which is very nice), however the manpages state that it is somewhat dangerous because it might execute the program as well. And due to this, they suggest to use objdump command.
    Now im not quite sure how "real" the threat is with the ldd, but with objdump you can find out pretty much anything you might need. it is a bit complected thought

    Lastly, the file command is very helpful as well.

    I am not going to close this thread yet, because i would like to ask something about the file and objdump commands

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to understand or How to check whether o software is 32 or 64 bit

    I've always used nm and ar for looking inside libraries. I don't remember them showing 32/64-bitness. Those two tools don't work on programs, just libraries.

  6. #6
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,113

    Re: How to understand or How to check whether o software is 32 or 64 bit

    As you have seen, ldd will identify libraries such as:
    Code:
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb7688000)
    but that's only half the job - you also need to identify what package provides that library.

    Without using any special utilitity, that's here:
    https://packages.ubuntu.com

    Also, ldd may not show all the required 32-bit libraries. I have installed 32-bit games where it doesn't.
    Attached Images Attached Images

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •