gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: rhoronjeff@comcast.net December 07, 2022, 08:36:53 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Linux  |  How specify the interpreter for an executable
gfx
gfxgfx
 

Author Topic: How specify the interpreter for an executable  (Read 693 times)

Kompass17

  • Newbie
  • *
  • Posts: 4
How specify the interpreter for an executable
« on: May 08, 2022, 05:32:28 AM »
Linux version: Linux barre 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Absoft compiler suite and IMSL: 64-bit Pro Fortran 22.0.1

Verification test
$ af95 -no-pie -openmp -w -m64 -YMOD_ONLY -p/opt/imsl/fnl2018.0.0/lnxab190x64/include -o imslmp imslmp.f90 $LINK_FNL
produces an executable that analyzed with file
$ file imslmp
imslmp: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a18b3c7bb405e49818158e4c47ebbfba3a72cf5a, for GNU/Linux 3.2.0, not stripped

But compilation of another source (test-rpn.f), this time with af77, builds an executable set for a different interpreter, one actually non existent on this machine,
$ file /home/hgs/bin/test-rpn
/home/hgs/bin/test-rpn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=0f2b9fd19bec3b886d72f738824040aef981981f, for GNU/Linux 3.2.0, not stripped

The complier command is following below.

Did I miss an option?
How can a user influence the specification of the interpreter in the ELF during the build process?
If answers are negative, what alternatives exist a posteriori?
Help is dearly needed, thanks in advance
/Kompass17

Compiler command:
af77 -static -m64 -o /home/hgs/bin/test-rpn test-rpn.f -v -s -O1 -N90 -O1 -N90 -f -s \
 -X-M -X-t -X-V -X-Bstatic -L/home/hgs/math/afor/p -lmath -lrcp  -L/home/hgs/util/afor/p -lutil \
 -L/home/hgs/lib/pgplot -lnotexx $LINK_FNL_STATIC \
 -X-Bstatic -L/opt/absoft22.0/lib64 -laomp_pic -laomp  -lgomp  -lgomp_large




forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: How specify the interpreter for an executable
« Reply #1 on: May 08, 2022, 11:36:03 AM »
The issue with the interpreter is caused by the -static option in the second command. It is causing a conflict with the options in $LINK_FNL that are required to link the IMSL libraries correctly.  Is there a reason why you are trying to perform a static link of the system libraries in the second command? If not, just remove -static from the command.
« Last Edit: May 08, 2022, 11:46:53 AM by forumadmin »

Kompass17

  • Newbie
  • *
  • Posts: 4
Re: How specify the interpreter for an executable
« Reply #2 on: May 08, 2022, 03:39:15 PM »
Thanks for pointing me at -static. Your diligent answer is much appreciated.
I just found out: Changing -static to -no-pie as a compiler (!) option does create the executable correctly bound for the interpreter /lib64/ld-linux-x86-64.so.2
I've seen -no-pie suggested at topic 997.0, but thought of it as to be passed to ld with -X -no-pie
It could have been described there more clearly.
Issue solved. Thanks again,
/Kompass17

Absoft User Forum  |  Support  |  Linux  |  How specify the interpreter for an executable
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!