наш друг по доублекомандеру разобрался с компиляцией и сказал что там много секеса =)
в общем бинутилы они универсальные и надо делать симлинк
но потом надо иметь библиатеки от 64 с которыми надо линковать и а такого чуда в природе нет и приходится их собирать в общем все сложно и не завидно
вот оригинал :
cobines писал(а):Sadly, there is no example of compiling 32bit to 64bit.
They say binutils are universal, so they should work with any architecture. But on Debian I have a separate package 'binutils-multiarch', maybe you have something similar on your system?
In the linked web page they just create symlinks:
- Код: Выделить всё
$ sudo ln -s /usr/bin/as /usr/bin/x86_64-linux-as
$ sudo ln -s /usr/bin/ld /usr/bin/x86_64-linux-ld
I tried this on my system and it works.
In the 64 to 32 bit example these were scripts, but the parameters to 'ld' and 'as' should be changed. The 'ld' man says the 'A' parameter doesn't matter, so I don't know about this.
- Код: Выделить всё
#!/bin/bash
# name this file /usr/bin/i386-linux-ld
ld -A elf32-i386 $@
#!/bin/bash
# name this file /usr/bin/i386-linux-as
as --32 $@
Ok so, compiling fpc, lazarus and doublecmd was fairly easy. You create an fpc cross-compiler and compile pascal sources with it. I symlinked the 'x86_64-linux-ld' and 'x86_64-linux-as' to my regular binutils and it seemed to work, although I have no way of checking this. Also, I made a script for 'x86_64-gcc':
- Код: Выделить всё
#!/bin/bash
gcc -m64 $@
and I didn't have to compile gcc myself. It works, because readelf reports the compiled object files are ELF64.
The big problem is with linking though. As I understand, you need to have a 64-bit version of every library Double Commander needs and all of their dependent libraries. DC alone needs 20+ libraries to link with - this is much work to build them manually. And many of those libraries do have problems with cross-compiling (you need to manually modify their 'configure' scripts). It took me like 3 hours to get it to link with libX11 and libgtk2.0 alone, so it's a very time consuming process and probably nobody would have the time and patience to do that. :no:
There may be another solution - much easier, although I'm not sure if it'll work. One would need to get all of the libraries already compiled from a working 64-bit system; or maybe there's a way of downloading them from some repository, I don't know. But it could be possible to put them in a separate directory and point fpc to that directory (in fpc.cfg).
бинарники проверили и они работают
Добавлено спустя 3 часа 33 минуты 6 секунд:не нашел x86_64-win64-gorc для линуксе пришлось сделать пока так
- Код: Выделить всё
cat /usr/local/bin/x86_64-win64-gorc
#!/bin/sh
cmdline="/usr/bin/wine /usr/local/bin/x_gorc.exe"
for par in $@
do
# echo $par
par3=`echo $par | cut -c-4`
# echo $par3
if [ "$par3" = "/hom" -o "$par3" = "/usr" ]
then
cmdline="$cmdline z:$par"
else
cmdline="$cmdline $par"
fi
done
$cmdline
компиляция лазаруса прошла, смотрю дальше.
Добавлено спустя 38 минут 51 секунду:ну вдобавок команды которые пришлось набирать в папке фпц
- Код: Выделить всё
make OS_TARGET=win64 CPU_TARGET=x86_64 clean all
make OS_TARGET=win64 CPU_TARGET=x86_64 crossinstall
make OS_TARGET=linux CPU_TARGET=x86_64 clean all
make OS_TARGET=linux CPU_TARGET=x86_64 crossinstall
при компиляции win64 пришлось модифицировать Makefile.fpc чтобы не собирал gtk2 там лезли ошибки, а он мне не нужен.
и запускать crossinstall из папок rtl и packages так как в каком-то из них инстал падал и не переходил в другой.
с лазарусом все немного сложнее вышел вот такой скрипт
- Код: Выделить всё
svn up
echo svn update
sleep 10
echo '************************************************'
echo '************************************************'
echo '************************************************'
cd lcl
make OS_TARGET=win32 clean all
cd ../ideintf
make OS_TARGET=win32 clean all
cd ../packager/registration
make OS_TARGET=win32 clean all
cd ../../components
make OS_TARGET=win32 clean all
cd ..
#make OS_TARGET=win32 clean bigide not work
echo win32 end
sleep 10
echo '************************************************'
echo '************************************************'
echo '************************************************'
cd lcl
make OS_TARGET=win64 CPU_TARGET=x86_64 clean all
cd ../packager/registration
make OS_TARGET=win64 CPU_TARGET=x86_64 clean all
cd ../../ideintf
make OS_TARGET=win64 CPU_TARGET=x86_64 clean all
cd ../components
make OS_TARGET=win64 CPU_TARGET=x86_64 clean all
cd ..
echo win64 end
sleep 10
echo '************************************************'
echo '************************************************'
cd lcl
make OS_TARGET=linux CPU_TARGET=x86_64 clean all
cd ../ideintf
make OS_TARGET=linux CPU_TARGET=x86_64 clean all
cd ../packager/registration
make OS_TARGET=linux CPU_TARGET=x86_64 clean all
cd ../../components
make OS_TARGET=linux CPU_TARGET=x86_64 clean all
cd ../ideintf
make OS_TARGET=linux CPU_TARGET=x86_64 clean all
cd ..
echo lin64 end
sleep 10
echo '************************************************'
echo '************************************************'
echo '************************************************'
make clean all
./lazbuild ../doublecmd/components/CmdLine/cmdbox.lpk
./lazbuild ../doublecmd/components/KASToolBar/kascomp.lpk
./lazbuild ../doublecmd/components/viewer/viewerpackage.lpk
make bigide
sleep 10
echo '************************************************'
echo '************************************************'
echo '************************************************'
cd lcl/interfaces/qt/
make clean all OPT=-dUSE_QT_44
make OS_TARGET=linux CPU_TARGET=x86_64 OPT=-dUSE_QT_44 clean all
знаю что можно упрастить если использовать цикл и переменные, но сегодня задача не стояла =) надо еще собрать приложение.