From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by sourceware.org (Postfix) with ESMTPS id A5A403858D3C for ; Mon, 2 May 2022 13:27:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5A403858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id ay11-20020a05600c1e0b00b0038eb92fa965so10812767wmb.4 for ; Mon, 02 May 2022 06:27:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=K9jILApCmJBgz8R7wt+EGm3ppJCacwBEeS8aK1PRsy0=; b=rHotGazhIviiiod5+AHBn8bpu4uOuurh9Ts4bnaGT2zYMsn4olTdHXhKXf3JBrrlRW 7vQMT9O8xGKkD+vxV8DdKk9wNXHXGOe/TyhfqX9R97laBFNRkJPRu1ChW8cG5Q16q0je IO6FyCJgllfU/HyeRLh9Y0XnUqRLfS7Ry4APrumG1zowxTYeDOTkkp4dJnqSAkVZjhb5 /3399FO5T9ajHu1CxCQdt9D1/86BtVvL16/LxiJGxBkGUWu60nvZ26zi01IPnIb9uzkT IgRRyXpA8TxLxELexfiGCD0DI91vgR9F+VORUM9065eufqJVl+oQ5KmZS6AUFDzpxE6H +2mA== X-Gm-Message-State: AOAM530Xlg2rsMV4gwQgLC/yNQ2TrDSA5dcSWAA3KcFQuMkBx4KJujPI FCcM9TXQwCC2uTYAEugTzZAal1STZ3Y= X-Google-Smtp-Source: ABdhPJwpigtkcijry1x+gbuGp/wK3eV99TCA3ByfSQikt7UGMcj+cheO/lX2XbV0xQ5DM/WkWDmvEA== X-Received: by 2002:a1c:7414:0:b0:394:1d5d:27f2 with SMTP id p20-20020a1c7414000000b003941d5d27f2mr11104697wmc.37.1651498074438; Mon, 02 May 2022 06:27:54 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id w6-20020adf8bc6000000b0020c5253d8bdsm8675579wra.9.2022.05.02.06.27.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 May 2022 06:27:53 -0700 (PDT) Message-ID: <3ed22fb6-43f0-dc8c-a10e-6efa9baa8a1c@palves.net> Date: Mon, 2 May 2022 14:27:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Statically link libwinpthread-1.dll in gdbserver Content-Language: en-US To: Claude Robitaille , "gdb@sourceware.org" References: From: Pedro Alves In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 13:27:57 -0000 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?