From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id CB62D385800C for ; Fri, 1 Dec 2023 08:43:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB62D385800C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CB62D385800C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701420194; cv=none; b=G5tVw7759kdeAMgF6itjjfsqGa1aKNYugC6c/oufC0Jou5p/jsUfmhUeQ7eWGav/vOkuXBMoxGdjI1LaGtM4dK8Mx2QyX8tKL0BF49LtMzHQUXk1Y9cHx4oc2BhSaB+aOLzQB0af70XoBRAQyLEBQlT671PCi8xOqqBOkNk2m14= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701420194; c=relaxed/simple; bh=y4dfI6AZWvWpQDKUd4NhNUEfecI6g9s1jw6p+9z5xsU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=jtxMG0ELX4WlgdemRm9/vNBTiaH6BJq5wzwKAWX4dlLe7YF73PIPuREwOBjhXoF01rGcT9LaXpUixdaMnQQe2CeCW+OuC0II/3e/QxNTd0plxjZ98QClhtzMbJSEygpFoJhHk3rjivmv/JmuwMLaiOrIX6ooI/jhcpnkK2MyAcU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50bc501081fso2709820e87.1 for ; Fri, 01 Dec 2023 00:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701420191; x=1702024991; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NyNkpDDbP8vOLlcJCDgfwIkIXwFMB3gBQx3pjpbP87Y=; b=WbmACKTXbvvefJr3oaYmigfcrUuR1RbLq1M2JmRQE3loRXGzUrtGb9Sk18kCPEFbDF JoE4wSlRNekaxorsRw1WGQ/UFaK6He6DXvooU5C93mPHdAc8SsaJXooR+becT1CsxCtZ 2bCfTPSTmhEkVCD8ApZZyvghyIzT7rin+VNsvObGAF+gM5SCKLzyVJ8Z3PuRj1jMHcJ0 7A1PqyEdDCqOuhJaty/IRoA02oiJ7MzzDsuW+Bezydv1bbqIVgABYQ7PHJYeZgYgkyET IGf/YZ+ICP/mBEPjeF0X0J6TbUhEKvVFaYI8/gQ8PbGmZN7lu5JbPMH5UBjxTmLI2whm CRMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701420191; x=1702024991; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NyNkpDDbP8vOLlcJCDgfwIkIXwFMB3gBQx3pjpbP87Y=; b=ZWlVv15kCuU5kNy2OyAbEtbyuTNH24R6wUoEQemjp8RtSl6018mprfhglonhIPFTxR ky3fqFQLwHiUo/DeQRCcaT4ajEntk2jgRoM/f9yvnPbylwteL8jVPQ13TiXdsL+R9aKP jHqHs/alA8IU1yLTWc3NQuGo9nkqBSNWw2g1cq+NtcIymW6pkWv9ZShU80RmdQhIh/Jf n0MvNGWi38Ys2xmRFFkUFF4jI8lmnHuQHT2l0cKo4M7hp3yBYVGx+hBTMXu4YtdevF4t nTdE9AXIVhzjUaSLClPktsOilYN2cToF8Nig5n8xjk1R2ip3Ak4IqqRSP/JKmvr6k6+Y PMeQ== X-Gm-Message-State: AOJu0Ywi5FQcDtcCEC5LBLVGwss1yWg0xo9e3AaY75Sq79iRevrNw26l fhDW/d0YNtpsVAJwUtPs5XqaawQ52gY5DcabuzE= X-Google-Smtp-Source: AGHT+IFCeJtp2Xl9ig/PKK4JNqZEMNB6Qfq3kOM0FRMEfmp8x7Mr5in2dVWQXb22bfY9rGEKXeyJLxPAGOymkoQw+gA= X-Received: by 2002:ac2:46f4:0:b0:50b:c4ba:b712 with SMTP id q20-20020ac246f4000000b0050bc4bab712mr465736lfo.15.1701420190948; Fri, 01 Dec 2023 00:43:10 -0800 (PST) MIME-Version: 1.0 References: <878r6es634.fsf@oldenburg.str.redhat.com> In-Reply-To: <878r6es634.fsf@oldenburg.str.redhat.com> From: Richard Biener Date: Fri, 1 Dec 2023 09:42:57 +0100 Message-ID: Subject: Re: libgcov, fork, and mingw (and other targets without the full POSIX set) To: Florian Weimer Cc: gcc@gcc.gnu.org, Jonathan Yong <10walls@gmail.com>, Jan Hubicka , Nathan Sidwell Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Dec 1, 2023 at 9:04=E2=80=AFAM Florian Weimer via Gcc wrote: > > I've received a report of a mingw build failure: > > ../../../gcc/libgcc/libgcov-interface.c: In function '__gcov_fork': > ../../../gcc/libgcc/libgcov-interface.c:185:9: error: implicit declaratio= n of function 'fork' [-Wimplicit-function-declaration] > 185 | pid =3D fork (); > | ^~~~ > make[2]: *** [Makefile:932: _gcov_fork.o] Error 1 > make[2]: *** Waiting for unfinished jobs.... > > As far as I understand it, mingw doesn't have fork and doesn't declare > it in , so it's not clear to me how this has ever worked. I > would expect a linker failure. Maybe that doesn't happen because the > object containing a reference to fork is only ever pulled in if the > application calls the intercepted fork, which doesn't happen on mingw. > > What's the best way to fix this? I expect it's going to impact other > targets (perhaps for different functions) because all of > libgcov-interface.c is built unconditionally. I don't think we run > configure for the target, so we can't simply check for a definition of > the HAVE_FORK macro. This is wrapped inside #ifdef L_gcov_fork #endif grepping didn't find me what defines this, but it suggests the solution lies there ... Richard. > > Thanks, > Florian >