From owner-dev-commits-src-all@freebsd.org Wed Feb 10 16:42:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E2E454C000; Wed, 10 Feb 2021 16:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbQXB2lLmz4jM4; Wed, 10 Feb 2021 16:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 474E420C70; Wed, 10 Feb 2021 16:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AGg2lQ037464; Wed, 10 Feb 2021 16:42:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AGg2JN037463; Wed, 10 Feb 2021 16:42:02 GMT (envelope-from git) Date: Wed, 10 Feb 2021 16:42:02 GMT Message-Id: <202102101642.11AGg2JN037463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 01d07b03ef2b - main - localedef: Fix bootstrapping on Ubuntu 16.04 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01d07b03ef2b59e70a25cfc4d9e438a7331c5926 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 16:42:02 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=01d07b03ef2b59e70a25cfc4d9e438a7331c5926 commit 01d07b03ef2b59e70a25cfc4d9e438a7331c5926 Author: Jessica Clarke AuthorDate: 2021-02-10 16:41:35 +0000 Commit: Jessica Clarke CommitDate: 2021-02-10 16:41:35 +0000 localedef: Fix bootstrapping on Ubuntu 16.04 Glibc's stdlib.h defines various prototypes for GNU extensions that take a locale_t. Newer versions use locale_t directly and include an internal bits/types/locale_t.h in order to get its definition, but older versions include xlocale.h for that, for which our bootstrap version is empty. Moreover it expects to use the glibc-specific __locale_t type. Thus, provide dummy definitions of both types in order to ensure the prototypes don't give any errors, and guard against the header being inadvertently included between the bootstrapping namespace.h and un-namespace.h, where locale_t is #define'd. This header is not used when bootstrapping on FreeBSD and exists solely to stub out glibc's, so this should have no impact on FreeBSD hosts. Reviewed by: arichardson, emaste (comment only) Differential Revision: https://reviews.freebsd.org/D28317 --- usr.bin/localedef/bootstrap/xlocale.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/usr.bin/localedef/bootstrap/xlocale.h b/usr.bin/localedef/bootstrap/xlocale.h index 67d1cc4116c6..05629a32f4e3 100644 --- a/usr.bin/localedef/bootstrap/xlocale.h +++ b/usr.bin/localedef/bootstrap/xlocale.h @@ -35,8 +35,21 @@ * * $FreeBSD$ */ + +#pragma once + /* - * This header only exists to avoid pulling in the host xlocale.h from - * the libc-internal headers. This is required since newer Linux GLibc no - * longer includes xlocale.h and older versions include an incompatible header. + * This header only exists to avoid pulling in the host xlocale.h from the + * libc-internal headers. New versions of glibc include bits/types/locale.h + * from stdlib.h and so get their own locale_t (and don't provide xlocale.h), + * but older versions include xlocale.h and expect to have a __locale_t. Thus + * we provide dummy definitions of both so the (unused) prototypes don't give + * errors. */ + +#ifdef locale_t +#error "Dummy xlocale.h included inside bootstrapping namespace context" +#endif + +typedef struct __dummy_host_locale *__locale_t; +typedef __locale_t locale_t;