Incorrect FPC/Lazarus build? lazarus / 43-Android ---------------------------------------------------------------------- Seenkao · 2024-09-16 21:58 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: "\/" QuoteC:\laz2\cross\bin\all-android\bin\arm-linux-androideabi- ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.1229700 6\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\l lvm\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 ---------------------------------------------------------------------- Seenkao · 2024-09-17 22:50 Странно что вообще ни кто не хочет отвечать. Мой вопрос касается не только меня, но и всех кто захочет использовать кросскомпиляцию для 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: QuoteC:\laz3\cross\bin\all-android\bin\arm-linux-androideabi- ld.bfd.exe: C:\Users\Mirrel\AppData\Local\Android\Sdk\ndk\27.1.1229700 6\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\l lvm\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\l lvm\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\l lvm\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 ---------------------------------------------------------------------- Seenkao · 2024-09-17 23:04 Забыл, на данный момент я вижу только одно решение, это удалить 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. ---------------------------------------------------------------------- Seenkao · 2024-09-17 23:47 Спешу огорчить, удаление NDK не помогло. Лишний слеш появляется и здесь. Google translate: I hasten to disappoint you, deleting NDK did not help. The extra slash appears here too. QuoteC:\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 ---------------------------------------------------------------------- TRon · 2024-09-18 02:58 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). ---------------------------------------------------------------------- Seenkao · 2024-09-18 08:44 У меня в 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. ---------------------------------------------------------------------- dseligo · 2024-09-18 09:34 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 · 2024-09-18 13:26 Quote from: dseligo on September 18, 2024, 11:34:18 amIf 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? Как и откуда туда попадают приходящие пути? Как-то можно этот процесс контролировать? ---------------------------------------------------------------------- TRon · 2024-09-18 15:26 Quote from: Seenkao on September 18, 2024, 10:44:43 amGoogle 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. Quote from: Seenkao on September 18, 2024, 03:26:56 pmDoes 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). QuoteHow 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). ---------------------------------------------------------------------- Seenkao · 2024-09-23 22:16 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. ---------------------------------------------------------------------- TRon · 2024-09-24 18:26 Quote from: Seenkao on September 24, 2024, 12:16:42 amDuring 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 ? QuoteI 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. QuoteI 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. ---------------------------------------------------------------------- Seenkao · 2024-09-25 16:30 Quote from: TRon on September 24, 2024, 08:26:45 pmAre you able to share a part of the build-process and/or error that occurs ?Лог ошибки выложен в первопосте. Сборка идёт стандартно. Запускаем FPCUPDeluxe. Устанавливаем FPC/Lazarus. Устанавливаем кросскомпиляторы. Зависит или нет от установки Android Studio не понятно. Я специально удалил пути до NDK, чтоб компилятор загрузил свои библиотеки, это не решило проблемы. Я могу выложить готовый кросскомпилятор, который с ошибкой, если это нужно. QuoteThe 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 и установил кросскомпиляторы на свой компьютер. QuoteAlso 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: Quote from: TRon on September 24, 2024, 08:26:45 pmAre 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. QuoteThe 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. QuoteAlso 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 ---------------------------------------------------------------------- DonAlfredo · 2024-09-25 16:57 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 · 2024-09-25 17:15 @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) ? ---------------------------------------------------------------------- DonAlfredo · 2024-09-25 18:17 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_c rossbins_all https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/linux_amd 64_crossbins_all ---------------------------------------------------------------------- Seenkao · 2024-09-25 18:24 Для понимания, ошибка возникает только для одной архитектуры! Arm32. Моя изначальная ошибка в первопосте, что я думал что эта ошибка для всех архитектур. Так же, рабочий кросскомпилятор я собрал на машине, где установлен Windows 7. И при использовании FPCUPDeluxe я не мог собрать компилятор из репозитория (GitLab), приходилось собирать используя zip-архивы. При использовании репозитория возникает какая-то ошибка в данном случае, не помню какая, но может это не так важно, ведь многие перешли на Windows 10/11. Я проверю на эмуляторах сборку кросскомпиляторов и скажу результат. На эмуляторах я буду менять процессоры. Может это поможет как-то решить проблему (если она в самом деле есть, возможно надо было сначала поискать людей с подобной проблемой?). -------------------------------------------------------- Google translate: For your understanding, the error occurs only for one architecture! Arm32. My initial mistake in the first post was that I thought that this error was for all architectures. Also, I built a working cross compiler on a machine with Windows 7 installed. And when using FPCUPDeluxe, I couldn't build the compiler from the repository (GitLab), I had to build using zip archives. When using the repository, some error occurs in this case, I don't remember which one, but maybe it's not that important, because many people have switched to Windows 10/11. I'll check the cross compiler build on emulators and tell you the result. I'll change processors on emulators. Maybe this will help somehow solve the problem (If it really exists, maybe you should have first looked for people with a similar problem?). ---------------------------------------------------------------------- TRon · 2024-09-25 18:59 Quote from: DonAlfredo on September 25, 2024, 08:17:38 pmIn most cases, pre-build (by me) binutils are downloaded. Thank you Don. Ergo, (cross)binutils 2.27 (those were the only ones I was able to find at short notice). Confusing is that the android all archive contained the 64-bit version while the separate/individual archive I was able to find (again, short notice) was 32-bit only (both 2.27) Not sure if any of that information is relevant but because there seem to be a tendency of not sharing relevant portions I must take my own notes. @Seenkao: Based on the information provided the only way to obtain the relevant information is to do it myself, and as stated I lack the time atm. It does not really matter whether you asked for someone to do it or not  Solely based on that single error in your first message: the binutils used are incompatible with the created/used (arm) files. In basics that is it. ---------------------------------------------------------------------- Seenkao · 2024-09-26 08:51 Протестировал на эмуляторах, всё нормально работает... Буду переустанавливать систему на своём компьютере. Результат сообщу. Google translate: Tested on emulators, everything works fine... I will reinstall the system on my computer. I will report the result. ---------------------------------------------------------------------- TRon · 2024-09-26 09:26 Quote from: Seenkao on September 26, 2024, 10:51:14 amTested on emulators, everything works fine... I will reinstall the system on my computer. I will report the result. You might do that but my hunch and fear is that re-installing most probably is not going to fix the issue. There is a reported issue wrt old(er) binutils (such as those found in Don's FPCUpDeluxe repository) but then I would have expected these same binutils to fail on/for every machine. Therefor, my initial thought is that there must be something different regarding the setup on the machine where it fails. Do you perhaps have something else running/installed on that machine where you have this issue, such as for example mingw or WSL or any other Linux based utilities ? For such things to mess up the build there would be something amiss in/during the build-stage that perhaps picks up on that (a path that takes precedence, an environment variable to indicate a certain (wrong) directory or whatever else is able to throw off the build- stage). A longer output of the build-messages would be more helpful. As mentioned, the error itself is clear but not the preceding steps that where done by the build process and which eventually ended up in that error. ---------------------------------------------------------------------- DonAlfredo · 2024-09-26 09:32 If the bins are too old and cause these problems, I will prepare new ones. ---------------------------------------------------------------------- TRon · 2024-09-26 09:45 Quote from: DonAlfredo on September 26, 2024, 11:32:10 amIf the bins are too old and cause these problems, I will prepare new ones. Please hold on to your horses a little longer Don  . I am trying to get things confirmed at a more understandable level, so far I am only able to locate this and this. I need a little more information before jumping into the bintuils ML and/or issue tracker. e.g. there is no point in updating to a newer version if that version also has issues (and there were/are quite a few along the line). I am also a bit thrown off by the inconsistency as it should not matter (it either works or not. And it should not be that it works on machine a and not on machine b at least when the architecture is the same) edit: getting somewhere: this explains things a lot better. @Don (or someone else) Do you happen to know if that what is mentioned about the elfutils vs bintuils could have originated from any decision made during the build-process with FPCUpdeluxe ? ---------------------------------------------------------------------- Thaddy · 2024-09-26 10:08 Yes, the binutils are too old but it only causes problems when there are very specific requirements. The paradox is e.g. in cpp in the distribution, which is very, very, very, very old but that particular version of cpp can do things that more modern versions of cpp can not do (mis-use cpp as a full text processor). It requires some proper judgement and knowledge how the binutils are used. That said, I never ran into trouble with my far more recent binutils, which includes a far more up-to-date cpp and a far more up-to-date external linker. Note I am not exactly sure how cpp is used in the build process, so this particular example may not even be relevant. It is beyond discussion, though, that the binutils are very old, on average on Windows 25 years or so. Only the GNU based utils are affected by old age. That also affects cross-building. ---------------------------------------------------------------------- Seenkao · 2024-09-26 14:54 Я установил FPC/Lazarus + кросскомпиляторы под Android используя FPCUPDeluxe. Система чистая, ни чего установлено не было. Кросскомпилляторы производят сборку без ошибок. Я не знаю с чем связана проблема. Позже буду переустанавливать систему полностью и попробую не забыть об этой ошибке. Если она выскочит, я может смогу поймать момент после установки каких программ это произошло. Google translate: I installed FPC/Lazarus + cross compilers for Android using FPCUPDeluxe. The system is clean, nothing was installed. Cross compilers build without errors. I don't know what the problem is related to. Later I will reinstall the system completely and try not to forget about this error. If it pops up, I might be able to catch the moment after installing which programs it happened.