From nobody Tue Mar 07 23:49:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PWXGz0KHcz3wpb1 for ; Tue, 7 Mar 2023 23:49:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PWXGy6mQpz4Dw3 for ; Tue, 7 Mar 2023 23:49:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52e.google.com with SMTP id x3so59052928edb.10 for ; Tue, 07 Mar 2023 15:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678232970; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=d9yqdvRs+hVawM8jD+X8ba7qoswewvSRTm7nLljtUNE=; b=kEHakIcoqResW+RcDFTmbBgFW5swanI+gYLogEm+agTsvxKhGCxzPfaUEYsdRcTPOn qq1rjKeLySKHbx/XHy48fm10Wc5Fuc7ej77prmNRP2vcPvzbn0l5NiF7bAK8d48+Pdak PjL9ahFewG9n3ON3yJDzqxSzexySlwcpz7FfHwHb7nY/e6bz+ozBqor5JHgpCXwR/Tos QFomMYpk4D4Je0FUN2T1g+nt0Mv/dGTn0BaGg1RLpSJvtoe1u1ILwrBWGhJ+0ct8+Fx1 cvIY/CQ0TwoT/qQLDGBeBVYZyb4JH3XHEQ6pZJaVJwgOe18t0ol2tyuQHLOTWWk4408Q T86Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678232970; h=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=d9yqdvRs+hVawM8jD+X8ba7qoswewvSRTm7nLljtUNE=; b=r6QW5UjMe7Nlxv3EQEr0UG3NeEkgNM+2JQiO176CCeN8atW2wsBPOqbl72bDk7aQ1H a7202EWMSgMWU+Ca5IU0Z73nad8AFmhj/mSB8c2vz2qASRxBbuZr8amjQTu85IuxfaSX hldK1J3QBMtw5LnNzAhgh5CVQkxaZArRJYdTyozQmxUXxL66ZLOKhN3PZcGEfRSbkIXg /KU7kluNBxHKR/0vtCE/ndoc4T86ugET2DSpamuyZB0oXf/MrsQpRH3wtR2SrZk23CwB q4/L76NVvhO9S584k44x7wtCIZOEKdwfd4eq1L2OWTUGtv5MzGQCvuO2fRipWfxpPK6Z USpA== X-Gm-Message-State: AO0yUKVHXuGAtr/TC+k9aOhnwx1z9FijT2l8PYCejfwRdaOCzzemIINW sgbtXvJuAhv22TbaI0YP87FcvdQarM4JbuNmg8e5yQ== X-Google-Smtp-Source: AK7set+/tVg8TIACUu0SmrRv7SlsNDpnVgUqHeCuSabLXXEemCEA1bJZGCNmaZGz7sZTDo/5xDUrE0VkxEMSk8jeFUQ= X-Received: by 2002:a50:d60d:0:b0:4bc:edde:14ff with SMTP id x13-20020a50d60d000000b004bcedde14ffmr8576451edi.0.1678232969492; Tue, 07 Mar 2023 15:49:29 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303072311.327NBUfu043070@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 7 Mar 2023 16:49:18 -0700 Message-ID: Subject: Re: git: 320e7e0003db - main - Revert "Fix cross-build support for Ubuntu 16.04" To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000ff521605f6580f97" X-Rspamd-Queue-Id: 4PWXGy6mQpz4Dw3 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000ff521605f6580f97 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 7, 2023 at 4:13=E2=80=AFPM Jessica Clarke = wrote: > On 7 Mar 2023, at 23:11, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D320e7e0003dbc14ed3fc01b95532924= cd3fbda7b > > > > commit 320e7e0003dbc14ed3fc01b95532924cd3fbda7b > > Author: Jose Luis Duran > > AuthorDate: 2023-03-02 15:31:31 +0000 > > Commit: Warner Losh > > CommitDate: 2023-03-07 23:11:11 +0000 > > > > Revert "Fix cross-build support for Ubuntu 16.04" > > > > This reverts commit d6327ae8c11b73765f100981baca49166b558b70. > > > > Before version 2.25, glibc's unistd.h would define the POSIX subset = of > > getopt.h by defining __need_getopt, including getopt.h (which would > > disable the header guard) and then undefining it so later including > > getopt.h explicitly would define the extensions. However, we wrap > > getopt, and so the wrapper's #pragma once breaks that. Thus getopt.h > was > > included before the real unistd.h to ensure we get all the extension= s. > > > > However, with clang 12 that causes problems where we get a function > > mismatch (since getopt can throw exceptions). If we include it after > > unistd.h, it will get the full definitions since glibc no longer doe= s > > the subsetting thing. This will result in matching definitions and f= ix > > clang 12. > > This is the bit I still don=E2=80=99t understand and hoped the author wou= ld > explain=E2=80=A6 > I'll look into it a bit more. Warner > Jess > > > Reviewed by: imp, jrtc27 (OK'd on irc) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/668 > > --- > > tools/build/cross-build/include/linux/unistd.h | 10 +--------- > > 1 file changed, 1 insertion(+), 9 deletions(-) > > > > diff --git a/tools/build/cross-build/include/linux/unistd.h > b/tools/build/cross-build/include/linux/unistd.h > > index f518df2ac9ae..cd0b28ba39ed 100644 > > --- a/tools/build/cross-build/include/linux/unistd.h > > +++ b/tools/build/cross-build/include/linux/unistd.h > > @@ -41,17 +41,9 @@ > > /* Ensure that unistd.h pulls in getopt */ > > #define __USE_POSIX2 > > #endif > > -/* > > - * Before version 2.25, glibc's unistd.h would define the POSIX subset > of > > - * getopt.h by defining __need_getopt, including getopt.h (which woul= d > > - * disable the header guard) and then undefining it so later including > > - * getopt.h explicitly would define the extensions. However, we wrap > getopt, > > - * and so the wrapper's #pragma once breaks that. Thus getopt.h must b= e > > - * included before the real unistd.h to ensure we get all the > extensions. > > - */ > > -#include > > #include_next > > #include > > +#include > > #include > > #include > > #include > > --000000000000ff521605f6580f97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Mar 7, 2023 at 4:13=E2=80=AFP= M Jessica Clarke <jrtc27@freebsd.o= rg> wrote:
https://= cgit.FreeBSD.org/src/commit/?id=3D320e7e0003dbc14ed3fc01b95532924cd3fbda7b<= /a>
>
> commit 320e7e0003dbc14ed3fc01b95532924cd3fbda7b
> Author:=C2=A0 =C2=A0 =C2=A0Jose Luis Duran <jlduran@gmail.com>
> AuthorDate: 2023-03-02 15:31:31 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-03-07 23:11:11 +0000
>
>=C2=A0 =C2=A0 Revert "Fix cross-build support for Ubuntu 16.04&quo= t;
>
>=C2=A0 =C2=A0 This reverts commit d6327ae8c11b73765f100981baca49166b558= b70.
>
>=C2=A0 =C2=A0 Before version 2.25, glibc's unistd.h would define th= e POSIX subset of
>=C2=A0 =C2=A0 getopt.h by defining __need_getopt, including getopt.h (w= hich would
>=C2=A0 =C2=A0 disable the header guard) and then undefining it so later= including
>=C2=A0 =C2=A0 getopt.h explicitly would define the extensions. However,= we wrap
>=C2=A0 =C2=A0 getopt, and so the wrapper's #pragma once breaks that= . Thus getopt.h was
>=C2=A0 =C2=A0 included before the real unistd.h to ensure we get all th= e extensions.
>
>=C2=A0 =C2=A0 However, with clang 12 that causes problems where we get = a function
>=C2=A0 =C2=A0 mismatch (since getopt can throw exceptions). If we inclu= de it after
>=C2=A0 =C2=A0 unistd.h, it will get the full definitions since glibc no= longer does
>=C2=A0 =C2=A0 the subsetting thing. This will result in matching defini= tions and fix
>=C2=A0 =C2=A0 clang 12.

