X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=2zpT3ZlpWMWwyPhoy2r/OG00HsfOu/FNMdrgrvZk46A=; b=TiQvsnWxT9egfFF6lKk60wTO7u2c5ExoPfuo6pBv+cq/xZ9Ec0kj5eJsGG1PFrAV/C UNwc5aid0uO6lthotKq5LbYTWaqjNVohaql2fhU6EE/y30mFN92GPA/EInl0Dxxehjbd 3PhAex5qhoovaNMo47jufL9tj3A/UnRCxJzzIqFQKJkMKmPEXbBPzQKgUCX9tYnrUHeY HZ9LqAbV5s/yX5gx70zjzPsfNNe3NJPnf+jQTWiryeW9AXFqk/D+hwPbgiPylg0NeIwC yib7996WI1y6vKK0K0iUUgiOPqAqMjR4mxE+AtjMlGswwweKupALFOF4NCGrQhBk9aAX j6tA== 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=2zpT3ZlpWMWwyPhoy2r/OG00HsfOu/FNMdrgrvZk46A=; b=ygfNN5vd9tH2RGAzPcLqOPmImEYZ2Bd3D9wLDfxH9l4n9KyW+la/tQNm5bHeMvw9FP a26E5uyWFNlM1mw5hXwFg/UWaJDOMIwUJCuSOGklJsm77COTlrhMIfP0AqsoCNf14PEI iHkTrQTNWKviHD9x1ZjMYoQ9h2ymo154hzcgpXJWFI5g1C3GHgYmLm+7J8rqints76GZ hdbwJTjLNxuIrnw4UcsE2FZCsAAy5xFGKP+iSko6uM92wWhBOaqY5Q9oKr5PnjUlam4n eOpWB5rJ+IL+1gEhgUItLt++AfBUBxkCmfc7x3iSk9NevhEHND1jC9UnYK8rBtsc4W5p GL4w== X-Gm-Message-State: AOAM5306GwQ9FYERAdZNHdY7GOQBsF4wnMZFPsbQQEKDkWZvLIvUFqO0 ocXpGKYFMwfhTnQE4JN3dlDfvJpX3NM= X-Google-Smtp-Source: ABdhPJy8KD8VOnmlYT6EMPQ0Zr4H8Ytl+G1l7/3dIKtWXtf8zhrf7U3zTFAuHOBULGP44F0QwAOufQ== X-Received: by 2002:a17:906:9b86:b0:6fe:d37f:b29d with SMTP id dd6-20020a1709069b8600b006fed37fb29dmr16228910ejc.327.1653497663069; Wed, 25 May 2022 09:54:23 -0700 (PDT) Message-ID: <224eb9dc-337e-f78f-ea4e-58bb15eb580b@gmail.com> Date: Wed, 25 May 2022 18:54:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: GNU pth during djgpp build time? Content-Language: en-US To: djgpp AT delorie DOT com References: From: "J.W. Jagersma (jwjagersma AT gmail DOT com) [via djgpp AT delorie DOT com]" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 2022-05-02 05:49, janezz55 (janezz55 AT gmail DOT com) [via djgpp AT delorie DOT com] wrote: > I know a port exists, but for all I know it's an add-on to an already existing djgpp install, so no header becomes available after installing it. But if pth could be built during build-time of djgpp, would become available. Does any build script (for linux) feature this? I tried to do the hack myself, but it took too much time. Maybe there's an alternative to GNU pth to get ? Hi again, I have some progress to report: it doesn't work :) Surprisingly, configuring gcc with --enable-threads is actually possible, but it did require a small patch to Pth. The executables it produces however, will not run. A thread-aware libgcc will try to lock a mutex in __register_frame_info(), which is invoked from crt0 before __crt1_startup(). But locking a mutex involves a whole series of libc functions that rely on things like _dos_ds, which are only initialized from __crt1_startup(). Fixing this would involve reordering the crt0 startup logic. Or maybe libgcc could be patched to not use a mutex at that point. If you (or anyone else) want to experiment with that, you can use the following build scripts: https://github.com/jwt27/build-gcc/tree/pth Checkout branch 'pth', then first build a regular toolchain: $ ./build-djgpp.sh --prefix=$HOME/djgpp djgpp-cvs binutils gcc Then use that toolchain to compile Pth and build a second toolchain configured with --enable-threads=posix (this is done automatically in one step): $ PATH="$HOME/djgpp/bin:$PATH" \ ./build-djgpp.sh --prefix=$HOME/djgpp-pth djgpp-cvs binutils gcc watt32 pth Linking requires -lstdc++ -lpthread -lsocket, in that order.