Recent

Author Topic: Incorrect FPC/Lazarus build?  (Read 1278 times)

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Incorrect FPC/Lazarus build?
« on: September 16, 2024, 11:58:01 pm »
Windows
Установка FPC/Lazarus с помощью FPCUPDeluxe.
Установлены кросскомпиляторы для Android: Arm32/64, x86_64, x86.

Один кросскомпилятор установил до установки Android Studio + NDK.

Кусок лога, где возникает ошибка внизу. Сама ошибка, как я понимаю, возникает в файле C:\laz2\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe , как туда попадает этот путь мне не известно. Как можно решить данную проблему?
Сама проблема в слешах, как я понимаю: "\/"

------------------------
Google translate:
Windows
Installing FPC/Lazarus using FPCUPDeluxe.
Cross compilers for Android are installed: Arm32/64, x86_64, x86.

I installed one cross compiler before installing Android Studio + NDK.

A piece of the log where the error occurs is below. The error itself, as I understand it, occurs in the file C:\laz2\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe, how this path gets there I don't know. How can I solve this problem?
The problem itself is in the slashes, as I understand it: "\/"

Quote
C:\laz2\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\35\/libc.so: unable to initialize decompress status for section .debug_abbrev
C:\laz2\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\35\/libc.so: unable to initialize decompress status for section .debug_abbrev
C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\35\/libc.so: file not recognized: File format not recognized
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #1 on: September 18, 2024, 12:50:21 am »
Странно что вообще ни кто не хочет отвечать. Мой вопрос касается не только меня, но и всех кто захочет использовать кросскомпиляцию для FPC/Lazarus. Люди установят себе Android Studio и после этого захотят установить FPC/Lazarus + кросскомпилятор. Результат будет удручающим, они не смогут собрать свои проекты под Android.

Лично у меня есть кросскомпиляторы, которые собирают под нужные платформы. Установлены они на Linux. Я могу поделится ими с желающими, но вы предлагаете людям переходить с Windows на Linux? )))

Где затаилась проблема я не знаю, может быть в исходных кодах FPC, а может в FPCUPDeluxe.
Найдите пожалуйста проблему! Это в ваших же интересах!

Понижение версии FPCUPDeluxe лучше результат не дал. Лог внизу.


-----------------------------------
Google translate:

It's strange that no one wants to answer. My question concerns not only me, but also everyone who wants to use cross-compilation for FPC/Lazarus. People will install Android Studio and then want to install FPC/Lazarus + cross-compiler. The result will be depressing, they will not be able to build their projects for Android.

Personally, I have cross-compilers that build for the required platforms. They are installed on Linux. I can share them with those who want, but are you suggesting that people switch from Windowsto Linux? )))

I don't know where the problem is hidden, maybe in the source codes of FPC, or maybe in FPCUPDeluxe.
Please find the problem! It's in your best interest!

Downgrading FPCUPDeluxe didn't give a better result. Log:

Quote
C:\laz3\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\\libc.a(checksum.o): unable to initialize decompress status for section .debug_str
C:\laz3\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\\libc.a(checksum.o): unable to initialize decompress status for section .debug_str
C:\laz3\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\\libc.a(__errno.o): unable to initialize decompress status for section .debug_abbrev
C:\laz3\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\\libc.a(__errno.o): unable to initialize decompress status for section .debug_abbrev
C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.12297006\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\arm-linux-androideabi\\libc.a: error adding symbols: File format not recognized
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #2 on: September 18, 2024, 01:04:08 am »
Забыл, на данный момент я вижу только одно решение, это удалить NDK и после этого устанавливать нужные для Android кросскомпиляторы. Потом NDK надо будет заново установить.

Google translate:
Forgot, at the moment I see only one solution, it is to remove NDK and after that install the necessary cross compilers for Android. Then NDK will need to be reinstalled.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #3 on: September 18, 2024, 01:47:00 am »
Спешу огорчить, удаление NDK не помогло. Лишний слеш появляется и здесь.

Google translate:
I hasten to disappoint you, deleting NDK did not help. The extra slash appears here too.

