Compiling the runtime library

New to FreeBASIC? Post your questions here.
Site Admin
Posts: 3158
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada

Re: Compiling the runtime library

Postby coderJeff » Mar 24, 2019 15:35

St_W wrote:unfortunately I cannot remember the reason why MSYS2 didn't work there back then either. For manual builds on other machines I'm using MSYS2 nowadays and it works just fine.

mingw-org (the first one, 32-bit) has very good support for long command lines on windows. You can see what the limits are by checking output from 'xargs --show-limits'.

mingw-w64 (32/64 bit) simply uses windows CreateProcess() function, and the command line length limits are much shorter. Previously I would have used mingw-w64 build tools, and 'make' from mingw-org. Now, in fbc-1.07.0 I changed some of the techniques used in fbc's makefile for some build systems to handle the shorter command line lines. For example, using xargs, or wildcard filter instead of trying to pass the very long list of filenames to the child processes.

Normally, I just run 'make ...' from cmd.exe for most development tasks. And almost never use msys, msys2, sh, bash, etc.
Juergen Kuehlwein
Posts: 278
Joined: Mar 07, 2018 13:59
Location: Germany

Re: Compiling the runtime library

Postby Juergen Kuehlwein » Apr 05, 2019 12:43

... not much time for coding recently. Finally i was able to make it work - thanks for your help and advice. The problem wasn´t related to MSYS2 at all. It was due to different gcc versions.

As a Windows guy i´m not that familiar with all this Unix stuff, so i thought it would be nice to stay on known ground and to be able to implement a batch file instead of a bash file. After some testing i ended up with a batch file like this:

Code: Select all

echo off


cd d:\freebasic\jk-fork-old

make rtlib TARGET=i686-w64-mingw32 ENABLE_STANDALONE=1

I couldn´t get mingw32-make.exe to run, but make.exe from MSYS2 finally did the job.

So in Windows you basically need two things: an installation of MSYS2 and and a mingw32 installation with an appropriate version number (5.4.0 in this case). First i had to run make for libffi in order to get the libffi headers. Then ffi.h and ffitarget.h (in x86_64-pc-msys\include) had to be copied to ...\mingw32\i686-w64-mingw32\include. After these preliminary steps the above batch creates working copies of fbrt0.o, libfb.a and libfbmt.a on my machine (of course your paths may be different).

Return to “Beginners”

Who is online

Users browsing this forum: travma and 2 guests