Execute i386 program on x86-64?
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Execute i386 program on x86-64?

    I archived some 32-bit gfortran and nasm code seven years ago to which I'd like to make some changes, but first I'd like to execute it as is for a starting point. All coding, compiling, and linking was done in Fedora.

    [mrice@localhost test]$ test
    [mrice@localhost test]$

    No error messages, but no output either. Is there a way to get the 32-bit code to run on a 64-bit cpu? I'm currently using Fedora 27.

    Michael

  2. #2
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    705
    Windows 7 Chrome 69.0.3497.100

    Re: Execute i386 program on x86-64?

    Most likely you're running the system "/usr/bin/test" rather than your actual binary as the output you've given is the expected behavior of it. Run "./test" to run the binary in the current path.

    If that works it should run or give errors, "ldd ./test" might help pinpoint missing libraries if needed.

  3. #3
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Re: Execute i386 program on x86-64?

    [mrice@localhost ~]$ cd test
    [mrice@localhost test]$ ls test
    test
    [mrice@localhost test]$ ./test
    bash: ./test: No such file or directory
    [mrice@localhost test]$

    Test is of type: executable (application/x-executable) . It's colored green in the third line above.

    [mrice@localhost test]$ ld ./test
    ld: i386 architecture of input file `./test' is incompatible with i386:x86-64 output
    ld: error in ./test(.eh_frame); no .eh_frame_hdr table will be created.
    [mrice@localhost test]$

    Perhaps install some i386 I/O libraries?

    Michael

  4. #4
    Join Date
    Jul 2010
    Location
    western PA
    Posts
    188
    Linux (Fedora) Firefox 62.0

    Re: Execute i386 program on x86-64?

    install glibc.i686 package and the i686 versions of any other required libraries.

  5. #5
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Re: Execute i386 program on x86-64?

    I poked around this morning and found the same suggestion.

    glibc.i686 installed.

    [mrice@localhost ~]$ cd test
    [mrice@localhost test]$ ./test
    ./test: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

    [mrice@localhost test]$ dnf provides libgfortran.so.3
    Last metadata expiration check: 1 day, 10:34:58 ago on Mon 01 Oct 2018 08:31:18 PM EDT.
    Error: No Matches found

  6. #6
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Re: Execute i386 program on x86-64?

    [mrice@localhost test]$ dnf provides libgfortran.so.4
    Last metadata expiration check: 1 day, 10:50:53 ago on Mon 01 Oct 2018 08:31:18 PM EDT.
    libgfortran-7.3.1-6.fc27.i686 : Fortran runtime
    Repo : updates
    Matched from:
    Provide : libgfortran.so.4

    Superceded.

    Lost cause?

  7. #7
    Join Date
    Oct 2006
    Location
    CN99CF Agassiz BC Canada
    Posts
    398
    Linux (Fedora) Firefox 60.0

    Re: Execute i386 program on x86-64?

    If you still have the source code that was used to link the 'test' program, you could likely get to success by installing the required fortran 686 library and recompiling / linking the source code. This should result in a program that runs. Then go forward ...

    You might also consider adding ./ into your PATH.

  8. #8
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Re: Execute i386 program on x86-64?

    Not sure mixing two versions of the same library is a good idea, as it assumes that nothing else but that one component was changed.

    I have a a couple of paths I can take. I'm trying to avoid rewriting the 13 NASM functions for 64-bit before I do a benchmark run using the initial 32-bit NASM code. The fortran code produces initial data structures and changes them using the NASM primitives, so the match up must be perfect.

    I'll be back.

    Michael

  9. #9
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    705
    Windows 7 Chrome 69.0.3497.100

    Re: Execute i386 program on x86-64?

    Use ln to make a link called libgfortran.so.3 pointing to libgfortran.so.4, 9 times out of 10 the old functions the executable uses aren't deprecated in the new library. Alternatively recompile the source for the executable to use the new library.

  10. #10
    Join Date
    Nov 2006
    Location
    Detroit
    Posts
    6,732
    Linux (Fedora) Firefox 62.0

    Re: Execute i386 program on x86-64?

    Quote Originally Posted by mjrice
    [mrice@localhost test]$ ./test
    ./test: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
    Not a lost cause. The libgfortran.i686 from Fedora 20 has /usr/lib/libgfortran.so.3. You can install it and its dependency (libquadmath) like this:
    Code:
    dnf install http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/20/Everything/i386/os/Packages/l/libgfortran-4.8.2-1.fc20.i686.rpm http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/20/Everything/i386/os/Packages/l/libquadmath-4.8.2-1.fc20.i686.rpm
    OS: Fedora 28 x86_64 | Machine: HP Pavilion a6130n | CPU: AMD 64 X2 Dual-Core 5000+ 2.6GHz | RAM: 7GB PC5300 DDR2 | Disk: 400GB SATA | Video: ATI Radeon HD 4350 512MB | Sound: Realtek ALC888S | Ethernet: Realtek RTL8201N

  11. #11
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Re: Execute i386 program on x86-64?

    Error: Transaction check error:
    file /usr/share/info/libquadmath.info.gz from install of libquadmath-4.8.2-1.fc20.i686 conflicts with file from package libquadmath-7.3.1-5.fc27.x86_64

    Error Summary
    -------------

    [root@localhost mrice]#

    --------------------------

    [root@localhost mrice]# dnf install http://archives.fedoraproject.org/pu....fc20.i686.rpm http://archives.fedoraproject.org/pu....fc20.i686.rpm
    Fedora 27 - x86_64 - Updates 28 kB/s | 26 MB 15:55
    google-chrome 1.5 kB/s | 3.7 kB 00:02
    Last metadata expiration check: 0:00:00 ago on Fri 05 Oct 2018 08:09:28 AM EDT.
    libgfortran-4.8.2-1.fc20.i686.rpm 13 kB/s | 258 kB 00:19
    libquadmath-4.8.2-1.fc20.i686.rpm 15 kB/s | 233 kB 00:15
    Dependencies resolved.
    ================================================== ================================================== ================================================== ================================================== ==========
    Package Arch Version Repository Size
    ================================================== ================================================== ================================================== ================================================== ==========
    Installing:
    libgfortran i686 4.8.2-1.fc20 @commandline 258 k
    libquadmath i686 4.8.2-1.fc20 @commandline 233 k

    Transaction Summary
    ================================================== ================================================== ================================================== ================================================== ==========
    Install 2 Packages

    Total size: 492 k
    Installed size: 1.5 M
    Is this ok [y/N]: y
    Downloading Packages:
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Error: Transaction check error:
    file /usr/share/info/libquadmath.info.gz from install of libquadmath-4.8.2-1.fc20.i686 conflicts with file from package libquadmath-7.3.1-5.fc27.x86_64

    Error Summary
    -------------

    [root@localhost mrice]#

  12. #12
    Join Date
    Jun 2007
    Posts
    319
    Linux (Fedora) Chrome 67.0.3396.99

    Re: Execute i386 program on x86-64?

    I viewed /usr/share/info/libquadmath.info.gz and it seems to be just a rudimentary user's guide.

    I renamed my archived folder from test to test2011, to better identify it.

    Executing the file again yields the same error as before:

    [mrice@localhost test2011]$ ./test
    ./test: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory

    Is there's something else I must do before I can proceed?

    MIchael

Similar Threads

  1. Execute a program as another user
    By tnetaji in forum Security and Privacy
    Replies: 10
    Last Post: 9th November 2017, 12:45 PM
  2. Please execute this program on your Fedora and help me
    By Prasath in forum Programming & Packaging
    Replies: 4
    Last Post: 12th February 2016, 11:42 AM
  3. Execute my program by ordinary user
    By mlyczko in forum Security and Privacy
    Replies: 8
    Last Post: 6th March 2011, 02:26 PM
  4. Need to execute a tiny DOS com program at boot
    By Areal Person in forum Using Fedora
    Replies: 5
    Last Post: 20th December 2009, 09:54 PM
  5. Using Alt+F2 to execute program from terminal
    By kjartani in forum Using Fedora
    Replies: 9
    Last Post: 21st October 2009, 01:19 PM

Posting Permissions

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