Quote
C:\laz2\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\laz2\cross\lib\arm-android\/libc.so: unable to initialize decompress status for section .debug_abbrev
C:\laz2\cross\bin\all-android\bin\arm-linux-androideabi-ld.bfd.exe: C:\laz2\cross\lib\arm-android\/libc.so: unable to initialize decompress status for section .debug_abbrev
C:\laz2\cross\lib\arm-android\/libc.so: file not recognized: File format not recognized
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

TRon

  • Hero Member
  • *****
  • Posts: 3295
Re: Incorrect FPC/Lazarus build?
« Reply #4 on: September 18, 2024, 04:58:15 am »
Nothing to do with the extra slash. It is a (known) binutils bug (seems to be specific to 2.32 ?).

This should be discussed by someone maintaining the cross setup I do not know if Don Alfredo uses a specific set of binutils in order to setup/build android (cross).
This tagline is powered by AI

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #5 on: September 18, 2024, 10:44:43 am »
У меня в Windows стоит версия binutils 2.39.

При установке FPCUPDeluxe загружает свою версию binutils и использует её? Как эту проблему решить? Чья это проблема? FPCUPDeluxe? FPC?

Да, я проверил какую версию binutils загружает FPCUPDeluxe, это версия 2.28.


Google translate:
I have binutils 2.39 in Windows.

When installing FPCUPDeluxe, does it download its own version of binutils and use it? How can I solve this problem? Whose problem is this? FPCUPDeluxe? FPC?

Yes, I checked what version of binutils FPCUPDeluxe loads, it is version 2.28.
« Last Edit: September 18, 2024, 10:51:04 am by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

dseligo

  • Hero Member
  • *****
  • Posts: 1373
Re: Incorrect FPC/Lazarus build?
« Reply #6 on: September 18, 2024, 11:34:18 am »
If I remember correctly I manually downloaded NDK (I have version
22.1.7171670). I have it under my Lazarus directory, not under my user account settings (AppData).

Path is set up in menu Tools, LAMW..., Path Settings....

But I don't have Android Studio, so maybe it's something different because of that.

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #7 on: September 18, 2024, 03:26:56 pm »
If I remember correctly I manually downloaded NDK (I have version
22.1.7171670). I have it under my Lazarus directory, not under my user account settings (AppData).

Path is set up in menu Tools, LAMW..., Path Settings....

But I don't have Android Studio, so maybe it's something different because of that.
Eng:
Did you use FPCUPDeluxe to install?

Does anyone know where the files "arm-linux-androideabi-ld.bfd.exe", "arm-linux-androideabi-ld.exe" and others came from? Were they compiled? Where did these files come from? Are they copies of files from the NDK?
How and where do the incoming paths get there? Is there any way to control this process?


Rus:
Вы использовали для установки FPCUPDeluxe?

А кто-нибудь знает откуда брали файлы "arm-linux-androideabi-ld.bfd.exe", "arm-linux-androideabi-ld.exe" и другие? Их компилировали? Откуда взялись эти файлы? Это копии файлов из NDK?
Как и откуда туда попадают приходящие пути? Как-то можно этот процесс контролировать?
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

TRon

  • Hero Member
  • *****
  • Posts: 3295
Re: Incorrect FPC/Lazarus build?
« Reply #8 on: September 18, 2024, 05:26:36 pm »
Google translate:
I have binutils 2.39 in Windows.

When installing FPCUPDeluxe, does it download its own version of binutils and use it? How can I solve this problem? Whose problem is this? FPCUPDeluxe? FPC?
Yes, FPCUpDeluxe will download (or build) a specific version of the binutils.

The default binutils installed on a PC are not capable of cross-compiling to Android. Of course there are people that can create/install those (cross)bintuils manually but I am assuming that most users will not.

Does anyone know where the files "arm-linux-androideabi-ld.bfd.exe", "arm-linux-androideabi-ld.exe" and others came from? Were they compiled? Where did these files come from? Are they copies of files from the NDK?
They are distributed with FPCUpDeluxe. They are either build during installation or copied from an existing distribution. For details you would have to ask Don Alfredo (in case you used FPCUpDeluxe to install everything).

You could let FPCUpDeluxe create a detailed log for its installation process, which allows you to analyze a few thing such as where files are downloaded from (hint most files originate from FPCUpDeluxes own repositories).

