which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

General FreeBASIC programming questions.
srvaldez
Posts: 3629
Joined: Sep 25, 2005 21:54

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by srvaldez »

the following builds gdb ok but with many dependencies
./configure --disable-shared --enable-static --prefix=/d/devC/gdb-16.3/Local64
make CFLAGS="-static -static-libgcc -static-libstdc++ -O2"
now I am trying
make CFLAGS="-static -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -lgmp -lgcc -lexpat -liconv -lintl -llzma -lzstd -Wl,-Bdynamic -O2"
if I understand it right, -Wl,-Bstatic tells the linker to link static libraries that follow the statement and then -Wl,-Bdynamic tells the linker to link dynamic libraries if any

let see what happens
no-go, it was almost finished but then error-out on tui something :(
adeyblue
Posts: 353
Joined: Nov 07, 2019 20:08

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by adeyblue »

With Gdb 15.0.90 weekly from https://sourceware.org/pub/gdb/snapshots/branch/ and the environment I use to build FB with, I built it like this:

In the top level directory (the one with the bfd and gnulib folders)

Code: Select all

configure --host=x86_64-w64-mingw32 --disable-sim --disable-shared --enable-static --disable-threading --disable-rpath --disable-tui --disable-gdbtk --disable-profiling --disable-source-highlight --disable-unit-tests --with-gnu-ld --without-intel-pt --without-xxhash --enable-targets=x86_64-w64-mingw32,i686-pc-mingw32 --without-expat --without-babeltrace --without-libunwind-ia64 --without-python --without-guile --without-lzma CFLAGS='-O2 -s' CXXFLAGS='-O2 -s' --without-zstd --without-mpc --with-static-standard-libraries --enable-ld --disable-gprofng --disable-compressed-debug-section --disable-libquadmath --disable-libquadmath-support
make
Everything compiled but gdb didn't link, because it really wants mpc
./libtool: line 5222: cd: no/lib: No such file or directory
So I went into the Makefile in the gdb directory and removed the -Lno/lib from the GMPLIBS line and commented the line underneath with a no/lib in it too. Then it built, 15MB 64-bit exe -- with gmp and mpfr as dlls. I renamed the dll libs for those and tried again but it seems I don't have an up-to-date enough GCC to build them in as static libraries:
Undefined reference to __stack_chk_fail
and I'm not changing the version of GCC so that's where I ended up.

---

If you run
gdb --configuration
with an existing gdb exe, it'll print out the configure command line it was built with like the one above.
VANYA
Posts: 1868
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

srvaldez wrote: Apr 25, 2025 18:38 the following builds gdb ok but with many dependencies
./configure --disable-shared --enable-static --prefix=/d/devC/gdb-16.3/Local64
make CFLAGS="-static -static-libgcc -static-libstdc++ -O2"
now I am trying
make CFLAGS="-static -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -lgmp -lgcc -lexpat -liconv -lintl -llzma -lzstd -Wl,-Bdynamic -O2"
if I understand it right, -Wl,-Bstatic tells the linker to link static libraries that follow the statement and then -Wl,-Bdynamic tells the linker to link dynamic libraries if any

let see what happens
no-go, it was almost finished but then error-out on tui something :(
Yes, I get about the same results. Thanks for the answer!
adeyblue wrote:If you run
gdb --configuration
with an existing gdb exe, it'll print out the configure command line it was built with like the one above.
Good advice, thanks! Still to know what was transferred to the Make utility.

------------------------------------

When build by default, the last GDB for all systems, including WinXP: 10.1.
All versions issued later refuse to work on WinXP due to the absence bcrypt.dll
So, if you need a universal version for Windows, then link for downloading, proposed SARG: the best option. I never managed to repeat the same binary file without dependencies.

Of course, you can cut something in GDB when assembling more new versions so that they also become universal, but then the GDB will become inferior.

-----------------------------------

For myself, I collected the latest version 16.3 with dependencies. In principle, such dependencies (works , starting with Win7):
gdb.exe
libgcc_s_dw2-1.dll
libgmp-10.dll
libiconv-2.dll
libintl-8.dll
libmpfr-6.dll
libncursesw6.dll
libstdc++-6.dll
libwinpthread-1.dll
libzstd.dll
zlib1.dll
The total size for all files is small: 17MB
srvaldez
Posts: 3629
Joined: Sep 25, 2005 21:54

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by srvaldez »

I managed to build the 64-bit version of gdb-16.3 with only 8 gnu dlls and 6 Windows dlls namely ADVAPI32.dll, USER32.dll, WS2_32.dll, bcrypt.dll, KERNEL32.dll, msvcrt.dll, libgcc_s_seh-1.dll, libncursesw6.dll, libwinpthread-1.dll, libpython3.12.dll, libtermcap-0.dll, libiconv-2.dll, libintl-8.dll, libpython3.12.dll

total size of gdb + gdbserver + gnu-dlls after stripping = 22,334,319 bytes
VANYA
Posts: 1868
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

srvaldez wrote: Apr 26, 2025 17:16 I managed to build the 64-bit version of gdb-16.3 with only 8 gnu dlls and 6 Windows dlls namely ADVAPI32.dll, USER32.dll, WS2_32.dll, bcrypt.dll, KERNEL32.dll, msvcrt.dll, libgcc_s_seh-1.dll, libncursesw6.dll, libwinpthread-1.dll, libpython3.12.dll, libtermcap-0.dll, libiconv-2.dll, libintl-8.dll, libpython3.12.dll

total size of gdb + gdbserver + gnu-dlls after stripping = 22,334,319 bytes
Have you forcibly compiled with Python's support?
If not, where does the dependence of Libpython3.12.dll come from? By default, this dependence is not required. This means that one library can still be reduced.
srvaldez
Posts: 3629
Joined: Sep 25, 2005 21:54

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by srvaldez »

VANYA
I had configured with ./configure --disable-shared --enable-static --prefix=/d/devD/gdb-16.3/local64
and invoked make as follows
make -j7 CFLAGS="-static -static-libgcc -static-libstdc++ -Wl,-Bstatic -ldl -lexpat -lgcc_s -lgmp -liconv -lintl -llzma -lmpfr -ltermcap -lncurses -lstdc++ -lpthread -lzstd -Wl,-Bdynamic -O2" CPPFLAGS="-static -static-libgcc -static-libstdc++ -Wl,-Bstatic -ldl -lexpat -lgcc_s -lgmp -liconv -lintl -llzma -lmpfr -ltermcap -lncurses -lstdc++ -lpthread -lzstd -Wl,-Bdynamic -O2"
Note: I don't think that -Wl,-Bstatic does anything useful, instead, I renamed the relevant import libraries like libgmp.dll.a to something like ---libgmp.dll.a so that the linker would use the static versions

but just a short time ago I did ./configure --disable-shared --enable-static --without-python --prefix=/d/devD/gdb-16.3/local64
with the same make statement as above and the 64-bit version has to the best of my knowledge the following dependencies: 6 Windows dlls ADVAPI32.dll, bcrypt.dll, KERNEL32.dll, msvcrt.dll, USER32.dll, WS2_32.dll
and 5 gnu dlls libwinpthread-1.dll, libncursesw6.dll, libtermcap-0.dll, libintl-8.dll, libiconv-2.dll
total size 15,990,206 bytes

./configure --help didn't mention python but it did mention --without-PACKAGE so I tried it with --without-python and it worked

if anyone wishes to try it you may get it from https://u.pcloud.link/publink/show?code ... 1748MnVtMk
it would help me to determine if there are anymore dlls that need to be included, you never know if you have software installed and is on the PATH that has some dll that is common with gdb
coderJeff
Site Admin
Posts: 4385
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by coderJeff »

srvaldez wrote: Apr 27, 2025 11:51 if anyone wishes to try it you may get it
it would help me to determine if there are anymore dlls that need to be included, you never know if you have software installed and is on the PATH that has some dll that is common with gdb
So far only noticed it also needs 'libgcc_s_seh-1.dll'. I was lazy and grabbed the dll from mingw-w64-gcc-13.2, I guess it's close enough that it worked.

First impression is that this is a good build.
Just trying it now debugging an fbc.exe built with gcc-13.2
I'm so happy the terminal works and can load 32-bit fbc.exe no crashes, very nice

Thank-you, srvaldez!
srvaldez
Posts: 3629
Joined: Sep 25, 2005 21:54

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by srvaldez »

thank you coderJeff :D
I updated the 64-bit archive to include the libgcc_s_seh-1.dll
the 32-bit version https://u.pcloud.link/publink/show?code ... c2xpK96N3V
and the 64-bit version https://u.pcloud.link/publink/show?code ... 1748MnVtMk
VANYA
Posts: 1868
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

srvaldez wrote:if anyone wishes to try it you may get it from
Yes, not enough 'libgcc_s_seh-1.dll

---------

I collected different versions of GDB in one place. Version 9.1 (from srvaldez) and 10.1 (from the site https://www.equation.com/)
I collected the rest of the versions myself.

Here is a link to all versions for Win32 and Win64: https://users.freebasic-portal.de/vanya/gdb/
VANYA
Posts: 1868
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

I updated all assemblies (except 9.1, 10.1). Now they are all without GNU dependencies and can even work on Windows XP (at least assembly for 32-bit).

@srvaldez
I know that it will be interesting how I achieved this. Therefore, I write right away: I found an excellent assembly GCC 14.2: https://github.com/ssbssa/gcc/releases/ ... 2-ssbssa-1
This author has unofficial GDB assemblies. I collected official GDB packages using GCC 14.2 assembly.
Post Reply