From nobody Mon Jul 18 00:32:43 2022 X-Original-To: dev-commits-src-branches@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 4LmNGN11QSz4WbC5; Mon, 18 Jul 2022 00:32:44 +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 4LmNGM6NPMz3k3b; Mon, 18 Jul 2022 00:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658104363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4xheZIjpQgJmEe9JGCOld2JE152uIC1/xJCVVpocaWM=; b=koPdn/nJEly+NVFgBd5ccyzvK3kwqF1CPKm+dVUpxkFbKLHh32M6K3gcz4M8N6KesRdJrh v/5Y6vDyfeqvOd2jRP9eznhjezgoXNfzdZAFN6aHhMvpwxrzsTOd2xDqX6wD3dEg3gfgKg Dy69FjUJ/qj6zs6dzG0pTs7g+IWwV+hKTRyVnkBGZx0tc+H2NgDmJN5f6z1pjTbsF2UFAF RIm0RGEJIXKHjje5rOFyVkVrFJHh53U32uR4WsJ625iJprHuJ5KCDzQ6CvSOy8aR0SY4HD jRy5KchmuhglhnVbSlDabKGb5G1wVLUZXPyncLG6zhCvFLBwzP3p+ekelH3aVQ== 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 4LmNGM5V30zKcg; Mon, 18 Jul 2022 00:32:43 +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 26I0Wh1G086311; Mon, 18 Jul 2022 00:32:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26I0WhOC086310; Mon, 18 Jul 2022 00:32:43 GMT (envelope-from git) Date: Mon, 18 Jul 2022 00:32:43 GMT Message-Id: <202207180032.26I0WhOC086310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 96e3ac4c09c2 - stable/13 - libmagic: Remove support for older FreeBSD where xlocale was not available. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 96e3ac4c09c27d58fa8a879106e8296ad338ab8c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658104363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4xheZIjpQgJmEe9JGCOld2JE152uIC1/xJCVVpocaWM=; b=e1ViV/DHsbyp2syGeVupKijK7hv2y1FKyZqBdnekN25m0KOhmX9Uc6nyWbFTdb8QbqY/Bk FUy9u5UsUO9WxdX2UTdt1HcqwB2IYrvZgOeiVK1wHYTSj5XZ3CTsiAJCoTr0J3K3VIP/WM 9jrgpSjg9cMPDAPEZi1BL1zCasdK5CdNigZtYgfSb1Bkg4JWwJmfpS+tUFdW6ZAbQfLPK+ QROr5aVQFJi/aPvWH11/90IbztFt6aCkUTSorksSWzUpf8hA5OiTvUF+U7uSl3mGPYWUv6 wsL/3So+oC457aJ+m8GLCrZamYD/7beVBcXKHBINvtpNl4M/o1rcLzGOJPGvow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658104363; a=rsa-sha256; cv=none; b=GPg/kX3skivSJYwLg3ongjLmyF/4C6yM4/PXPunCDJpnmCoYPgeJ0ds622tp5gGMjcpy81 DmmN3jPftOw/WEStp+2LtVogcxXLcfPwK47n3L3JXpzlldUVX/aXQbnEK//I/Ko1Txh6rN jLu+G9rstsEY9VAF+IcDdSnrHz8Hm2fMe0Q1vv38VsCFJRrEYEh3djKylJYo2Z7Msw7ecZ /UWPpm8ueJItJLVvop41YKntrmqRL5Y+oiDTp8YM+OV7FD74oAYZ0SqzevOTKyKP/yJEHb w9nwSzeTCzwmfAdfAQdsAwmxG7vMUyPrC0BSJKlOkWhYNygtNdaPpJMsR9dhfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=96e3ac4c09c27d58fa8a879106e8296ad338ab8c commit 96e3ac4c09c27d58fa8a879106e8296ad338ab8c Author: Xin LI AuthorDate: 2022-01-03 02:05:08 +0000 Commit: Xin LI CommitDate: 2022-07-18 00:31:09 +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. (cherry picked from commit 90266521018938b7b9f0003ba9a383b6920859e9) file: Turns out we need xlocal.h protection It turns out that we still need xlocal.h protection for when we're cross building on Linux. Linux doesn't have this file, but os/x does. Before, we'd assume we didn't have it, like old FreeBSD, when cross compiling. After the latest update, all that code was removed so cross compiling needs to be handled separaetly. Do so by defining HAVE_XLOCALE_H only when we're not building on linux. This allows us to build the mkmagic build tool needed to build file(1). Sponsored by: Netflix Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D33741 (cherry picked from commit f3d7ace4b235422e5ccff0315f2965ac935241d8) --- lib/libmagic/config.h | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index 8c2f2619f01d..f19fc581f6f5 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 `pipe2' function. */ #ifndef __APPLE__ /* Cross building tools on macOS */ @@ -215,9 +216,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 @@ -257,7 +256,7 @@ #define HAVE_WORKING_VFORK 1 /* Define to 1 if you have the header file. */ -#ifdef FREEBSD_XLOCALE_SUPPORT +#ifndef __linux__ /* Cross building tools build with glibc on linux */ #define HAVE_XLOCALE_H 1 #endif @@ -339,6 +338,9 @@ # endif #endif +/* Enable xzlib compression support */ +/* #undef XZLIBSUPPORT */ + /* Enable zlib compression support */ #define ZLIBSUPPORT 1