Quote
How and where do the incoming paths get there? Is there any way to control this process?
The configuration when it comes to FPCUpDeluxe, although very impressive and overwhelming, is limited in that regards. FPCUpdeluxe must make things work for everyone (for every platform) and customizing too much is interfering with that process.

But, in theory you can install everything manually as well which allows you to be in control and decides what to install (and configure) where. I personally find it too time consuming and demanding to manually setup a cross-build for Android.

I am aware, all this is not very helpful but you can blame google for those convoluted installation processes required to be able to (cross)compile something for android. All geared towards letting you install their own IDE (which seems can not be avoided anymore for a normal user).
This tagline is powered by AI

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #9 on: September 24, 2024, 12:16:42 am »
TRon, благодарю за информацию!

В ходе тестов, я узнал, что проблема проявляется если я собираю кросскомпилятор для Android Arm v7. Используется процессор Ryzen 5 3600.
Если я собираю кросскомпилятор на процессоре Intel Core i3 3230M, то ошибки не возникает для данной архитектуры.

Я сейчас попробую перенести "верный" кросскомпилятор на Ryzen 5 3600. Если он будет верно работать на данной машине, то надо будет выяснить в чём заключается ошибка. В использовании определённого процессора или в сборке FPC затаилась ошибка для определённых процессоров?!

У меня есть большие подозрения на свой процессор, потому что для Debian 12, тоже проявляются определённые ошибки для Android.


Google translate:
TRon, thanks for the info!

During my tests, I found out that the problem occurs when I build a cross compiler for Android Arm v7. The processor used is Ryzen 5 3600.
If I build a cross compiler on an Intel Core i3 3230M, then the error does not occur for this architecture.

I will now try to port the "correct" cross compiler to Ryzen 5 3600. If it works correctly on this machine, then I will need to find out what the error is. Is there an error in using a specific processor or in building FPC for specific processors?!

I have strong suspicions about my processor, because for Debian 12, certain errors for Android also appear.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

TRon

  • Hero Member
  • *****
  • Posts: 3295
Re: Incorrect FPC/Lazarus build?
« Reply #10 on: September 24, 2024, 08:26:45 pm »
During my tests, I found out that the problem occurs when I build a cross compiler for Android Arm v7. The processor used is Ryzen 5 3600.
If I build a cross compiler on an Intel Core i3 3230M, then the error does not occur for this architecture.
Are you able to share a part of the build-process and/or error that occurs ?

Quote
I will now try to port the "correct" cross compiler to Ryzen 5 3600. If it works correctly on this machine, then I will need to find out what the error is. Is there an error in using a specific processor or in building FPC for specific processors?!
The problem is that I can't see where in the process things go wrong for you (so it could literally be anywhere). Note that armv7 is eabi and android seem to expect soft-float by default for that target.

Quote
I have strong suspicions about my processor, because for Debian 12, certain errors for Android also appear.
Also here is the problem that I am unable to determine what might be wrong as some information is lacking. There is ofc a difference between processor regarding both systems but in theory a configure/make script should be able to rule out any environment related differences such as (cross) compiler flags.

Unfortunately I do not have the time to be able to dive deeper into this issue atm.
This tagline is powered by AI

Seenkao

  • Hero Member
  • *****
  • Posts: 600
    • New ZenGL.
Re: Incorrect FPC/Lazarus build?
« Reply #11 on: September 25, 2024, 06:30:56 pm »
Are you able to share a part of the build-process and/or error that occurs ?
Лог ошибки выложен в первопосте.
Сборка идёт стандартно. Запускаем FPCUPDeluxe. Устанавливаем FPC/Lazarus. Устанавливаем кросскомпиляторы.
Зависит или нет от установки Android Studio не понятно. Я специально удалил пути до NDK, чтоб компилятор загрузил свои библиотеки, это не решило проблемы.

Я могу выложить готовый кросскомпилятор, который с ошибкой, если это нужно.

Quote
The problem is that I can't see where in the process things go wrong for you (so it could literally be anywhere). Note that armv7 is eabi and android seem to expect soft-float by default for that target.
Если бы у меня в процессе сборки кросскомпилятора или в процессе сборки проекта выдавало какие-то ещё ошибки, я бы их давно выложил. Я просто установил FPC/Lazarus и установил кросскомпиляторы на свой компьютер.

