Skip to content

FPM ELF Dynamic Executable displaying Error #72

@b1shtream

Description

@b1shtream

I was trying to solve Issue #44 but found this error-

SeaBIOS (version 1.16.1-3.fc38)
Booting from ROM..Powered by
o.   .o       _ _               __ _
Oo   Oo  ___ (_) | __ __  __ _ ' _) :_
oO   oO ' _ `| | |/ /  _)' _` | |_|  _)
oOo oOO| | | | |   (| | | (_) |  _) :_
 OoOoO ._, ._:_:_,\_._,  .__,_:_, \___)
      Prometheus 0.14.0~4cce8306-custom
[    0.153581] ERR:  [appelfloader] <elf_load.c @  135> fpm: ELF executable is not position-independent!
[    0.179544] ERR:  [appelfloader] <elf_load.c @  703> fpm: Parsing of ELF image failed: Exec format error (-8)

Steps to reproduce the error:

  • Make sure you have all the dependencies installed like gcc-gfortran to run FPM.

  • Build the Fortran package manager from the source by following the commands-

    • git clone https://github.com/fortran-lang/fpm

    • cd fpm

    • chmod +x install.sh

    • ./install.sh --prefix=/usr

  • Go to dynamic-apps repo and then create a folder fpm and inside that run sudo ../extract.sh /usr/bin/fpm
    cp /usr/bin/fpm .

  • Go to the run-app-elfloader repository and use the run.sh script to run the application we just prepared:
    sudo ./run.sh -r ../dynamic-apps/fpm/ /bin/fpm --help

I tried running it on Linux and it runs as expected without any errors.
Run on Linux: /usr/bin/fpm --help

NAME
   fpm(1) - A Fortran package manager and build system

SYNOPSIS
   fpm SUBCOMMAND [SUBCOMMAND_OPTIONS]

   fpm --help|--version|--list

DESCRIPTION
   fpm(1) is a package manager that helps you create Fortran projects
   from source -- it automatically determines dependencies!

   Most significantly fpm(1) lets you draw upon other fpm(1) packages
   in distributed git(1) repositories as if the packages were a basic
   part of your default programming environment, as well as letting
   you share your projects with others in a similar manner.

   All output goes into the directory "build/" which can generally be
   removed and rebuilt if required. Note that if external packages are
   being used you need network connectivity to rebuild from scratch.

SUBCOMMANDS
  Valid fpm(1) subcommands are:

  + build    Compile the packages into the "build/" directory.
  + new      Create a new Fortran package directory with sample files.
  + update   Update the project dependencies.
  + run      Run the local package binaries. Defaults to all binaries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions