From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 77F673858422 for ; Thu, 22 Sep 2022 09:51:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77F673858422 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x630.google.com with SMTP id lc7so19939711ejb.0 for ; Thu, 22 Sep 2022 02:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=BwYUUKEeEsSk1uWsHmf7oNhkEc8VA2mki2aROXni5SE=; b=QCXGi3Z6ikEtb1JwI1l0tbM0GXP1Wsbw569zZ1uPg5/YwcaRqh+UNTd37ulMMySD44 3aewR7f+fb/JJN5JdYDgSlc6n9+PTGFa/OW/9kiIVyqV7DFFl5V4CadOPXV0nbTe5diY Mo2rYEcMqbGdU7tvqSMxGvU9q+d/U18o2vAoNl/1oWML0MdW9UxBCpv4/nui6E4Dg9iT VKBShY8Xvq30F2JxiTTxspHPKQBY4eNLS6xlxHP7cq01P+xwrDEPhf7xzE1E1c7que63 RhMzceg6jzZieV71MgQtnBrjDhPY3bHJDN+bbun9bN6s3WdnwO0FY3Jl5SkERRoP552V 86gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=BwYUUKEeEsSk1uWsHmf7oNhkEc8VA2mki2aROXni5SE=; b=dIfHn+/oXUTqR0VgFJC/hrNlvITO+Efn7F8dONwC8tNe848WnTXfnPtLa4aOJyCvuK DgpC0dxbDQHRlarcQHQPbq1/VbQvf1K2uXBe6qhrn9XC6/m9cfEDUtqXT2ZUzBtS4m5/ 3JRrJbKY6ijkhmdMT+og8XEM6QyZtnV4PsnekMjgEIbKtPDvEHX3FWtr1GCwxKhO1okY DRl6s2O1muza/b82BI6zgrNCNFVxr8o9ayRfmFxn9dyoiPaRv6tLIg/jcnhr5D1M+786 PHotCrRUuNioZfg2ZPnG1nt59dmU5S5CkXAHUlEKials3PrOQudPkto56LWYja5eMyJ2 bxKw== X-Gm-Message-State: ACrzQf0N7aX+XGV5lCxRbpH7V5fybqYob05I28/YHKXe1d3fZzRs9DT8 q7/VuVR2a13xKfbZ2CALPYrE+jISfevHiudk0u8= X-Google-Smtp-Source: AMsMyM4/orkCPSzeA2LV57D6sLG/eCR5P/pAmw5NhaGHv6NSGJeoHAhrJ61ulmOD08S31NlSQTh7nwKAwPAe6f6PLR8= X-Received: by 2002:a17:907:1623:b0:77e:9455:b4d9 with SMTP id hb35-20020a170907162300b0077e9455b4d9mr1935957ejc.491.1663840260876; Thu, 22 Sep 2022 02:51:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: mizo 91 Date: Thu, 22 Sep 2022 11:50:49 +0200 Message-ID: Subject: Re: CreateProcess No such file or directory To: Jonathan Wakely Cc: LIU Hao , gcc-help@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000b66cfa05e940ff21" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: --000000000000b66cfa05e940ff21 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you both, I did a little research on gcc/driver bugzilla and it seepms my problem might be ralated to those bug reports: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D86030 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D45749 <- this one goes way back to 2010 but it is still pending Kind Regards, Filip czw., 22 wrz 2022 o 10:42 Jonathan Wakely napisa=C5=82(a): > On Thu, 22 Sept 2022 at 09:19, Jonathan Wakely wrote: > > > > On Thu, 22 Sept 2022 at 07:45, LIU Hao via Gcc-help > > wrote: > > > > > > =E5=9C=A8 2022/9/21 00:02, mizo 91 via Gcc-help =E5=86=99=E9=81=93: > > > > Hello, > > > > > > > > I'm having trouble compiling simple test program on windows 10 with > long > > > > list of includes provided via '@response_file' argument > > > > > > > > > > > > > > Greetings. mingw-w64 developer speaking. > > > > > > As far as I can see, there are at least two issues about your report: > > > > > > > > > The first, obvious issue is that the error message is incorrect. The > reason for that is, if we take > > > a look at 'libiberty/pex-win32.c' we see the following: > > > > > > 853 /* Create the child process. */ > > > 854 pid =3D win32_spawn (executable, (flags & PEX_SEARCH) !=3D 0, > > > 855 argv, env, dwCreationFlags, &si, &pi); > > > 856 if (pid =3D=3D (pid_t) -1) > > > 857 pid =3D spawn_script (executable, argv, env, dwCreationFla= gs, > > > 858 &si, &pi); > > > 859 if (pid =3D=3D (pid_t) -1) > > > 860 { > > > 861 *err =3D ENOENT; > > > 862 *errmsg =3D "CreateProcess"; > > > 863 } > > > > > > We also notice this is the only place where `"CreateProcess"` appears > as a sole part of an error > > > message. > > > > > > The cause of this issue is apparent: libiberty tries `win32_spawn`, > and if for whatever reason it > > > fails, it makes another attempt with `spawn_script`, and if it fails > again, `*err` is always set to > > > `ENOENT` i.e. `No such file or directory`, no matter why. > > > > It seems to me that pex-win32.c should use GetLastError() (and maybe > > FormatMessage) to get a Windows error code, rather than assuming > > ENOENT. > > > > Using C++ that would look something like: > > > > std::string errmsg =3D "CreateProcess:" + > > std::system_category().message(GetLastError()); > > > > Or maybe win32_spawn should call GetLastError() and convert that to an > > errno value and store it in errno: > > > > std::error_condition ec =3D > > std::system_category().default_error_condition(GetLastError()); > > if (ec.category() =3D=3D std::generic_category()) > > errno =3D ec.value(); > > else > > errno =3D ENOENT; // or EINVAL might be better? > > I reported https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107007 > --000000000000b66cfa05e940ff21--