Re: Statically link libwinpthread-1.dll in gdbserver

Claude Robitaille via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <DS7PR07MB7686F112520A068D54103ED3F7C19@DS7PR07MB7686.namprd07.prod.outlook.com>
No. I did not try.

But, if I do this on the top level configure command line, wouldn't then everything be statically linked? Is it possible to pass this falg only to the gdbserver configure command?
________________________________
From: Pedro Alves <[email protected]>
Sent: May 2, 2022 9:27 AM
To: Claude Robitaille <[email protected]>; [email protected] <[email protected]>
Subject: Re: Statically link libwinpthread-1.dll in gdbserver

On 2022-05-02 13:11, Claude Robitaille via Gdb wrote:
> Hi,
>
> I am trying to produce a statically linked gdbserver (except the distribution DLL from Windows). I have everything in except for libwinpthread-1.dll. I
> guess gdbserver should be linked with libwinpthread.a but how to tell the build system to do so?
>
> I am using this command line to configure:
> ../binutils-gdb/configure --enable-static --with-static-standard-libraries --disable-gdb --host=x86_64-w64-mingw32
>
> and then followed by
> make
>
> Using objdump, I see that the following DLL are needed by the binary
> KERNEL32.dll
> msvcrt.dll
> libwinpthread-1.dll
> USER32.dll
> WS2_32.dll
>
> As you can see from the command line, I am using mingw-w64. I am using the stock Ubuntu 20.04 package for it, which includes the following library files for pthread
> -rw-r--r-- 1 root root 388692 Nov 15  2019 libpthread.a
> -rw-r--r-- 1 root root  88994 Nov 15  2019 libpthread.dll.a
> -rwxr-xr-x 1 root root 621013 Nov 15  2019 libwinpthread-1.dll
> -rw-r--r-- 1 root root 388692 Nov 15  2019 libwinpthread.a
> -rw-r--r-- 1 root root  88994 Nov 15  2019 libwinpthread.dll.a
>
>

Have you tried passing "-static" in CFLAGS/CXXFLAGS?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.