Quote
Also here is the problem that I am unable to determine what might be wrong as some information is lacking. There is ofc a difference between processor regarding both systems but in theory a configure/make script should be able to rule out any environment related differences such as (cross) compiler flags.

Unfortunately I do not have the time to be able to dive deeper into this issue atm.
Я об этом не прошу. Я лишь ищу путь решения и/или людей кто сталкивался с подобной проблемой. Если подобная проблема существует хотя бы ещё у одного человека, то я просто собираю кросскомпилятор, который будет работать нормально и выкладываю его в общий доступ.
Я не буду лезть ни в код FPC, ни в код системы, чтоб разобраться где именно проблема. Есть люди, которые больше меня знают, где проблема может быть, потому что они работают с этим кодом.
Да, я могу решить эту проблему полностью и выяснить где таится проблема, но меня это займёт очень много времени. Поэтому мне проще собрать необходимые рабочие кросскомпиляторы и выложить в общий доступ, чтоб люди не сталкивались с той проблемой, с которой столкнулся я. Я и так уже перебрал большинство ваших возможных сборок FPC (и те что не используют FPCUPDeluxe) и они так же выдают те же ошибки при сборке проекта.


-----------------------------------------------------------------
Google translate:
Are you able to share a part of the build-process and/or the error that occurs ?
The error log is posted in the first post.
The build is standard. Launch FPCUPDeluxe. Install FPC/Lazarus. Install cross-compilers.
It is not clear whether it depends on the Android Studio installation. I specifically deleted the paths to the NDK so that the compiler would load its libraries, this did not solve the problem.

I can post a ready-made cross-compiler with an error, if needed.

Quote
The problem is that I can't see where in the process things go wrong for you (so it could literally be anywhere). Note that armv7 is eabi and android seem to expect soft-float by default for that target.
If I had any other errors while building the cross compiler or while building the project, I would have posted them long ago. I just installed FPC/Lazarus and installed the cross compilers on my computer.

Quote
Also here is the problem that I am unable to determine what might be wrong as some information is lacking. There is ofc a difference between processor regarding both systems but in theory a configure/make script should be able to rule out any environment related differences such as (cross) compiler flags.

Unfortunately I do not have the time to be able to dive deeper into this issue atm.
I am not asking for this. I am just looking for a solution and/or people who have encountered a similar problem. If at least one other person has a similar problem, then I simply assemble a cross-compiler that will work fine and put it out in the public domain.
I will not delve into either the FPC code or the system code to figure out where exactly the problem is. There are people who know more than me where the problem might be, because they work with this code.
Yes, I can solve this problem completely and figure out where the problem is, but it will take me a lot of time. Therefore, it is easier for me to assemble the necessary working cross-compilers and put them out in the public domain, so that people do not encounter the problem that I encountered. I have already tried most of your possible FPC assemblies (and those that do not use FPCUPDeluxe) and they also give the same errors when building the project.


Windows 10
Ryzen 5 3600
« Last Edit: September 25, 2024, 06:32:52 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1761
Re: Incorrect FPC/Lazarus build?
« Reply #12 on: September 25, 2024, 06:57:20 pm »
Interesting about this report: the difference between the i3 and the Ryzen 5.
I cannot fathom any reason for this difference.

Some important reminder/advice: on Windows, when cross-compiling, install 32bit FPC and Lazarus !!

TRon

  • Hero Member
  • *****
  • Posts: 3295
Re: Incorrect FPC/Lazarus build?
« Reply #13 on: September 25, 2024, 07:15:21 pm »
@Don:
I don't think the different hardware matters (other than already mentioned).

Does fpcupdeluxe use its own (pre-build) binutils when setting up the cross-compiler ? if so, then which version (and are they prebuild or build on the fly) ?
This tagline is powered by AI

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1761
Re: Incorrect FPC/Lazarus build?
« Reply #14 on: September 25, 2024, 08:17:38 pm »
In most cases, pre-build (by me) binutils are downloaded.
Less times, ready made binutils are used that were prepared for download by me.
Sometimes, system available binutils are searched, found and used.

Examples.

https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/windows_crossbins_all
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/linux_amd64_crossbins_all


 

TinyPortal © 2005-2018