This is the bit I still don=E2=80=99t understand and hoped the author would= explain=E2=80=A6

I'll look into it= a bit more.

Warner
=C2=A0
Jess

>=C2=A0 =C2=A0 Reviewed by: imp, jrtc27 (OK'd on irc)
>=C2=A0 =C2=A0 Pull Request: https://github.com/fr= eebsd/freebsd-src/pull/668
> ---
> tools/build/cross-build/include/linux/unistd.h | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/tools/build/cross-build/include/linux/unistd.h b/tools/bu= ild/cross-build/include/linux/unistd.h
> index f518df2ac9ae..cd0b28ba39ed 100644
> --- a/tools/build/cross-build/include/linux/unistd.h
> +++ b/tools/build/cross-build/include/linux/unistd.h
> @@ -41,17 +41,9 @@
> /* Ensure that unistd.h pulls in getopt */
> #define __USE_POSIX2
> #endif
> -/*
> - * Before version 2.25, glibc's unistd.h would define the POSIX s= ubset of
> - * getopt.h by defining __need_getopt,=C2=A0 including getopt.h (whic= h would
> - * disable the header guard) and then undefining it so later includin= g
> - * getopt.h explicitly would define the extensions. However, we wrap = getopt,
> - * and so the wrapper's #pragma once breaks that. Thus getopt.h m= ust be
> - * included before the real unistd.h to ensure we get all the extensi= ons.
> - */
> -#include <getopt.h>
> #include_next <unistd.h>
> #include <fcntl.h>
> +#include <getopt.h>
> #include <stdlib.h>
> #include <string.h>
> #include <sys/syscall.h>

--000000000000ff521605f6580f97--