Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probl on cross-compile Linux x64 to x32 #25

Closed
Alexey-T opened this issue Apr 26, 2017 · 10 comments

Comments

@Alexey-T
Copy link

commented Apr 26, 2017

installed (Ubuntu x64) Laz trunk. FPC 3.0.2.
installed cross-comp to Linux x32
(msg "success")

Run IDE, it cannot make for x32. linker err:

Messages, Warnings: 1
Warning: other unit files search path (aka unit path) of "CudaText" contains "/home/user/cuda/synedit/atsynedit", which belongs to package "atsynedit_package"
Compile Project, Mode: x32 def, CPU: i386, Target: cudatext: Exit code 256, Errors: 1, Warnings: 2, Hints: 2
Hint: Start of reading config file /home/user/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg
Hint: End of reading config file /home/user/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg
cudatext.lpr(28,1) Warning: "crti.o" not found, this will probably cause a linking failure
cudatext.lpr(28,1) Warning: "crtn.o" not found, this will probably cause a linking failure
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lgtk-x11-2.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lgobject-2.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lglib-2.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lgthread-2.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lgmodule-2.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lpango-1.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lcairo
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -latk-1.0
/home/user/fpcupdeluxe/cross/bin/i386-linux/i386-linux-ld: cannot find -lc
cudatext.lpr(28,1) Error: Error while linking

folder cross/lib/arm-linux exists;
folder for x32 not exists

@LongDirtyAnimAlf

This comment has been minimized.

Copy link
Owner

commented Apr 26, 2017

Same error has been reported on the Lazarus mailing list:
http://forum.lazarus.freepascal.org/index.php/topic,34645.msg242309.html

See my comments !

@Alexey-T

This comment has been minimized.

Copy link
Author

commented Apr 26, 2017

checked "FPC/laz rebuild only",
still the same.

@LongDirtyAnimAlf

This comment has been minimized.

Copy link
Owner

commented Apr 26, 2017

Sure. Expected. Again, see my replies to this issue !
This will not work out-of-the-box !!

@Alexey-T

This comment has been minimized.

Copy link
Author

commented Apr 26, 2017

Can you, pls, write wiki topic about it.
hard to read the forum.

@LongDirtyAnimAlf

This comment has been minimized.

Copy link
Owner

commented Apr 26, 2017

Naturally, but I need your help !
I need to know what works to write the wiki !!

So please test this first scenario (as found in the forum) and report back:
Download the 32bit libs from fpcupdeluxe:
https://github.com/newpascal/fpcupdeluxe/releases/tag/crosslibs_v1.0
https://github.com/newpascal/fpcupdeluxe/releases/download/crosslibs_v1.0/CrossLibsLinuxi386.rar
Unpack them in (e.g.): /yourinstalldir/cross/lib/i386-linux/

Point FPC/Lazarus towards these libs in your project options:
-Fl/yourinstalldir/cross/lib/i386-linux/
(or in your Lazarus project options: Lazarus -> Project -> Project Options -> Paths -> Libraries [-Fl])

Test. Report back.

@Alexey-T

This comment has been minimized.

Copy link
Author

commented Apr 26, 2017

tested. Did what u suggest.
Now i got compiled Cudatext x32

Tks.

@LongDirtyAnimAlf

This comment has been minimized.

Copy link
Owner

commented Apr 27, 2017

Thanks for testing.
I have disabled multilib use in the newest release.

@m-audio91

This comment has been minimized.

Copy link

commented May 24, 2019

Hi
Sorry I see this problem is still available. the problem is that when I click on install cross compiler button
fpcupdeluxe says:

Fpcupdeluxe: FPC cross-builder: Building compiler for linux-i386.
fpcupdeluxe: info: FPC i386-linux cross-builder: Detected source version FPC (compiler): 3.3.1
fpcupdeluxe: info: TAny_linux-i386: Found correct binary utilities in directory /usr/bin
fpcupdeluxe: info: TAny_linux-i386: Found correct library in directory /usr/lib/i386-linux-gnu
fpcupdeluxe: info: FPC i386-linux cross-builder: Using compiler with version: 3.3.1

as you can see TAny_linux-i386 detects wrong location and does not download CrossLibsLinuxi386.rar.
see attachment 1 for complete lazarus log.
fpcupdeluxe linking error.txt

Now if I open the file fpcupdeluxe.ini in the root of the target installation folder and change this section:
[i386-linux] Setting=0 LibPath= BinPath= CrossBuildOptions= Compiler=
to point LibPath= to 32bit crosslibs downloaded and extracted from this link https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/crosslibs_v1.1/CrossLibsLinuxi386.zip, TAny_linux-i386 detects it for installing cross compiler. and the first linking problem in lazarus will resolve but another linking problem will arise. see attachment 2.
fpcupdeluxe linking error 2.txt

my system info
Fresh installation of SparkyLinux 4.10 x86_64 on VirtualBox
Fpcupdeluxe 1.6.2v

@LongDirtyAnimAlf

This comment has been minimized.

Copy link
Owner

commented May 30, 2019

Confirmed.
Will look into this issue and try to solve.

@LongDirtyAnimAlf

This comment has been minimized.

Copy link
Owner

commented Jun 6, 2019

For me, this works !

retrieve 32-bit packages

sudo apt-get install gcc-multilib libx11-dev:i386 pixbuf2.0-0:i386 libgtk2.0-0:i386

create missing symlinks

sudo ln -s -f /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0 /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0 /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0 /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 /usr/lib/i386-linux-gnu/libgobject-2.0.so
sudo ln -s -f /lib/i386-linux-gnu/libglib-2.0.so.0 /lib/i386-linux-gnu/libglib-2.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 /usr/lib/i386-linux-gnu/libgthread-2.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0 /usr/lib/i386-linux-gnu/libgmodule-2.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libpango-1.0.so.0 /usr/lib/i386-linux-gnu/libpango-1.0.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libcairo.so.2 /usr/lib/i386-linux-gnu/libcairo.so
sudo ln -s -f /usr/lib/i386-linux-gnu/libatk-1.0.so.0 /usr/lib/i386-linux-gnu/libatk-1.0.so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.