Wrong ld links on no-ARM64 architectures

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

sagitter
Messages : 35
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Wrong ld links on no-ARM64 architectures

Message par sagitter » dim. juil. 07, 2024 5:34 pm

Hi all.

I cant compile giac-1.9.0 -993 in Fedora no-ARM64 because of this error:

Code : Tout sélectionner

qemu-aarch64-static: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory
Honestly, i don't know if it's caused by some changes inside giac code or by my patches

Full build log in Fedora 41 x86_64: https://kojipkgs.fedoraproject.org//wor ... /build.log
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

parisse
Messages : 5868
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Wrong ld links on no-ARM64 architectures

Message par parisse » lun. juil. 08, 2024 6:57 am

Seems to be an error while running the mkjs executable, it requires a library that is missing.
Did you try something like
https://unix.stackexchange.com/question ... e-or-direc

sagitter
Messages : 35
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Wrong ld links on no-ARM64 architectures

Message par sagitter » mer. juil. 10, 2024 8:05 pm

Hi Parisse
parisse a écrit :
lun. juil. 08, 2024 6:57 am
Seems to be an error while running the mkjs executable, it requires a library that is missing.
Did you try something like
https://unix.stackexchange.com/question ... e-or-direc
Impossible; arm64 libraries cannot be installed in other architectures.
Something is changed with giac-1.9.0 993 and above, the release 992 is compiled: https://kojipkgs.fedoraproject.org//wor ... /build.log
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

parisse
Messages : 5868
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Wrong ld links on no-ARM64 architectures

Message par parisse » ven. juil. 12, 2024 1:07 pm

Nothing changed for mkjs, it is compiled from mkjs.cc. The relevant lines in Makefile.am are:

Code : Tout sélectionner

js.c: mkjs qjscalcjs.js xcasjs.js
	./mkjs

js.h: mkjs qjscalcjs.js xcasjs.js
	./mkjs

mkjs: mkjs.cc
	g++ mkjs.cc -o mkjs
I don't see any call to ./mkjs in your 1.9.0-992 log, perhaps you already had the js.c and js.h files ?
In that case, maybe if you copy js.c and js.h, it will compile.
I'll add the current js.c/js.h to the tar source file.

BTW, I don't understand why it is impossible to copy ld-linux-aarch64.so.1 alone (I mean, not by installing a package) from another linux distribution and put it in /lib or in any directory that you add to your LD_LIBRARY_PATH by export LD_LIBRARY_PATH

parisse
Messages : 5868
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Wrong ld links on no-ARM64 architectures

Message par parisse » ven. juil. 12, 2024 1:36 pm

I just checked, js.c and js.h are in the archive. Perhaps running touch on them will force make consider them up to date and avoid running mkjs to update them. Very strange...

sagitter
Messages : 35
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Wrong ld links on no-ARM64 architectures

Message par sagitter » mar. juil. 16, 2024 8:21 pm

parisse a écrit :
ven. juil. 12, 2024 1:07 pm
I'll add the current js.c/js.h to the tar source file.
Those filles are already in source archive.
parisse a écrit :
ven. juil. 12, 2024 1:07 pm
BTW, I don't understand why it is impossible to copy ld-linux-aarch64.so.1 alone (I mean, not by installing a package) from another linux distribution and put it in /lib or in any directory that you add to your LD_LIBRARY_PATH by export LD_LIBRARY_PATH
Because i'm compiling Giac in a RPM packaging system, i can't use libraries from mixed architectures of Fedora.
parisse a écrit :
ven. juil. 12, 2024 1:07 pm
I just checked, js.c and js.h are in the archive. Perhaps running touch on them will force make consider them up to date and avoid running mkjs to update them. Very strange...
As i thought, mkjs file is not correctly compiled in architectures different from ARM64.
In my test, during the packaging procedure, i have manually compiled mkjs with correct (for Fedora) g++ flags:

Code : Tout sélectionner

g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer mkjs.cc -o mkjs
and forced makefiles in giac source archive to create a mkjs.fake file, later ignored.

Please, look the build.log here
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

parisse
Messages : 5868
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Wrong ld links on no-ARM64 architectures

Message par parisse » mer. juil. 17, 2024 7:09 pm

I'm glad you solved the issue, but I don't understand why. mkjs is built using this Makefile.am rule:

Code : Tout sélectionner

mkjs: mkjs.cc
	g++ mkjs.cc -o mkjs
What's wrong?
Moreover, this did not change since a while, I don't see why suddenly you got a problem with 1.9.0-994...

sagitter
Messages : 35
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Wrong ld links on no-ARM64 architectures

Message par sagitter » dim. juil. 21, 2024 1:06 pm

parisse a écrit :
mer. juil. 17, 2024 7:09 pm
I'm glad you solved the issue, but I don't understand why. mkjs is built using this Makefile.am rule:

Code : Tout sélectionner

mkjs: mkjs.cc
	g++ mkjs.cc -o mkjs
What's wrong?
Moreover, this did not change since a while, I don't see why suddenly you got a problem with 1.9.0-994...
Same doubts for me. Surely, mkjs file looks "not dynamically linked" and, above all, is always linked to same unavailable library (unless giac is really compiled on ARM64).
Compiled on Fedora 40 x86_64:

Code : Tout sélectionner

sagitter@localhost:~/rpmbuild/BUILD/giac-1.9.0/src$ file ./mkjs && ./mkjs; ldd ./mkjs
./mkjs: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=9695e634377898133b2896f36d83fa197d9e5b35, for GNU/Linux 3.7.0, not stripped
qemu-aarch64-static: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory
	not a dynamic executable
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

Répondre