Revision [16303]

This is an old revision of DevMakingReleases made by DkLwikki on 2012-08-17 17:49:43.

 

Notes on making FB releases



Manifests

Win32

FreeBASIC-x.xx.x-win32


ENABLE_STANDALONE := YesPlease
ENABLE_FBBFD := 217
FBCFLAGS := -d ENABLE_TDMGCC
FBLFLAGS := -p c:/path/to/libbfd217/


fbc-x.xx.x-mingw32


FBLFLAGS := -p c:/path/to/libbfd217/
ENABLE_FBBFD := 217


Linux

Building binaries that work on most of the available GNU/Linux distributions is hard because even though they are often similar in general, they differ differ in detail just as often. The most common problem is mismatching glibc versions, i.e. the fbc binary is run on a system with older glibc than the one it was built on, and an "glibc too old" error is encountered. The ncurses library is not always exactly the same either, as shown by the "`ospeed' has different size, consider re-linking" warnings when running fbc. That's why the Linux releases have usually been built in some GNU/Linux system old enough to let the fbc binary work on Debian 4 and 5, the current supported Ubuntu versions (especially LTSs), Fedora and OpenSUSE.

As of FB 0.24 it's possible to create static ELF binaries using musl libc instead of glibc, which should prevent the problems mentioned above. Other alternative libc's might work too, though I (dkl) tested only musl libc and dietlibc, and musl worked almost without problems, while compiling the rtlib with dietlibc required more adjustments. Besides getting the rtlib to build, the other big issue is getting the proper target libraries.

libc & co (including crt{1,i,n}.o) are easy to build from the musl sources, but properly compiling GCC to get libgcc, libsupc++ and crtbegin.o/crtend.o requires some experience. Luckily there is a script to create a musl libc GCC cross-compiling toolchains available at https://github.com/GregorR/musl-cross.

The contrib/build-musl-fbc.sh script uses that to build a whole "musl-fbc" setup, including the CRT/GCC/ncurses/bfd/CUnit target libraries needed to build a static fbc binary with it.

This should be enough for an fbc linked against musl libc, although it won't be enough for many other FB programs (e.g. graphics). The script builds a standalone FB setup, which is the native-to-musl cross-compiler with the binutils/libraries in order to compile static linux-musl FB programs. This setup can be used to create static FB programs, by doing:
.../fbc/fbc-new -static -l tinfo ...

FreeBASIC-x.xx.x-linux-musl


FBC := .../musl-fbc/fbc/fbc-new
FBLFLAGS := -static -l tinfo
ENABLE_FBBFD := 217
ENABLE_STANDALONE := YesPlease


FreeBASIC-x.xx.x-linux


FBC := .../fbc-musl-release/fbc
FBLFLAGS := -static -l tinfo
ENABLE_FBBFD := 217

This should result in a static fbc binary built using the musl-fbc setup, and normal rtlib/gfxlib2 builds, compiled with the native gcc. Even though the fbc binary will be statically linked against musl libc and be very portable, the rtlib/gfxlib2 will still use the system's glibc headers, so the compilation should not be done on a system with the latest glibc version, but perhaps on a system with slightly older version, just to ensure the rtlib won't use any new APIs that would make it ABI-incompatible with older glibc versions. This is essentially the same problem as with fbc, but it cannot be avoided, but just compiling against a specific glibc version causes less trouble than linking against a specific glibc version.



DOS

FreeBASIC-x.xx.x-dos


ENABLE_STANDALONE := YesPlease
ENABLE_FBBFD := 217
FBLFLAGS := -p c:/path/to/libbfd217/


fbcxxxxb.zip


ENABLE_FBBFD := 217
FBLFLAGS := -p c:/path/to/libbfd217/


FB manual/documentation

Back to FreeBASIC Developer Information

Back to Table of Contents
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode