Error during install of fpc-3.2.2.i386-linux lazarus / 1-Linux ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-06 04:28 I get the following error when I try to install fpc-3.2.2.i386-linux in Windows cygwin: $ ./install.sh This shell script will attempt to install the Free Pascal Compiler version 3.2.2 with the items you select ./install.sh: eval: line 154: syntax error near unexpected token `(' ./install.sh: eval: line 154: `set /usr/local/bin:/usr/bin:/cygdrive/c /WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/system32/wbe m:/cygdrive/c/Program Files/Intel/iCLS Client:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/cygdrive/c/Program Files/ATI Technologies/ATI.ACE/Core-Static:/cygdrive/c/Program Files/GnuPG:/cygdrive/c/Xilinx/bin/nt:/cygdrive/c/Program Files/gnuplo t/bin:/cygdrive/d/Steven/Bin:/cygdrive/c/FPC/3.2.2/bin/i386- Win32:/cygdrive/c/altera/11.1sp2/modelsim_ase/win32aloem:/cygdrive/c/P rogram Files/GPAC:/cygdrive/d/Misc/Programs/mtn-200808a- win32:/usr/openwin/bin' Install prefix (/usr or /usr/local)  [/usr/local] : I think the problem might be the "(" symbol in my Windows path. Is there any way to fix this problem? ---------------------------------------------------------------------- dbannon · 2022-05-06 11:59 Steven, that seems a very convoluted way to install FPC, is there not a native Windows 32bit package available ? Then you would not need the cygwin approach at all. Davo ---------------------------------------------------------------------- Zvoni · 2022-05-06 12:06 What also doesn't make sense: He's trying to install the 32-Bit Version for Linux (note the "i386") From https://www.cygwin.com/ Quote32 bit Cygwin Address space is a very limiting factor for Cygwin. These days, a full 32 bit Cygwin distro is not feasible anymore, and will in all likelihood fail in random places due to an issue with the fork(2) system call. Therefore we recommend using 32 bit Cygwin only in limited scenarios, with only a minimum of necessary packages installed, and only if there's no way to run 64 bit Cygwin instead. You have been warned. If you're still sure you really need a 32 bit Cygwin, and there's absolutely no way around it, you may run the setup-x86.exe installer. The signature can be used to verify the validity of this binary. There are still people using cygwin? Use VirtualBox, install your preferred Linux-Distro, and be done with it Or remove Windows all together, and move to Linux (which would be the sensible thing to do) ---------------------------------------------------------------------- rvk · 2022-05-06 12:35 Quote from: Zvoni on May 06, 2022, 02:06:08 pmThere are still people using cygwin? Use VirtualBox, install your preferred Linux-Distro, and be done with it Or remove Windows all together, and move to Linux (which would be the sensible thing to do) Or use bash inside WSL2 on Windows. (For FPC is works fine) ---------------------------------------------------------------------- marcov · 2022-05-06 12:59 Can cygwin run linux binaries at all ? Afaik it is an Unix-like environment to compile in, but that doesn't mean the binaries are compatible. ---------------------------------------------------------------------- MarkMLl · 2022-05-06 13:03 Quote from: marcov on May 06, 2022, 02:59:28 pmCan cygwin run linux binaries at all ? Afaik it is an Unix-like environment to compile in, but that doesn't mean the binaries are compatible. Wasn't there something years (decades!) ago about Cygwin being needed for some of the toolchain stuff on Windows? He might have been trying to work from a set of obsolete instructions, and trying to merge an up-to-date FPC version. MarkMLl ---------------------------------------------------------------------- dsiders · 2022-05-06 14:23 Quote from: MarkMLl on May 06, 2022, 03:03:29 pmQuote from: marcov on May 06, 2022, 02:59:28 pmCan cygwin run linux binaries at all ? Afaik it is an Unix-like environment to compile in, but that doesn't mean the binaries are compatible. Wasn't there something years (decades!) ago about Cygwin being needed for some of the toolchain stuff on Windows? He might have been trying to work from a set of obsolete instructions, and trying to merge an up-to-date FPC version. MarkMLl FPC currently supplies its own copy of coreutils. Version info says it was packaged by CygWin. So, I guess we all use CygWin. \_(oo)_/ And, no... cygwin cannot run linux executables. ---------------------------------------------------------------------- marcov · 2022-05-06 16:17 Quote from: MarkMLl on May 06, 2022, 03:03:29 pmQuote from: marcov on May 06, 2022, 02:59:28 pmCan cygwin run linux binaries at all ? Afaik it is an Unix-like environment to compile in, but that doesn't mean the binaries are compatible. Wasn't there something years (decades!) ago about Cygwin being needed for some of the toolchain stuff on Windows? Not that I know.  Before (I think )somewhere during the  FPC 2.2.0 cycle, the textmode IDE's GDB is was cygwin based, which is why we distributed a cygwin dll. Diffutils, binutils and Coreutils and make were based on mingw, at least after 2000. The current versions are mostly based on mingw versions from 2005 because later integrated with MSYS, and were less standalone. The binutils and make are slightly newer (2010/11). I can vaguely remember in very old days, a cygwin make was used in combination with the dos distribution on windows NT to work around dos make's threading issues and quirks See also https://wiki.freepascal.org/helper_tools though that isn't probably 100% up to date. QuoteHe might have been trying to work from a set of obsolete instructions, and trying to merge an up-to-date FPC version. I highly doubt it , and they wouldn't have been for a Linux binary tar ball. Maybe applied WSL instructions to cygwin, or just trying random things Quote from: dsidersFPC currently supplies its own copy of coreutils. Version info says it was packaged by CygWin. So, I guess we all use CygWin. \_(oo)_/ Are you sure, and if so which one? Make sure you don't accidentally use a cygwin binary. But as FPC doesn't package a cygwin dll anymore, this is highly unlikely. ---------------------------------------------------------------------- dsiders · 2022-05-06 17:56 Quote from: marcov on May 06, 2022, 06:17:32 pmAre you sure, and if so which one? Make sure you don't accidentally use a cygwin binary. But as FPC doesn't package a cygwin dll anymore, this is highly unlikely. I stand corrected. That was cygwin intercepting the call i guess. It actially reports GNU fileutils 3.16. My bad. ---------------------------------------------------------------------- dbannon · 2022-05-07 01:20 Hey Steven, if you are still with us.  Please tell us what you are trying to achieve, as you can see, there is quite lot of concern about the way you are going about it right now. I am pretty sure you will get better advice if you explain what you want to be able to do. Davo ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-07 02:12 Thanks for all your responses. You're right that the Linux executables don't run in Cygwin. Due to the legacy software I use, I'm stuck with using 32-bit Windows XP. I use Free Pascal to compile my programs for Windows 32-bit, but a lot of people would like my programs to run in Linux. What I do now is use FP 3.0.4 i386 in Windows and cross compile to Linux. To do that, I installed the Linux i386 version of FP 3.0.4 in Cygwin and the cross-compiler binaries binutils-2.15-win32-i386-linux.zip in C:\FPC\3.0.4\bin\i386-win32. The command I use to cross compile is the following, where %1 is the file to be compiled. ppc386 -Tlinux -FuC:\cygwin\usr\local\lib\fpc\3.0.4\units\i386-linux\rtl -FuC:\cygwin\usr\local\lib\fpc\3.0.4\units\i386-linux\rtl-console  %1 What I wanted to do was upgrade to FP 3.2.2 and cross compile that to Linux. It would also be nice to test my Linux compilations, as I currently can't do that. ---------------------------------------------------------------------- MarkMLl · 2022-05-07 06:29 Quote from: Steven Pietrobon on May 07, 2022, 04:12:52 amThanks for all your responses. You're right that the Linux executables don't run in Cygwin. Due to the legacy software I use, I'm stuck with using 32-bit Windows XP. Either put your sources on a Subversion server and compile separately on Windows and Linux, investigate a cross-compiler, or investigate dual-boot or emulation for different Windows versions. I'd vote for the first of those, since sooner or later library dependencies etc. will give you problems on XP. I've got a copy which I use extremely infrequently but can't remember whether I've tested FPC/Lazarus on it, but it's a fair bet that the compiler and IDE developers won't be enthusiastic supporting it. MarkMLl ---------------------------------------------------------------------- dbannon · 2022-05-07 12:41 Quote from: Steven Pietrobon on May 07, 2022, 04:12:52 am....What I do now is use FP 3.0.4 i386 in Windows and cross compile to Linux. To do that, I installed the Linux i386 version of FP 3.0.4 in Cygwin and the cross-compiler binaries binutils-2.15-win32-i386-linux.zip in C:\FPC\3.0.4\bin\i386-win32. I would have thought you could cross compile to a Linux binary without involving Cygwin I routinely build complete Windows binaries on Linux and don't need any Windows libraries present, someone here must be generating Linux binaries on windows ?? But, personally, I think Mark's suggestion is by a very large margin the best approach. Dual boot your existing computer as long as you have the disk space. Putting your source on a remote repo is a good thing generally but not necessary, Linux will quite happily read and write to your windows file system. And the nice thing is you can test your app under Linux that way too. Scaling can sometimes be a surprise .... And you can safely take your Linux box onto the net, I sure would hate to do that with Windows XP..... Davo ---------------------------------------------------------------------- marcov · 2022-05-07 12:45 There used to be cross binutils on the FTP server, the last time I tried (2015ish I guess).  Then you need to fetch the libraries (.so) you link with and startup code (crt*.o) from the gcc lib on your linux machine. (see e.g. the buildfaq, in the more documentation part of the FPC website) However textfiles and symbol versioning have made the Linux linking process more complex in the last few years. ---------------------------------------------------------------------- lproven · 2022-05-08 09:21 Quote from: Steven Pietrobon on May 07, 2022, 04:12:52 amDue to the legacy software I use, I'm stuck with using 32-bit Windows XP. That is a very bad plan indeed in 2022. Can you give us a little more info about what legacy software and why? Options to explore: XP can run under 64-bit Win7 as a guest and all the tools are free downloads from MS: the VM and the OS image. This is called "XP Mode" and I described it here: https://www.theregister.com/2014/04/10/how_to_run_xp_on_new_windows/ More info: https://www.theregister.com/2009/05/01/windows_7_xp_mode_review/ Win10 is still current and in support. It has a 32-bit version and that can run DOS and 16-bit Windows apps. If you just need some 16- or 32-bit XP software that has drivers or is not compatible with 64-bit Windows, it will almost certainly run natively just fine on 32-bit Win10. XP is out of support even with the extended support hack described here: https://www.theregister.com/2014/05/26/german_tinkerer_gets_around_xpo calypse/ It's not safe to run XP online at all now. Win7 has hacks to get the paid-for enterprise updates. You can run XP Mode on 64-bit Win7 just fine, according to MS itself: https://answers.microsoft.com/en- us/windows/forum/all/windows-7-professional-64-bit-os-and-xp- mode/26ff56f8-6082-e011-9b4b-68b599b31bf5?auth=1 ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-09 01:33 Thanks again for your replies. I use Xilinx Foundation software. I tried to run this in 32-bit Windows 7 but it didn't work. Running it in an XP emulator does work, but it is too slow. When Xilinx updated their software to ISE, there was no path provided to update all my schematic designs to the new version. So here I am, stuck with XP! I have a firewall installed, which has so far kept me safe from hackers. I was surprised to learn that you could run 16-bit programs in 32-bit Windows 10, as that was the problem I was having with getting Foundation to work in Windows 7.  I've now learnt that for Windows 7, you can enable 16-bit programs! https://techtrix.co/can-windows-7-32-bit-run-16-bit-programs/ The reason for using Cygwin was that it was convenient to extract the Linux binaries. I thought it might be possible to also run my Linux compilations there, but that turned out not to be the case. A long time ago, I was able to compile my Pascal programs in Cygwin, but it seems when I upgraded to 3.0.4 that was no longer possible. I think the path forward for me is to reinstall Windows 7 on a new hard drive, enable 16-bit mode and then try running Foundation again. If that works, I can migrate all my data and programs to Windows 7 and avoid all the problems with XP. As to cross compiling my code for Linux, my current setup with 3.0.4 seems to work. It turns out that the person that was having problems with my Linux software was trying to run it on MacOS! The binaries for this system are at https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/3.0.4/ My question is now, how do I extract the MacOS binaries and where do I find the cross-compiler? Thanks again for all your help! ---------------------------------------------------------------------- dbannon · 2022-05-09 02:10 Quote from: Steven Pietrobon on May 09, 2022, 03:33:58 am.... My question is now, how do I extract the MacOS binaries and where do I find the cross-compiler? ... I suspect that is a much harder problem. I personally have an old (Sierra) Mac where I compile my app. I 'think' some people run MacOS in a Virtual Box VM but I really don't know and my (lack of) knowledge of MacOS convinced me it was not an approach that would work for me. Both technical and legal issues as I understand it. Davo ---------------------------------------------------------------------- MarkMLl · 2022-05-09 06:13 Quote from: Steven Pietrobon on May 09, 2022, 03:33:58 amThanks again for your replies. I use Xilinx Foundation software. Roughly translated: FPGA development stuff, parent is now AMD. Long- term support of this sort of thing has long been problematic. QuoteThe reason for using Cygwin was that it was convenient to extract the Linux binaries. I thought it might be possible to also run my Linux compilations there, but that turned out not to be the case. A long time ago, I was able to compile my Pascal programs in Cygwin, but it seems when I upgraded to 3.0.4 that was no longer possible. Did you raise that in this forum or on the ML? I'm sure that at that point somebody would have cautioned you that you were heading off on the wrong track. MarkMLl ---------------------------------------------------------------------- trev · 2022-05-09 08:24 QuoteMy question is now, how do I extract the MacOS binaries and where do I find the cross-compiler? The Wiki article Cross compiling macOS on Linux indicates that it is not possible after Mac OS X 10.7 (Lion)  due to there being no viable linker tools. The edit for this info is dated September 2019. It is possible that the situation has changed in the intervening period, but I wouldn't bank on it. ---------------------------------------------------------------------- marcov · 2022-05-09 08:31 Quote from: MarkMLl on May 09, 2022, 08:13:41 amQuote from: Steven Pietrobon on May 09, 2022, 03:33:58 amThanks again for your replies. I use Xilinx Foundation software. Roughly translated: FPGA development stuff, parent is now AMD. Long- term support of this sort of thing has long been problematic. Yeah, I run the successor ISE in a VIrtual box which runs an ancient Fedora Core. Worse, that is apparently the recommended way. ---------------------------------------------------------------------- MarkMLl · 2022-05-09 09:35 Quote from: marcov on May 09, 2022, 10:31:13 amYeah, I run the successor ISE in a VIrtual box which runs an ancient Fedora Core. Worse, that is apparently the recommended way. I've not used that, but I did spend a bit of time with Intel (nee Altera) Quartus and found I had to jump through hoops to keep it running. Same applied to the low-cost "Tang Nano" FPGA stuff (but I must say that for the cost I rather liked what I saw). Unfortunately, FPGA vendors still appear to insist on funding their development tools from their software sales revenue, rather than ploughing part of hardware revenue into them. Since the first casualty is maintenance to make sure the software runs on newer OSes etc., this approach lets down a lot of people at the "dipping toes in water" stage, and however strong the argument that software used for production purposes needn't be free I can sympathise with the people investing substantial effort into writing open-source tools to support- notably- Lattice hardware. MarkMLl ---------------------------------------------------------------------- PascalDragon · 2022-05-09 11:22 Quote from: Steven Pietrobon on May 09, 2022, 03:33:58 amThe reason for using Cygwin was that it was convenient to extract the Linux binaries. I thought it might be possible to also run my Linux compilations there, but that turned out not to be the case. A long time ago, I was able to compile my Pascal programs in Cygwin, but it seems when I upgraded to 3.0.4 that was no longer possible. Then you must have used some really ancient FPC, cause Cygwin isn't supported for a very long time already (15 years or more). You simply need to download the sources for the FPC version you need and then build a cross compiler there. Then you need suitable cross binutils to link Linux binaries on Windows and the necessary libraries from the target system. You can also try whether FPCUpDeluxe helps you there (don't know if it still works on XP). ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-10 06:25 Quote from: MarkMLl on May 09, 2022, 08:13:41 amDid you raise that in this forum or on the ML? I didn't previously raise the Cygwin issue in this forum. I don't know what ML is. To clarify, I need a cross-compiler so that I can generate MacOS binaries in Windows 32-bit. How can that be done? I don't have a MacOS machine. The cross-compiler for Linux is in binutils-2.15-win32-i386-linux.zip. Is there something similar for win32-i386-macos? ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-10 06:35 Quote from: marcov on May 09, 2022, 10:31:13 amYeah, I run the successor ISE in a VIrtual box which runs an ancient Fedora Core. Worse, that is apparently the recommended way. I run ISE (9.1 and 14.4) in both 32-bit Windows XP and 64-bit Windows 8.1, using an Intel i7-3770 CPU. ---------------------------------------------------------------------- PascalDragon · 2022-05-10 06:58 Quote from: Steven Pietrobon on May 10, 2022, 08:25:23 amI didn't previously raise the Cygwin issue in this forum. I don't know what ML is. Mailing List. Quote from: Steven Pietrobon on May 10, 2022, 08:25:23 amTo clarify, I need a cross-compiler so that I can generate MacOS binaries in Windows 32-bit. How can that be done? I don't have a MacOS machine. The cross- compiler for Linux is in binutils-2.15-win32-i386-linux.zip. Is there something similar for win32-i386-macos? The binutils are not the cross compiler. They are assembler and linker (and some other utilities) used by the compiler. The cross compiler itself is solely provided by compiling FPC with the suitable options, however you need the correct binutils to generate the final binaries. But as trev wrote, cross compiling to macOS (small m!) seems no longer possible due to missing, suitable binutils (in general, not only for FPC). So you either need an Apple system (or a friend with one) or you need to setup a virtual machine. And you need to keep in mind that nowadays you need to compile for two platforms for Apple systems: x86_64 and Aarch64. ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-11 02:10 Thanks for your reply PascalDragon. I was hoping for an easy solution (like with cross-compiling from Windows to Linux), but that doesn't seem to be the case with with cross-compiling from Windows to macOS. By the way, I did the drawings for my PhD thesis on an Apple Macintosh (capital M!) back in the late 1980s. Hard to imagine that a computer running on a 7.8 MHz 68000 could do anything useful! ---------------------------------------------------------------------- DonAlfredo · 2022-05-11 06:14 QuoteI was hoping for an easy solution (like with cross-compiling from Windows to Linux), but that doesn't seem to be the case with with cross-compiling from Windows to macOS.You might try fpcupdeluxe. Its an installer for FPC and Lazarus and makes installing a cross-compiler for macOS as easy as a single click. ---------------------------------------------------------------------- MarkMLl · 2022-05-11 10:34 Quote from: Steven Pietrobon on May 11, 2022, 04:10:48 amBy the way, I did the drawings for my PhD thesis on an Apple Macintosh (capital M!) back in the late 1980s. Hard to imagine that a computer running on a 7.8 MHz 68000 could do anything useful! I did much of the typing for my MPhil on an 8085-based Redactron and finished it off on a 5MHz V20. I did my BSc on a hired typewriter. The interesting thing is that while a modern computer has no problem with cycle-accurate emulation of an 8085 or V20, simulating the motion of all the bits in the mechanical typewriter in real-time is probably pushing the state of the art :-) MarkMLl ---------------------------------------------------------------------- Steven Pietrobon · 2022-05-14 02:21 Quote from: DonAlfredo on May 11, 2022, 08:14:37 amYou might try fpcupdeluxe. Its an installer for FPC and Lazarus and makes installing a cross-compiler for macOS as easy as a single click. I've downloaded fpcupdeluxe-i386-win32.exe but I'm not sure what to do next. macOS is not listed in Cross -> OS.