From nobody Tue Jan 04 18:21:46 2022 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 6F4A4192A6A4; Tue, 4 Jan 2022 18:21:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JT1Cy14bMz3Gs4; Tue, 4 Jan 2022 18:21:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from odin.corp.delphij.net (c-141-193-140-252.rev.sailinternet.net [141.193.140.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 43F2C2CC5A; Tue, 4 Jan 2022 18:21:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Message-ID: <77ae0cc3-ed4e-5233-f7ae-ea4fe3de1606@FreeBSD.org> Date: Tue, 4 Jan 2022 10:21:46 -0800 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 User-Agent: Thunderbird Subject: Re: git: 902665210189 - main - libmagic: Remove support for older FreeBSD where xlocale was not available. Content-Language: en-US To: Warner Losh , Jessica Clarke Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202201030209.20329qRc018384@gitrepo.freebsd.org> From: Xin Li Organization: The FreeBSD Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641320510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Di6/KQCq+czm6jMoEoUE3MaFwpoP5clInakly4y8MO0=; b=jJtECPjyxE7GOh+e1M1zq/SVyFmngOAj5jCF3/CX4B4fxMaOZNNkFRsMNb70hx1WI1Mlsj kwE6Ez8+0zbHRGxM0ni2tX3kj/VD7MSWyCx+9/SYl35exj5HkpqilToIeDGF+SSmVeMQkE SBgefrwge3IulT1Tw9PnsgNaZ97BuRxKWEgd7ui2aMaFHOpqc7+0UPryj/TOjsoC/UA4vW 9yxaWvWFxKD7engJqs4YyczMojCfk+GBa6p5S2/8wYZKR525lExinKf+bxqehW7Cjp9vDQ CqTiswZeiBwuVQYS06Gu/+DRg1dbeiAB49bEzVDBCwPmI5KnynAy0Iosc2kckw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641320510; a=rsa-sha256; cv=none; b=WPRhSEJ3HCb2FqB+mn0XqKSOXVQIATmJ4OpuKr+9Ckpy10wAC7oWPfF2cUPKcnvk+rjCoN JoEhXsZsMYxTA5fhWR9x2PFJAFZPjxx+A0NaEyBLXjIZUTQOlW5XslNlfBgt7TgfvBfAvn HFEHcb8K50L6J3eUi6hWwlKzldcoRwIzKWAyMCZbYmdlgSQevbyoMCNJ59I3a7vMsE9pJs XtqtMb6HBwTYgJLTt/Mp9db5hD9E1f4IJwxihxMaBnqNbBcCLuTgT6kSxyIjkDPxckGnSF oifVAK6yUI5lkbhUx0xaz6bFcOyoBRpkDg58SP78ytVzMr1fQkUWRWFLnyKppg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 1/4/22 09:18, Warner Losh wrote: > This breaks the cross building on linux.  The FREEBSD_XLOCALE_SUPPORT > was covering both the case of old FreeBSD as well as the case of > building on Linux/macOS. when we cross build, we define > __FreeBSD_version to be 0. > > All that really needs protecting is the xlocale.h include though. And > that's only needed on Linux / glibc, so the following patch should do > the trick: > >  /* Define to 1 if you have the header file. */ > +#ifndef linux /* Cross building tools build with glibc on linux */ >  #define HAVE_XLOCALE_H 1 > +#endif > > Any objections to committing that? Or should I create a phab review to > discuss? Ah I didn't know that. Yes that looks reasonable (I assume you would also restore the #ifdef's for HAVE_XLOCAL_H). Cheers, > Warner > > > On Sun, Jan 2, 2022 at 7:09 PM Xin LI > wrote: > > The branch main has been updated by delphij: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=90266521018938b7b9f0003ba9a383b6920859e9 > > > commit 90266521018938b7b9f0003ba9a383b6920859e9 > Author:     Xin LI > AuthorDate: 2022-01-03 02:05:08 +0000 > Commit:     Xin LI > CommitDate: 2022-01-03 02:05:08 +0000 > >     libmagic: Remove support for older FreeBSD where xlocale was > not available. > >     The MINIMUM_SUPPORTED_OSREL is 1002501 (FreeBSD 10.3), and > xlocale is >     supported there. > >     While I'm there, explicitly use config.h generated with > --disable-bzlib >     --disable-xzlib instead of deleting them manually. > >     MFC after:      2 weeks > --- >  lib/libmagic/config.h | 36 ++++++++++++++++++------------------ >  1 file changed, 18 insertions(+), 18 deletions(-) > > diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h > index 263fdfb571cd..90a9a115420c 100644 > --- a/lib/libmagic/config.h > +++ b/lib/libmagic/config.h > @@ -1,13 +1,3 @@ > -/* $FreeBSD$ */ > - > -/* Get __FreeBSD_version. */ > -#include > - > -/* Only specific versions of FreeBSD support xlocale */ > -#if __FreeBSD_version >= 1000002 || (__FreeBSD_version < 1000000 && > __FreeBSD_version >= 900506) > -#define FREEBSD_XLOCALE_SUPPORT 1 > -#endif > - >  /* config.h.  Generated from config.h.in by > configure.  */ >  /* config.h.in .  Generated from configure.ac > by autoheader.  */ > > @@ -17,6 +7,9 @@ >  /* Define in built-in ELF support is used */ >  #define BUILTIN_ELF 1 > > +/* Enable bzlib compression support */ > +/* #undef BZLIBSUPPORT */ > + >  /* Define for ELF core file support */ >  #define ELFCORE 1 > > @@ -26,6 +19,9 @@ >  /* Define to 1 if you have the `asprintf' function. */ >  #define HAVE_ASPRINTF 1 > > +/* Define to 1 if you have the header file. */ > +/* #undef HAVE_BZLIB_H */ > + >  /* Define to 1 if you have the `ctime_r' function. */ >  #define HAVE_CTIME_R 1 > > @@ -59,9 +55,7 @@ >  #define HAVE_FORK 1 > >  /* Define to 1 if you have the `freelocale' function. */ > -#ifdef FREEBSD_XLOCALE_SUPPORT >  #define HAVE_FREELOCALE 1 > -#endif > >  /* Define to 1 if fseeko (and presumably ftello) exists and is > declared. */ >  #define HAVE_FSEEKO 1 > @@ -87,9 +81,15 @@ >  /* Define to 1 if you have the header file. */ >  #define HAVE_INTTYPES_H 1 > > +/* Define to 1 if you have the `bz2' library (-lbz2). */ > +/* #undef HAVE_LIBBZ2 */ > + >  /* Define to 1 if you have the `gnurx' library (-lgnurx). */ >  /* #undef HAVE_LIBGNURX */ > > +/* Define to 1 if you have the `lzma' library (-llzma). */ > +/* #undef HAVE_LIBLZMA */ > + >  /* Define to 1 if you have the `seccomp' library (-lseccomp). */ >  /* #undef HAVE_LIBSECCOMP */ > > @@ -99,6 +99,9 @@ >  /* Define to 1 if you have the `localtime_r' function. */ >  #define HAVE_LOCALTIME_R 1 > > +/* Define to 1 if you have the header file. */ > +/* #undef HAVE_LZMA_H */ > + >  /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ >  #define HAVE_MBRTOWC 1 > > @@ -121,9 +124,7 @@ >  #define HAVE_MMAP 1 > >  /* Define to 1 if you have the `newlocale' function. */ > -#ifdef FREEBSD_XLOCALE_SUPPORT >  #define HAVE_NEWLOCALE 1 > -#endif > >  /* Define to 1 if you have the `pread' function. */ >  #define HAVE_PREAD 1 > @@ -210,9 +211,7 @@ >  #define HAVE_UNISTD_H 1 > >  /* Define to 1 if you have the `uselocale' function. */ > -#ifdef FREEBSD_XLOCALE_SUPPORT >  #define HAVE_USELOCALE 1 > -#endif > >  /* Define to 1 if you have the `utime' function. */ >  #define HAVE_UTIME 1 > @@ -252,9 +251,7 @@ >  #define HAVE_WORKING_VFORK 1 > >  /* Define to 1 if you have the header file. */ > -#ifdef FREEBSD_XLOCALE_SUPPORT >  #define HAVE_XLOCALE_H 1 > -#endif > >  /* Define to 1 if you have the header file. */ >  #define HAVE_ZLIB_H 1 > @@ -334,6 +331,9 @@ >  # endif >  #endif > > +/* Enable xzlib compression support */ > +/* #undef XZLIBSUPPORT */ > + >  /* Enable zlib compression support */ >  #define ZLIBSUPPORT 1 >