aboutsummaryrefslogtreecommitdiff
path: root/contrib/expat/README.md
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2025-04-09 03:58:23 +0000
committerPhilip Paeps <philip@FreeBSD.org>2025-04-10 14:39:15 +0000
commite3fd2734314db25be464e0199e20b33fe6281972 (patch)
treee3dcead3e272bbaab8c835ba9452a4d6dc362cd6 /contrib/expat/README.md
parentf8c2bedb03a2f5aa7a3b9a020050ac17e1917473 (diff)
contrib/expat: update libexpat from 2.6.0 to 2.7.1
Changes: https://github.com/libexpat/libexpat/blob/R_2_7_1/expat/Changes Note that libbsdxml(3) is only intended to used by utilities in the FreeBSD base system. None of the vulnerabilities addressed by expat releases 2.6.1 - 2.7.1 is exploitable on FreeBSD as supported by the security-officer@ team. Approved by: so Security: FreeBSD-EN-25:05.expat Security: CVE-2024-8176 Security: CVE-2024-50602 Security: CVE-2024-45490, CVE-2024-45491, CVE-2024-45492 Security: CVE-2024-28757 (cherry picked from commit ffd294a1f4c23863c3e515d16dce31d5509bcb01) (cherry picked from commit bab279022ba2bed4f216924b3b5fdfc60ced364c) (cherry picked from commit ba23ab2168ffabc2c5e647a1a37ab9a8fb482bb8) (cherry picked from commit eab7ed2ec2af6307842abcc94c11743a1058bd11) (cherry picked from commit 908f215e80fa482aa953c39afa6bb516f561fc00) (cherry picked from commit 3d46113d21963d4236506f7c8e9c476b1f4aa512) (cherry picked from commit fe9278888fd4414abe2d922e469cf608005f4c65) (cherry picked from commit 41b768ae1970ed484abaaea401453c3902df93c2) (cherry picked from commit 03a1992591b0ae85b6b250255fe56e17f6d919c6) (cherry picked from commit adc9e9e8dbddcf7d57bcdef0d9d0a0e7c08c15ba) (cherry picked from commit 00c8538e87c61f1fd57ccd9e02a6d435b68d9a73) (cherry picked from commit 5630672e6f6d58597a3d6f01928a7703f1cdd207)
Diffstat (limited to 'contrib/expat/README.md')
-rw-r--r--contrib/expat/README.md75
1 files changed, 58 insertions, 17 deletions
diff --git a/contrib/expat/README.md b/contrib/expat/README.md
index 43c4f4f3dbb3..77c6bf27d307 100644
--- a/contrib/expat/README.md
+++ b/contrib/expat/README.md
@@ -3,9 +3,16 @@
[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/)
[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases)
+[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10205/badge)](https://www.bestpractices.dev/projects/10205)
+> [!CAUTION]
+>
+> Expat is **understaffed** and without funding.
+> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes)
+> at the top of the `Changes` file.
-# Expat, Release 2.6.0
+
+# Expat, Release 2.7.1
This is Expat, a C99 library for parsing
[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by
@@ -16,11 +23,11 @@ are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of
structures for which you may register handlers.
-Expat supports the following compilers:
+Expat supports the following C99 compilers:
-- GNU GCC >=4.5
+- GNU GCC >=4.5 (for use from C) or GNU GCC >=4.8.1 (for use from C++)
- LLVM Clang >=3.5
-- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`)
+- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`)
Windows users can use the
[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases),
@@ -37,16 +44,16 @@ This license is the same as the MIT/X Consortium license.
## Using libexpat in your CMake-Based Project
-There are two ways of using libexpat with CMake:
+There are three documented ways of using libexpat with CMake:
-### a) Module Mode
+### a) `find_package` with Module Mode
This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html).
Notice the *uppercase* `EXPAT` in the following example:
```cmake
-cmake_minimum_required(VERSION 3.0) # or 3.10, see below
+cmake_minimum_required(VERSION 3.10)
project(hello VERSION 1.0.0)
@@ -56,15 +63,10 @@ add_executable(hello
hello.c
)
-# a) for CMake >=3.10 (see CMake's FindEXPAT docs)
target_link_libraries(hello PUBLIC EXPAT::EXPAT)
-
-# b) for CMake >=3.0
-target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS})
-target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES})
```
-### b) Config Mode
+### b) `find_package` with Config Mode
This approach requires files from…
@@ -79,7 +81,7 @@ or
Notice the *lowercase* `expat` in the following example:
```cmake
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.10)
project(hello VERSION 1.0.0)
@@ -92,6 +94,45 @@ add_executable(hello
target_link_libraries(hello PUBLIC expat::expat)
```
+### c) The `FetchContent` module
+
+This approach — as demonstrated below — requires CMake >=3.18 for both the
+[`FetchContent` module](https://cmake.org/cmake/help/latest/module/FetchContent.html)
+and its support for the `SOURCE_SUBDIR` option to be available.
+
+Please note that:
+- Use of the `FetchContent` module with *non-release* SHA1s or `master`
+ of libexpat is neither advised nor considered officially supported.
+- Pinning to a specific commit is great for robust CI.
+- Pinning to a specific commit needs updating every time there is a new
+ release of libexpat — either manually or through automation —,
+ to not miss out on libexpat security updates.
+
+For an example that pulls in libexpat via Git:
+
+```cmake
+cmake_minimum_required(VERSION 3.18)
+
+include(FetchContent)
+
+project(hello VERSION 1.0.0)
+
+FetchContent_Declare(
+ expat
+ GIT_REPOSITORY https://github.com/libexpat/libexpat/
+ GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z
+ SOURCE_SUBDIR expat/
+)
+
+FetchContent_MakeAvailable(expat)
+
+add_executable(hello
+ hello.c
+)
+
+target_link_libraries(hello PUBLIC expat)
+```
+
## Building from a Git Clone
@@ -158,10 +199,10 @@ support this mode of compilation (yet):
1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
<br/>
- `find -name Makefile.am -exec sed
+ `find . -name Makefile.am -exec sed
-e 's,libexpat\.la,libexpatw.la,'
-e 's,libexpat_la,libexpatw_la,'
- -i {} +`
+ -i.bak {} +`
1. Run `automake` to re-write `Makefile.in` files:<br/>
`automake`
@@ -250,7 +291,7 @@ EXPAT_ENABLE_INSTALL:BOOL=ON
// Use /MT flag (static CRT) when compiling in MSVC
EXPAT_MSVC_STATIC_CRT:BOOL=OFF
-// Build fuzzers via ossfuzz for the expat library
+// Build fuzzers via OSS-Fuzz for the expat library
EXPAT_OSSFUZZ_BUILD:BOOL=OFF
// Build a shared expat library