<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>36023</bug_id>
          
          <creation_ts>2019-02-02 15:48:23 +0300</creation_ts>
          <short_desc>Собрать fpc для неинтеловских архитектур</short_desc>
          <delta_ts>2020-02-06 09:34:14 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>fpc</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="AEN">aen</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          <cc>asy</cc>
    
    <cc>bircoph</cc>
    
    <cc>iv</cc>
    
    <cc>mike</cc>
    
    <cc>sbolshakov</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>178084</commentid>
    <comment_count>0</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2019-02-02 15:48:23 +0300</bug_when>
    <thetext>Судя по https://www.freepascal.org/download.html , это возможно.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178085</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2019-02-02 16:39:39 +0300</bug_when>
    <thetext>Насколько мне известно, это обычно портирование (для e2k смотрели).
Разве если есть сишный бэкенд, но это не про fpc вроде бы как.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178086</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-02 17:02:58 +0300</bug_when>
    <thetext>&gt; Насколько мне известно, это обычно портирование (для e2k смотрели).

Компилятор fpc написан на паскале, и (по крайней мере в транке) поддерживает кучу архитектур, включая riscv, но не включая, %e2k. Так что по крайней мере для mipsel и arm* это вопрос бутсрапа, должно быть несложно.

Для mips64el fpc нет ни у апстрима, ни у Дебиана, ни у китайских коллег в их loongnix&apos;е, но mips64el можно в рассмотрение пока не включать.

Ещё у fpc есть backend на llvm, но я не знаю, насколько живой и какая версия llvm требуется.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178088</commentid>
    <comment_count>3</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2019-02-02 18:11:24 +0300</bug_when>
    <thetext>Эта сборка важна для школ, где pascal пока -- один из возможных языков обучения и сдачи ЕГЭ</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178143</commentid>
    <comment_count>4</comment_count>
    <who name="Sergey Bolshakov">sbolshakov</who>
    <bug_when>2019-02-04 17:30:22 +0300</bug_when>
    <thetext>тут 
http://git.altlinux.org/people/sbolshakov/packages/fpc.git
несколько коммитов для arm, по крмере %build заканчивается успешно.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178189</commentid>
    <comment_count>5</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-05 16:12:33 +0300</bug_when>
    <thetext>Попробовал забутстрапить на mipsel, сначала с ppcmipsel из debian (апстрим публикует только сборки под big endian mips), потом с собранным им уже нашим бинарником. И так, и так падает сборка gdbint:

[...]
Start compiling package gdbint for target mipsel-linux.
File libgdb.a found (/usr/lib/libgdb.a)
GDB-lib found, compiling and running gdbver to obtain GDB-version
Warning: Unable to determine the libgcc path.
       Compiling gdbint/src/gdbver.pp
       Linking gdbint/bin/mipsel-linux/gdbver
The installer encountered the following error:
External command &quot;gdbint/bin/mipsel-linux/gdbver -o gdbint/src/gdbver.inc&quot; failed with exit code 55296. Console output:
Runtime error 216 at $77B146B0
  $77B146B0
[...]

Если позапускать руками и присмореться внимательно, понятно, что это segfault. Вот stacktrace:

(gdb) bt
#0  0x77e986b0 in __GI__IO_wsetb (f=0x77fb7dd4 &lt;_IO_stdout_&gt;, b=0x0, eb=0x0, a=0) at wgenops.c:96
#1  0x77ea6e30 in _IO_unbuffer_all () at genops.c:883
#2  _IO_cleanup () at genops.c:930
#3  0x77e5feac in __run_exit_handlers (status=255, listp=0x77fb73dc &lt;__exit_funcs&gt;, run_list_atexit=&lt;optimized out&gt;, run_dtors=&lt;optimized out&gt;) at exit.c:130
#4  0x77e5ff2c in __GI_exit (status=&lt;optimized out&gt;) at exit.c:139
#5  0x77e461a8 in __libc_start_main (main=0x402ee8, argc=1, argv=0x7fbf76b4, init=&lt;optimized out&gt;, fini=0x40dd64 &lt;__libc_csu_fini&gt;, rtld_fini=0x77fd1900 &lt;_dl_fini&gt;, stack_end=0x7fbf7690) at libc-start.c:342
#6  0x00402ee8 in ?? ()

