pcre2build.3 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. .TH PCRE2BUILD 3 "20 March 2020" "PCRE2 10.35"
  2. .SH NAME
  3. PCRE2 - Perl-compatible regular expressions (revised API)
  4. .
  5. .
  6. .SH "BUILDING PCRE2"
  7. .rs
  8. .sp
  9. PCRE2 is distributed with a \fBconfigure\fP script that can be used to build
  10. the library in Unix-like environments using the applications known as
  11. Autotools. Also in the distribution are files to support building using
  12. \fBCMake\fP instead of \fBconfigure\fP. The text file
  13. .\" HTML <a href="README.txt">
  14. .\" </a>
  15. \fBREADME\fP
  16. .\"
  17. contains general information about building with Autotools (some of which is
  18. repeated below), and also has some comments about building on various operating
  19. systems. There is a lot more information about building PCRE2 without using
  20. Autotools (including information about using \fBCMake\fP and building "by
  21. hand") in the text file called
  22. .\" HTML <a href="NON-AUTOTOOLS-BUILD.txt">
  23. .\" </a>
  24. \fBNON-AUTOTOOLS-BUILD\fP.
  25. .\"
  26. You should consult this file as well as the
  27. .\" HTML <a href="README.txt">
  28. .\" </a>
  29. \fBREADME\fP
  30. .\"
  31. file if you are building in a non-Unix-like environment.
  32. .
  33. .
  34. .SH "PCRE2 BUILD-TIME OPTIONS"
  35. .rs
  36. .sp
  37. The rest of this document describes the optional features of PCRE2 that can be
  38. selected when the library is compiled. It assumes use of the \fBconfigure\fP
  39. script, where the optional features are selected or deselected by providing
  40. options to \fBconfigure\fP before running the \fBmake\fP command. However, the
  41. same options can be selected in both Unix-like and non-Unix-like environments
  42. if you are using \fBCMake\fP instead of \fBconfigure\fP to build PCRE2.
  43. .P
  44. If you are not using Autotools or \fBCMake\fP, option selection can be done by
  45. editing the \fBconfig.h\fP file, or by passing parameter settings to the
  46. compiler, as described in
  47. .\" HTML <a href="NON-AUTOTOOLS-BUILD.txt">
  48. .\" </a>
  49. \fBNON-AUTOTOOLS-BUILD\fP.
  50. .\"
  51. .P
  52. The complete list of options for \fBconfigure\fP (which includes the standard
  53. ones such as the selection of the installation directory) can be obtained by
  54. running
  55. .sp
  56. ./configure --help
  57. .sp
  58. The following sections include descriptions of "on/off" options whose names
  59. begin with --enable or --disable. Because of the way that \fBconfigure\fP
  60. works, --enable and --disable always come in pairs, so the complementary option
  61. always exists as well, but as it specifies the default, it is not described.
  62. Options that specify values have names that start with --with. At the end of a
  63. \fBconfigure\fP run, a summary of the configuration is output.
  64. .
  65. .
  66. .SH "BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES"
  67. .rs
  68. .sp
  69. By default, a library called \fBlibpcre2-8\fP is built, containing functions
  70. that take string arguments contained in arrays of bytes, interpreted either as
  71. single-byte characters, or UTF-8 strings. You can also build two other
  72. libraries, called \fBlibpcre2-16\fP and \fBlibpcre2-32\fP, which process
  73. strings that are contained in arrays of 16-bit and 32-bit code units,
  74. respectively. These can be interpreted either as single-unit characters or
  75. UTF-16/UTF-32 strings. To build these additional libraries, add one or both of
  76. the following to the \fBconfigure\fP command:
  77. .sp
  78. --enable-pcre2-16
  79. --enable-pcre2-32
  80. .sp
  81. If you do not want the 8-bit library, add
  82. .sp
  83. --disable-pcre2-8
  84. .sp
  85. as well. At least one of the three libraries must be built. Note that the POSIX
  86. wrapper is for the 8-bit library only, and that \fBpcre2grep\fP is an 8-bit
  87. program. Neither of these are built if you select only the 16-bit or 32-bit
  88. libraries.
  89. .
  90. .
  91. .SH "BUILDING SHARED AND STATIC LIBRARIES"
  92. .rs
  93. .sp
  94. The Autotools PCRE2 building process uses \fBlibtool\fP to build both shared
  95. and static libraries by default. You can suppress an unwanted library by adding
  96. one of
  97. .sp
  98. --disable-shared
  99. --disable-static
  100. .sp
  101. to the \fBconfigure\fP command.
  102. .
  103. .
  104. .SH "UNICODE AND UTF SUPPORT"
  105. .rs
  106. .sp
  107. By default, PCRE2 is built with support for Unicode and UTF character strings.
  108. To build it without Unicode support, add
  109. .sp
  110. --disable-unicode
  111. .sp
  112. to the \fBconfigure\fP command. This setting applies to all three libraries. It
  113. is not possible to build one library with Unicode support and another without
  114. in the same configuration.
  115. .P
  116. Of itself, Unicode support does not make PCRE2 treat strings as UTF-8, UTF-16
  117. or UTF-32. To do that, applications that use the library can set the PCRE2_UTF
  118. option when they call \fBpcre2_compile()\fP to compile a pattern.
  119. Alternatively, patterns may be started with (*UTF) unless the application has
  120. locked this out by setting PCRE2_NEVER_UTF.
  121. .P
  122. UTF support allows the libraries to process character code points up to
  123. 0x10ffff in the strings that they handle. Unicode support also gives access to
  124. the Unicode properties of characters, using pattern escapes such as \eP, \ep,
  125. and \eX. Only the general category properties such as \fILu\fP and \fINd\fP are
  126. supported. Details are given in the
  127. .\" HREF
  128. \fBpcre2pattern\fP
  129. .\"
  130. documentation.
  131. .P
  132. Pattern escapes such as \ed and \ew do not by default make use of Unicode
  133. properties. The application can request that they do by setting the PCRE2_UCP
  134. option. Unless the application has set PCRE2_NEVER_UCP, a pattern may also
  135. request this by starting with (*UCP).
  136. .
  137. .
  138. .SH "DISABLING THE USE OF \eC"
  139. .rs
  140. .sp
  141. The \eC escape sequence, which matches a single code unit, even in a UTF mode,
  142. can cause unpredictable behaviour because it may leave the current matching
  143. point in the middle of a multi-code-unit character. The application can lock it
  144. out by setting the PCRE2_NEVER_BACKSLASH_C option when calling
  145. \fBpcre2_compile()\fP. There is also a build-time option
  146. .sp
  147. --enable-never-backslash-C
  148. .sp
  149. (note the upper case C) which locks out the use of \eC entirely.
  150. .
  151. .
  152. .SH "JUST-IN-TIME COMPILER SUPPORT"
  153. .rs
  154. .sp
  155. Just-in-time (JIT) compiler support is included in the build by specifying
  156. .sp
  157. --enable-jit
  158. .sp
  159. This support is available only for certain hardware architectures. If this
  160. option is set for an unsupported architecture, a building error occurs.
  161. If in doubt, use
  162. .sp
  163. --enable-jit=auto
  164. .sp
  165. which enables JIT only if the current hardware is supported. You can check
  166. if JIT is enabled in the configuration summary that is output at the end of a
  167. \fBconfigure\fP run. If you are enabling JIT under SELinux you may also want to
  168. add
  169. .sp
  170. --enable-jit-sealloc
  171. .sp
  172. which enables the use of an execmem allocator in JIT that is compatible with
  173. SELinux. This has no effect if JIT is not enabled. See the
  174. .\" HREF
  175. \fBpcre2jit\fP
  176. .\"
  177. documentation for a discussion of JIT usage. When JIT support is enabled,
  178. \fBpcre2grep\fP automatically makes use of it, unless you add
  179. .sp
  180. --disable-pcre2grep-jit
  181. .sp
  182. to the \fBconfigure\fP command.
  183. .
  184. .
  185. .SH "NEWLINE RECOGNITION"
  186. .rs
  187. .sp
  188. By default, PCRE2 interprets the linefeed (LF) character as indicating the end
  189. of a line. This is the normal newline character on Unix-like systems. You can
  190. compile PCRE2 to use carriage return (CR) instead, by adding
  191. .sp
  192. --enable-newline-is-cr
  193. .sp
  194. to the \fBconfigure\fP command. There is also an --enable-newline-is-lf option,
  195. which explicitly specifies linefeed as the newline character.
  196. .P
  197. Alternatively, you can specify that line endings are to be indicated by the
  198. two-character sequence CRLF (CR immediately followed by LF). If you want this,
  199. add
  200. .sp
  201. --enable-newline-is-crlf
  202. .sp
  203. to the \fBconfigure\fP command. There is a fourth option, specified by
  204. .sp
  205. --enable-newline-is-anycrlf
  206. .sp
  207. which causes PCRE2 to recognize any of the three sequences CR, LF, or CRLF as
  208. indicating a line ending. A fifth option, specified by
  209. .sp
  210. --enable-newline-is-any
  211. .sp
  212. causes PCRE2 to recognize any Unicode newline sequence. The Unicode newline
  213. sequences are the three just mentioned, plus the single characters VT (vertical
  214. tab, U+000B), FF (form feed, U+000C), NEL (next line, U+0085), LS (line
  215. separator, U+2028), and PS (paragraph separator, U+2029). The final option is
  216. .sp
  217. --enable-newline-is-nul
  218. .sp
  219. which causes NUL (binary zero) to be set as the default line-ending character.
  220. .P
  221. Whatever default line ending convention is selected when PCRE2 is built can be
  222. overridden by applications that use the library. At build time it is
  223. recommended to use the standard for your operating system.
  224. .
  225. .
  226. .SH "WHAT \eR MATCHES"
  227. .rs
  228. .sp
  229. By default, the sequence \eR in a pattern matches any Unicode newline sequence,
  230. independently of what has been selected as the line ending sequence. If you
  231. specify
  232. .sp
  233. --enable-bsr-anycrlf
  234. .sp
  235. the default is changed so that \eR matches only CR, LF, or CRLF. Whatever is
  236. selected when PCRE2 is built can be overridden by applications that use the
  237. library.
  238. .
  239. .
  240. .SH "HANDLING VERY LARGE PATTERNS"
  241. .rs
  242. .sp
  243. Within a compiled pattern, offset values are used to point from one part to
  244. another (for example, from an opening parenthesis to an alternation
  245. metacharacter). By default, in the 8-bit and 16-bit libraries, two-byte values
  246. are used for these offsets, leading to a maximum size for a compiled pattern of
  247. around 64 thousand code units. This is sufficient to handle all but the most
  248. gigantic patterns. Nevertheless, some people do want to process truly enormous
  249. patterns, so it is possible to compile PCRE2 to use three-byte or four-byte
  250. offsets by adding a setting such as
  251. .sp
  252. --with-link-size=3
  253. .sp
  254. to the \fBconfigure\fP command. The value given must be 2, 3, or 4. For the
  255. 16-bit library, a value of 3 is rounded up to 4. In these libraries, using
  256. longer offsets slows down the operation of PCRE2 because it has to load
  257. additional data when handling them. For the 32-bit library the value is always
  258. 4 and cannot be overridden; the value of --with-link-size is ignored.
  259. .
  260. .
  261. .SH "LIMITING PCRE2 RESOURCE USAGE"
  262. .rs
  263. .sp
  264. The \fBpcre2_match()\fP function increments a counter each time it goes round
  265. its main loop. Putting a limit on this counter controls the amount of computing
  266. resource used by a single call to \fBpcre2_match()\fP. The limit can be changed
  267. at run time, as described in the
  268. .\" HREF
  269. \fBpcre2api\fP
  270. .\"
  271. documentation. The default is 10 million, but this can be changed by adding a
  272. setting such as
  273. .sp
  274. --with-match-limit=500000
  275. .sp
  276. to the \fBconfigure\fP command. This setting also applies to the
  277. \fBpcre2_dfa_match()\fP matching function, and to JIT matching (though the
  278. counting is done differently).
  279. .P
  280. The \fBpcre2_match()\fP function starts out using a 20KiB vector on the system
  281. stack to record backtracking points. The more nested backtracking points there
  282. are (that is, the deeper the search tree), the more memory is needed. If the
  283. initial vector is not large enough, heap memory is used, up to a certain limit,
  284. which is specified in kibibytes (units of 1024 bytes). The limit can be changed
  285. at run time, as described in the
  286. .\" HREF
  287. \fBpcre2api\fP
  288. .\"
  289. documentation. The default limit (in effect unlimited) is 20 million. You can
  290. change this by a setting such as
  291. .sp
  292. --with-heap-limit=500
  293. .sp
  294. which limits the amount of heap to 500 KiB. This limit applies only to
  295. interpretive matching in \fBpcre2_match()\fP and \fBpcre2_dfa_match()\fP, which
  296. may also use the heap for internal workspace when processing complicated
  297. patterns. This limit does not apply when JIT (which has its own memory
  298. arrangements) is used.
  299. .P
  300. You can also explicitly limit the depth of nested backtracking in the
  301. \fBpcre2_match()\fP interpreter. This limit defaults to the value that is set
  302. for --with-match-limit. You can set a lower default limit by adding, for
  303. example,
  304. .sp
  305. --with-match-limit_depth=10000
  306. .sp
  307. to the \fBconfigure\fP command. This value can be overridden at run time. This
  308. depth limit indirectly limits the amount of heap memory that is used, but
  309. because the size of each backtracking "frame" depends on the number of
  310. capturing parentheses in a pattern, the amount of heap that is used before the
  311. limit is reached varies from pattern to pattern. This limit was more useful in
  312. versions before 10.30, where function recursion was used for backtracking.
  313. .P
  314. As well as applying to \fBpcre2_match()\fP, the depth limit also controls
  315. the depth of recursive function calls in \fBpcre2_dfa_match()\fP. These are
  316. used for lookaround assertions, atomic groups, and recursion within patterns.
  317. The limit does not apply to JIT matching.
  318. .
  319. .
  320. .\" HTML <a name="createtables"></a>
  321. .SH "CREATING CHARACTER TABLES AT BUILD TIME"
  322. .rs
  323. .sp
  324. PCRE2 uses fixed tables for processing characters whose code points are less
  325. than 256. By default, PCRE2 is built with a set of tables that are distributed
  326. in the file \fIsrc/pcre2_chartables.c.dist\fP. These tables are for ASCII codes
  327. only. If you add
  328. .sp
  329. --enable-rebuild-chartables
  330. .sp
  331. to the \fBconfigure\fP command, the distributed tables are no longer used.
  332. Instead, a program called \fBpcre2_dftables\fP is compiled and run. This
  333. outputs the source for new set of tables, created in the default locale of your
  334. C run-time system. This method of replacing the tables does not work if you are
  335. cross compiling, because \fBpcre2_dftables\fP needs to be run on the local
  336. host and therefore not compiled with the cross compiler.
  337. .P
  338. If you need to create alternative tables when cross compiling, you will have to
  339. do so "by hand". There may also be other reasons for creating tables manually.
  340. To cause \fBpcre2_dftables\fP to be built on the local host, run a normal
  341. compiling command, and then run the program with the output file as its
  342. argument, for example:
  343. .sp
  344. cc src/pcre2_dftables.c -o pcre2_dftables
  345. ./pcre2_dftables src/pcre2_chartables.c
  346. .sp
  347. This builds the tables in the default locale of the local host. If you want to
  348. specify a locale, you must use the -L option:
  349. .sp
  350. LC_ALL=fr_FR ./pcre2_dftables -L src/pcre2_chartables.c
  351. .sp
  352. You can also specify -b (with or without -L). This causes the tables to be
  353. written in binary instead of as source code. A set of binary tables can be
  354. loaded into memory by an application and passed to \fBpcre2_compile()\fP in the
  355. same way as tables created by calling \fBpcre2_maketables()\fP. The tables are
  356. just a string of bytes, independent of hardware characteristics such as
  357. endianness. This means they can be bundled with an application that runs in
  358. different environments, to ensure consistent behaviour.
  359. .
  360. .
  361. .SH "USING EBCDIC CODE"
  362. .rs
  363. .sp
  364. PCRE2 assumes by default that it will run in an environment where the character
  365. code is ASCII or Unicode, which is a superset of ASCII. This is the case for
  366. most computer operating systems. PCRE2 can, however, be compiled to run in an
  367. 8-bit EBCDIC environment by adding
  368. .sp
  369. --enable-ebcdic --disable-unicode
  370. .sp
  371. to the \fBconfigure\fP command. This setting implies
  372. --enable-rebuild-chartables. You should only use it if you know that you are in
  373. an EBCDIC environment (for example, an IBM mainframe operating system).
  374. .P
  375. It is not possible to support both EBCDIC and UTF-8 codes in the same version
  376. of the library. Consequently, --enable-unicode and --enable-ebcdic are mutually
  377. exclusive.
  378. .P
  379. The EBCDIC character that corresponds to an ASCII LF is assumed to have the
  380. value 0x15 by default. However, in some EBCDIC environments, 0x25 is used. In
  381. such an environment you should use
  382. .sp
  383. --enable-ebcdic-nl25
  384. .sp
  385. as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR has the
  386. same value as in ASCII, namely, 0x0d. Whichever of 0x15 and 0x25 is \fInot\fP
  387. chosen as LF is made to correspond to the Unicode NEL character (which, in
  388. Unicode, is 0x85).
  389. .P
  390. The options that select newline behaviour, such as --enable-newline-is-cr,
  391. and equivalent run-time options, refer to these character values in an EBCDIC
  392. environment.
  393. .
  394. .
  395. .SH "PCRE2GREP SUPPORT FOR EXTERNAL SCRIPTS"
  396. .rs
  397. .sp
  398. By default \fBpcre2grep\fP supports the use of callouts with string arguments
  399. within the patterns it is matching. There are two kinds: one that generates
  400. output using local code, and another that calls an external program or script.
  401. If --disable-pcre2grep-callout-fork is added to the \fBconfigure\fP command,
  402. only the first kind of callout is supported; if --disable-pcre2grep-callout is
  403. used, all callouts are completely ignored. For more details of \fBpcre2grep\fP
  404. callouts, see the
  405. .\" HREF
  406. \fBpcre2grep\fP
  407. .\"
  408. documentation.
  409. .
  410. .
  411. .SH "PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT"
  412. .rs
  413. .sp
  414. By default, \fBpcre2grep\fP reads all files as plain text. You can build it so
  415. that it recognizes files whose names end in \fB.gz\fP or \fB.bz2\fP, and reads
  416. them with \fBlibz\fP or \fBlibbz2\fP, respectively, by adding one or both of
  417. .sp
  418. --enable-pcre2grep-libz
  419. --enable-pcre2grep-libbz2
  420. .sp
  421. to the \fBconfigure\fP command. These options naturally require that the
  422. relevant libraries are installed on your system. Configuration will fail if
  423. they are not.
  424. .
  425. .
  426. .SH "PCRE2GREP BUFFER SIZE"
  427. .rs
  428. .sp
  429. \fBpcre2grep\fP uses an internal buffer to hold a "window" on the file it is
  430. scanning, in order to be able to output "before" and "after" lines when it
  431. finds a match. The default starting size of the buffer is 20KiB. The buffer
  432. itself is three times this size, but because of the way it is used for holding
  433. "before" lines, the longest line that is guaranteed to be processable is the
  434. notional buffer size. If a longer line is encountered, \fBpcre2grep\fP
  435. automatically expands the buffer, up to a specified maximum size, whose default
  436. is 1MiB or the starting size, whichever is the larger. You can change the
  437. default parameter values by adding, for example,
  438. .sp
  439. --with-pcre2grep-bufsize=51200
  440. --with-pcre2grep-max-bufsize=2097152
  441. .sp
  442. to the \fBconfigure\fP command. The caller of \fBpcre2grep\fP can override
  443. these values by using --buffer-size and --max-buffer-size on the command line.
  444. .
  445. .
  446. .SH "PCRE2TEST OPTION FOR LIBREADLINE SUPPORT"
  447. .rs
  448. .sp
  449. If you add one of
  450. .sp
  451. --enable-pcre2test-libreadline
  452. --enable-pcre2test-libedit
  453. .sp
  454. to the \fBconfigure\fP command, \fBpcre2test\fP is linked with the
  455. \fBlibreadline\fP or\fBlibedit\fP library, respectively, and when its input is
  456. from a terminal, it reads it using the \fBreadline()\fP function. This provides
  457. line-editing and history facilities. Note that \fBlibreadline\fP is
  458. GPL-licensed, so if you distribute a binary of \fBpcre2test\fP linked in this
  459. way, there may be licensing issues. These can be avoided by linking instead
  460. with \fBlibedit\fP, which has a BSD licence.
  461. .P
  462. Setting --enable-pcre2test-libreadline causes the \fB-lreadline\fP option to be
  463. added to the \fBpcre2test\fP build. In many operating environments with a
  464. sytem-installed readline library this is sufficient. However, in some
  465. environments (e.g. if an unmodified distribution version of readline is in
  466. use), some extra configuration may be necessary. The INSTALL file for
  467. \fBlibreadline\fP says this:
  468. .sp
  469. "Readline uses the termcap functions, but does not link with
  470. the termcap or curses library itself, allowing applications
  471. which link with readline the to choose an appropriate library."
  472. .sp
  473. If your environment has not been set up so that an appropriate library is
  474. automatically included, you may need to add something like
  475. .sp
  476. LIBS="-ncurses"
  477. .sp
  478. immediately before the \fBconfigure\fP command.
  479. .
  480. .
  481. .SH "INCLUDING DEBUGGING CODE"
  482. .rs
  483. .sp
  484. If you add
  485. .sp
  486. --enable-debug
  487. .sp
  488. to the \fBconfigure\fP command, additional debugging code is included in the
  489. build. This feature is intended for use by the PCRE2 maintainers.
  490. .
  491. .
  492. .SH "DEBUGGING WITH VALGRIND SUPPORT"
  493. .rs
  494. .sp
  495. If you add
  496. .sp
  497. --enable-valgrind
  498. .sp
  499. to the \fBconfigure\fP command, PCRE2 will use valgrind annotations to mark
  500. certain memory regions as unaddressable. This allows it to detect invalid
  501. memory accesses, and is mostly useful for debugging PCRE2 itself.
  502. .
  503. .
  504. .SH "CODE COVERAGE REPORTING"
  505. .rs
  506. .sp
  507. If your C compiler is gcc, you can build a version of PCRE2 that can generate a
  508. code coverage report for its test suite. To enable this, you must install
  509. \fBlcov\fP version 1.6 or above. Then specify
  510. .sp
  511. --enable-coverage
  512. .sp
  513. to the \fBconfigure\fP command and build PCRE2 in the usual way.
  514. .P
  515. Note that using \fBccache\fP (a caching C compiler) is incompatible with code
  516. coverage reporting. If you have configured \fBccache\fP to run automatically
  517. on your system, you must set the environment variable
  518. .sp
  519. CCACHE_DISABLE=1
  520. .sp
  521. before running \fBmake\fP to build PCRE2, so that \fBccache\fP is not used.
  522. .P
  523. When --enable-coverage is used, the following addition targets are added to the
  524. \fIMakefile\fP:
  525. .sp
  526. make coverage
  527. .sp
  528. This creates a fresh coverage report for the PCRE2 test suite. It is equivalent
  529. to running "make coverage-reset", "make coverage-baseline", "make check", and
  530. then "make coverage-report".
  531. .sp
  532. make coverage-reset
  533. .sp
  534. This zeroes the coverage counters, but does nothing else.
  535. .sp
  536. make coverage-baseline
  537. .sp
  538. This captures baseline coverage information.
  539. .sp
  540. make coverage-report
  541. .sp
  542. This creates the coverage report.
  543. .sp
  544. make coverage-clean-report
  545. .sp
  546. This removes the generated coverage report without cleaning the coverage data
  547. itself.
  548. .sp
  549. make coverage-clean-data
  550. .sp
  551. This removes the captured coverage data without removing the coverage files
  552. created at compile time (*.gcno).
  553. .sp
  554. make coverage-clean
  555. .sp
  556. This cleans all coverage data including the generated coverage report. For more
  557. information about code coverage, see the \fBgcov\fP and \fBlcov\fP
  558. documentation.
  559. .
  560. .
  561. .SH "DISABLING THE Z AND T FORMATTING MODIFIERS"
  562. .rs
  563. .sp
  564. The C99 standard defines formatting modifiers z and t for size_t and
  565. ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in
  566. environments other than Microsoft Visual Studio when __STDC_VERSION__ is
  567. defined and has a value greater than or equal to 199901L (indicating C99).
  568. However, there is at least one environment that claims to be C99 but does not
  569. support these modifiers. If
  570. .sp
  571. --disable-percent-zt
  572. .sp
  573. is specified, no use is made of the z or t modifiers. Instead of %td or %zu,
  574. %lu is used, with a cast for size_t values.
  575. .
  576. .
  577. .SH "SUPPORT FOR FUZZERS"
  578. .rs
  579. .sp
  580. There is a special option for use by people who want to run fuzzing tests on
  581. PCRE2:
  582. .sp
  583. --enable-fuzz-support
  584. .sp
  585. At present this applies only to the 8-bit library. If set, it causes an extra
  586. library called libpcre2-fuzzsupport.a to be built, but not installed. This
  587. contains a single function called LLVMFuzzerTestOneInput() whose arguments are
  588. a pointer to a string and the length of the string. When called, this function
  589. tries to compile the string as a pattern, and if that succeeds, to match it.
  590. This is done both with no options and with some random options bits that are
  591. generated from the string.
  592. .P
  593. Setting --enable-fuzz-support also causes a binary called \fBpcre2fuzzcheck\fP
  594. to be created. This is normally run under valgrind or used when PCRE2 is
  595. compiled with address sanitizing enabled. It calls the fuzzing function and
  596. outputs information about what it is doing. The input strings are specified by
  597. arguments: if an argument starts with "=" the rest of it is a literal input
  598. string. Otherwise, it is assumed to be a file name, and the contents of the
  599. file are the test string.
  600. .
  601. .
  602. .SH "OBSOLETE OPTION"
  603. .rs
  604. .sp
  605. In versions of PCRE2 prior to 10.30, there were two ways of handling
  606. backtracking in the \fBpcre2_match()\fP function. The default was to use the
  607. system stack, but if
  608. .sp
  609. --disable-stack-for-recursion
  610. .sp
  611. was set, memory on the heap was used. From release 10.30 onwards this has
  612. changed (the stack is no longer used) and this option now does nothing except
  613. give a warning.
  614. .
  615. .SH "SEE ALSO"
  616. .rs
  617. .sp
  618. \fBpcre2api\fP(3), \fBpcre2-config\fP(3).
  619. .
  620. .
  621. .SH AUTHOR
  622. .rs
  623. .sp
  624. .nf
  625. Philip Hazel
  626. University Computing Service
  627. Cambridge, England.
  628. .fi
  629. .
  630. .
  631. .SH REVISION
  632. .rs
  633. .sp
  634. .nf
  635. Last updated: 20 March 2020
  636. Copyright (c) 1997-2020 University of Cambridge.
  637. .fi