Разбираюсь.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178279</commentid>
    <comment_count>6</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2019-02-07 02:08:41 +0300</bug_when>
    <thetext>(В ответ на комментарий №4)
&gt; тут 
&gt; http://git.altlinux.org/people/sbolshakov/packages/fpc.git
&gt; несколько коммитов для arm, по крмере %build заканчивается успешно.

А вот что потом: http://kriscode.blogspot.com/2017/11/lazarus-on-arm-ubuntu.html?m=1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178387</commentid>
    <comment_count>7</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-08 16:50:15 +0300</bug_when>
    <thetext>(In reply to comment #5)
&gt; И так, и так падает сборка gdbint:
[...]
&gt; Разбираюсь.

В первом приближении разобрался, https://bugzilla.altlinux.org/36065

(В ответ на комментарий №4)
&gt; тут 
&gt; http://git.altlinux.org/people/sbolshakov/packages/fpc.git
&gt; несколько коммитов для arm, по крмере %build заканчивается успешно.

Добавил сверху пару (довольно тривиальных) коммитов для mipsel:

http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel

Пока тоже только %build проходит, и только с glibc-core с фиксом из #36065. Такой glibc, я думаю, будет в sisyphus_mipsel позже, после дополнительного тестирования.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178394</commentid>
    <comment_count>8</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-08 18:15:32 +0300</bug_when>
    <thetext>(In reply to comment #7)
&gt; &gt; тут 
&gt; &gt; http://git.altlinux.org/people/sbolshakov/packages/fpc.git
&gt; &gt; несколько коммитов для arm, по крмере %build заканчивается успешно.
&gt; 
&gt; Добавил сверху пару (довольно тривиальных) коммитов для mipsel:
&gt; 
&gt; http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel
&gt; 

Добавил в ту же ветку 2 коммита, делающие %install кросс-платформенным и исправляющие его при bootstrap&apos;е. %install прошёл. Осталось разобраться с  некоторыми %files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178398</commentid>
    <comment_count>9</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-08 20:07:29 +0300</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; &gt; тут 
&gt; &gt; &gt; http://git.altlinux.org/people/sbolshakov/packages/fpc.git
&gt; &gt; &gt; несколько коммитов для arm, по крмере %build заканчивается успешно.
&gt; &gt; 
&gt; &gt; Добавил сверху пару (довольно тривиальных) коммитов для mipsel:
&gt; &gt; 
&gt; &gt; http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel
&gt; &gt; 
&gt; 
&gt; Добавил в ту же ветку 2 коммита, делающие %install кросс-платформенным и
&gt; исправляющие его при bootstrap&apos;е. %install прошёл. Осталось разобраться с 
&gt; некоторыми %files.

%files победил, осталось пара лишних зависимостей и поправить конфиги. С поправленными руками конфигами hello world собрался и запустился.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178436</commentid>
    <comment_count>10</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-11 14:32:47 +0300</bug_when>
    <thetext>(In reply to comment #9)
&gt; &gt; &gt; http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel
[...]

Ещё раз обновил ветку; в таком виде оно собралось и нормально ставится в hasher. fpc вроде работает, ide запускается но падает при попытке запустить программу (даже без дебага; скомпилировать удаётся).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178438</commentid>
    <comment_count>11</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2019-02-11 15:15:21 +0300</bug_when>
    <thetext>(В ответ на комментарий №10)
&gt; (In reply to comment #9)
&gt; &gt; &gt; &gt; http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel
&gt; [...]
&gt; 
&gt; Ещё раз обновил ветку; в таком виде оно собралось и нормально ставится в
&gt; hasher. fpc вроде работает, ide запускается но падает при попытке запустить
&gt; программу (даже без дебага; скомпилировать удаётся).
Уже что-то. В принципе, используют все же lazarus, которому, вероятно, ide от fpc не нужен.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178439</commentid>
    <comment_count>12</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-11 15:30:19 +0300</bug_when>
    <thetext>(In reply to comment #11)
&gt; (В ответ на комментарий №10)
&gt; &gt; (In reply to comment #9)
&gt; &gt; &gt; &gt; &gt; http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel

Опубликовал ещё один небольшой коммит, исправляющий сборку с выключенным bootstrap. Пока от меня всё.

&gt; &gt; Ещё раз обновил ветку; в таком виде оно собралось и нормально ставится в
&gt; &gt; hasher. fpc вроде работает, ide запускается но падает при попытке запустить
&gt; &gt; программу (даже без дебага; скомпилировать удаётся).
&gt; Уже что-то. В принципе, используют все же lazarus, которому, вероятно, ide от
&gt; fpc не нужен.

Сборка lazarus -- интересный тест, надо будет попробовать.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178440</commentid>
    <comment_count>13</comment_count>
    <who name="Sergey Bolshakov">sbolshakov</who>
    <bug_when>2019-02-11 15:45:12 +0300</bug_when>
    <thetext>(In reply to comment #12)
&gt; (In reply to comment #11)
&gt; &gt; (В ответ на комментарий №10)
&gt; &gt; &gt; (In reply to comment #9)
&gt; &gt; &gt; &gt; &gt; &gt; http://git.altlinux.org/people/iv/packages/?p=fpc.git;a=shortlog;h=refs/heads/mipsel
&gt; 
&gt; Опубликовал ещё один небольшой коммит, исправляющий сборку с выключенным
&gt; bootstrap. Пока от меня всё.

ещё один коммит поверх 67d3324188b19 у меня и тоже пока всё.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178496</commentid>
    <comment_count>14</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-12 16:20:31 +0300</bug_when>
    <thetext>(In reply to comment #12)
&gt; (In reply to comment #11)
&gt; &gt; (В ответ на комментарий №10)
&gt; &gt; Уже что-то. В принципе, используют все же lazarus, которому, вероятно, ide от
&gt; &gt; fpc не нужен.
&gt; 
&gt; Сборка lazarus -- интересный тест, надо будет попробовать.

lazarus собирается, но не работает. При первом запуске выдаёт окошко с ошибкой:

Пакет EditorMacroScript (сценарии PascalScript) обнаружил проблему и отключился.
Пакет не прошёл самотестирование с сообщением:
&quot;test_int1(42)(init: 0) [Exp: 42 / Got: 0]&quot;

То же самое в английской локали:

The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated.
The package failed its selftest with the message:
&quot;test_int1(42)(init: 0) [Exp: 42 / Got: 0]&quot;

После этого (а при втором последующих запусках без этого) что-то сегфолтится и окошки висят, ни на что не реагируют.

В общем, на mipsel fpc не очень рабочий вышел. Будем разбираться.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178612</commentid>
    <comment_count>15</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2019-02-16 00:33:14 +0300</bug_when>
    <thetext>FYI:
https://packages.debian.org/search?suite=sid&amp;arch=any&amp;searchon=names&amp;keywords=fpc
https://packages.debian.org/search?suite=sid&amp;searchon=names&amp;keywords=lazarus
Наконец, https://www.archlinux.org/packages/community/x86_64/lazarus/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178613</commentid>
    <comment_count>16</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2019-02-16 00:35:38 +0300</bug_when>
    <thetext>Не, с последним промахнулся, извините.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>187584</commentid>
    <comment_count>17</comment_count>
    <who name="Sergey Y. Afonin">asy</who>
    <bug_when>2020-02-06 09:34:14 +0300</bug_when>
    <thetext>Тут вот
https://forum.altlinux.org/index.php?topic=43539.msg346186#msg346186
пишут, что удалось запустить в ALT aarch64-бинарники fpc/lazarus из Ubuntu.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>