|
1dc078f0
|
2025-03-05T15:39:26
|
|
libpkgconf: fragment: add padding bytes to length estimation for child fragments
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
|
|
4f78e449
|
2025-03-05T15:36:56
|
|
libpkgconf: fragment: track terminating fragments like -Wl,--end-group
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
|
|
6ec7df4d
|
2025-03-05T15:03:52
|
|
libpkgconf: fragment: plug memory leak when child fragments are present
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
|
|
543ab926
|
2025-03-05T15:00:54
|
|
libpkgconf: fragment: track text fragments as a tree instead of a flat list
This allows us to have more insight into the relationships between
text fragments, for example linker groups.
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
|
|
5fbabf14
|
2025-03-04T14:25:43
|
|
libpkgconf: fragment: add -nodefaultlibs to special flags list
Related: https://github.com/pkgconf/pkgconf/issues/371
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
|
|
174db1a1
|
2024-08-05T14:27:13
|
|
fragment: add pkgconf_fragment_insert()
|
|
d454f62c
|
2023-11-05T22:17:02
|
|
libpkgconf: fix -Walloc-size
GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
libpkgconf/personality.c:260:11: warning: allocation of insufficient size '1' for type 'pkgconf_cross_personality_t' {aka 'struct pkgconf_cross_personality_'} with size '48' [-Walloc-size]
libpkgconf/queue.c:46:33: warning: allocation of insufficient size '1' for type 'pkgconf_queue_t' {aka'struct pkgconf_queue_'} with size '16' [-Walloc-size]
libpkgconf/client.c:164:33: warning: allocation of insufficient size '1' for type 'pkgconf_client_t' {aka 'struct pkgconf_client_'} with size '120' [-Walloc-size]
libpkgconf/path.c:105:14: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '24' [-Walloc-size]
libpkgconf/path.c:237:22: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '24' [-Walloc-size]
libpkgconf/tuple.c:239:34: warning: allocation of insufficient size '1' for type 'pkgconf_tuple_t' {aka 'struct pkgconf_tuple_'} with size '24' [-Walloc-size]
libpkgconf/dependency.c:133:13: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '44' [-Walloc-size]
libpkgconf/dependency.c:472:17: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '44' [-Walloc-size]
libpkgconf/fragment.c:146:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '24' [-Walloc-size]
libpkgconf/fragment.c:195:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '24' [-Walloc-size]
libpkgconf/fragment.c:356:14: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '24' [-Walloc-size]
libpkgconf/pkg.c:422:13: warning: allocation of insufficient size '1' for type 'pkgconf_pkg_t' {aka 'struct pkgconf_pkg_'} with size '188' [-Walloc-size]
libpkgconf/client.c:164:33: warning: allocation of insufficient size '1' for type 'pkgconf_client_t' {aka 'struct pkgconf_client_'} with size '224' [-Walloc-size]
libpkgconf/personality.c:260:11: warning: allocation of insufficient size '1' for type 'pkgconf_cross_personality_t' {aka 'struct pkgconf_cross_personality_'} with size '96' [-Walloc-size]
libpkgconf/dependency.c:133:13: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '80' [-Walloc-size]
libpkgconf/dependency.c:472:17: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '80' [-Walloc-size]
libpkgconf/path.c:105:14: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '48' [-Walloc-size]
libpkgconf/path.c:237:22: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '48' [-Walloc-size]
libpkgconf/queue.c:46:33: warning: allocation of insufficient size '1' for type 'pkgconf_queue_t' {aka 'struct pkgconf_queue_'} with size '32' [-Walloc-size]
libpkgconf/tuple.c:239:34: warning: allocation of insufficient size '1' for type 'pkgconf_tuple_t' {aka 'struct pkgconf_tuple_'} with size '48' [-Walloc-size]
libpkgconf/fragment.c:146:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '48' [-Walloc-size]
libpkgconf/fragment.c:195:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '48' [-Walloc-size]
libpkgconf/fragment.c:356:14: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '48' [-Walloc-size]
libpkgconf/pkg.c:422:13: warning: allocation of insufficient size '1' for type 'pkgconf_pkg_t' {aka 'struct pkgconf_pkg_'} with size '360' [-Walloc-size]
```
The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```
So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not
doing anything wrong.
The only exception there is for argv which I fixed while at it.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
648a2249
|
2023-01-21T20:17:33
|
|
fragment: render: only include trailing space if there is another fragment
|
|
5500a151
|
2022-08-16T18:46:43
|
|
fragment: avoid trying to merge fragments where data == NULL
|
|
6c70781a
|
2022-07-26T18:00:22
|
|
introduce PKG_CONFIG_PKGCONF1_SYSROOT_RULES for legacy pkgconf behavior
|
|
297e18f2
|
2022-07-26T17:08:48
|
|
tuple: add flags parameter to pkgconf_tuple_parse
|
|
100bc605
|
2020-05-30T23:48:40
|
|
libpkgconf: fragment: fix out of boundary write
fragment_quote adds quotation to fragments if needed. It allocates a
buffer and grows it as needed.
Unfortunately the dst pointer is not updated after a realloc, which
means that dst still points into the old memory area. Further writing
characters into that area leads to out of boundy writes.
Proof of concept:
$ cat > poc.pc << EOF
Name: poc
Description: poc
Version: 1
CFlags: -Ia
CFlags: -I%%%%%%%%%%%%%%%%%%%%b
CFlags: -I%%%%%%%%%%%%%%%%%%%%c
CFlags: -Id
EOF
$ pkgconf --cflags poc.pc
Most reliable attempt is to compile pkgconf with address sanitizer,
but this file should lead to an abort on a glibc system due to modified
chunk pointers (tested with Linux on amd64).
But since this is undefined behaviour, it depends on system details.
|
|
dc04193c
|
2020-05-29T19:35:42
|
|
libpkgconf: fragment: fix out of boundary read
Parsing a fragment which consists only of a single dash leads to
an out of boundary read. It duplicates the following entry which
is not expected behaviour if another fragment follows.
Proof of concept:
$ cat > poc.pc << "EOF"
Name: poc
Description: poc
Version: 1
Cflags: - -I/somewhere
EOF
$ PKG_CONFIG_PATH=. pkgconf --cflags poc
-I/somewhere -I/somewhere
If - is the last entry, it leads to an out of boundary read, which is
easy to see if pkgconf is compiled with address sanitizer.
|
|
42b35531
|
2020-05-30T12:39:43
|
|
fix missing backslashes in paths on Windows
According to
https://docs.microsoft.com/fr-fr/windows/win32/fileio/naming-a-file
backslashes (with slashes) are a path separator, hence must no be
considered as an escape code.
The first fix, in argvsplit.c, disables this. But because of fragment_quote(),
the backslashes are doubled. Hence the second fix in fragment.c
With this pc file :
prefix=C:/Documents/msys2/opt/efl_64
libdir=${prefix}/lib
includedir=${prefix}/include
Name: eina
Description: efl: eina
Version: 1.24.99
Requires.private: iconv
Libs: -L${libdir} -leina -pthread -levil
Libs.private: -lpsapi -lole32 -lws2_32 -lsecur32 -luuid -lregex -lm
Cflags:-I${includedir}/eina-1 -I${includedir}/efl-1
-I${includedir}/eina-1/eina -pthread
pkgconf.exe --cflags eina
returns :
-IC:\Documents\msys2\opt\efl_64/include/eina-1
-IC:\Documents\msys2\opt\efl_64/include/efl-1
-IC:\Documents\msys2\opt\efl_64/include/eina-1/eina -pthread
-DWINICONV_CONST= -IC:\Documents\msys2\opt\ewpi_64/include
|
|
4fb7683c
|
2020-05-24T14:40:47
|
|
add support for the PKGCONF_PKG_PKGF_DONT_MERGE_SPECIAL_FRAGMENTS flag used in build2.
|
|
36a5b7ac
|
2019-01-14T13:48:02
|
|
libpkgconf: fragment: add pkgconf_fragment_copy_list()
|
|
d5fd74d7
|
2018-01-22T15:13:14
|
|
libpkgconf: fragment: revert the quoting changes, but not the lexing changes
a few strange edge cases are causing problems (closes #168)
|
|
cf96c562
|
2017-12-14T22:41:14
|
|
libpkgconf: argvsplit: fix escape handling in tokenizer (closes #163)
|
|
18abb4cc
|
2017-12-13T11:18:25
|
|
libpkgconf: fragment: fix nitpick warning reported by MSVC (closes #162)
|
|
278a2bd6
|
2017-12-11T18:25:55
|
|
libpkgconf: fragment: rework quoting and lexing (closes #139, #153)
we now use POSIX-style quoting for all fragments. it is our belief that this is the
most optimal behaviour for portability, because all POSIX-compliant tools require
single-quotes to be considered as literal (closes #153).
because of this, we are able to remove some hacks on the lexer side which were there
to simulate pkg-config quoting, but were basically utterly wrong (closes #139).
|
|
72743575
|
2017-12-10T00:39:39
|
|
libpkgconf: fragment: track merged fragments, as they should never be quoted
|
|
cad2515b
|
2017-12-10T00:36:20
|
|
libpkgconf: fragment: there are no consumers of non-escaped rendered fragment lists, so deprecate the option
|
|
19d91e90
|
2017-12-07T19:13:35
|
|
libpkgconf: fragment: allow for overriding the default fragment rendering behaviour
|
|
4589274c
|
2017-10-16T12:56:19
|
|
libpkgconf: start to remove PKGCONF_BUFSIZE allocations from the stack. (closes #149)
Patch by Karen Arutyunov.
|
|
12973857
|
2017-10-16T12:51:59
|
|
libpkgconf: fragment: remove obsolete code in pkgconf_fragment_should_munge()
|
|
db56c80d
|
2017-09-23T00:11:37
|
|
libpkgconf: fragment: add debug to document post-subst output to parser
|
|
7ced8d77
|
2017-09-19T21:48:53
|
|
libpkgconf: fragment: pkgconf_fragment_parse: return false on parse failure
|
|
7786554b
|
2017-09-19T21:34:24
|
|
libpkgconf: fragment: check pkgconf_argv_split() return value
|
|
56101390
|
2017-09-19T21:08:18
|
|
libpkgconf: fragment parsing: do not pass NULL to pkgconf_fragment_add()
|
|
e9fd43ca
|
2017-09-17T23:38:25
|
|
libpkgconf: clean up header includes (closes #137)
|
|
906fef84
|
2017-09-08T20:09:12
|
|
libpkgconf: fragment: mark some inline match tables as const
|
|
3c7f82a7
|
2017-05-09T19:38:57
|
|
fragment: also protect -nostdinc, -nostdlibinc, -nobuiltininc
|
|
74eb74a3
|
2017-05-09T19:37:23
|
|
fragment: handle -include similarly to -isystem and -idirafter
|
|
9fde4be1
|
2017-05-09T19:34:01
|
|
fragment: also protect -ansi, -std=, -stdlib=, -pedantic, -trigraphs, -Wa, and -Wp fragments
|
|
c7a8e1e3
|
2017-05-09T19:30:02
|
|
fragment: give -Wl fragments the same protection as -pthread
|
|
90d52e6c
|
2017-05-05T01:40:57
|
|
fragment: add -pthread as a special fragment
|
|
6e643aa4
|
2017-03-29T18:00:57
|
|
libpkgconf: hopefully the last necessary tweak to quoting...
|
|
e0c9569f
|
2017-02-25T15:53:50
|
|
fragment: add tracepoints
|
|
01fe5743
|
2017-02-25T15:32:49
|
|
fragment: add new option to control escaping shell arguments
|
|
647c0255
|
2017-02-03T13:17:21
|
|
libpkgconf: add PKGCONF_PKG_PKGF_DONT_RELOCATE_PATHS (#110)
main: add PKG_CONFIG_DONT_RELOCATE_PATHS environment variable and --dont-relocate-paths option to disable path relocation
|
|
13cf74c7
|
2017-01-19T18:23:25
|
|
libpkgconf: kill flags from top-level fragment API (ref #105)
|
|
4f94090f
|
2017-01-18T20:25:19
|
|
libpkgconf: fragment: make pkgconf_fragment_filter() accept userdata (closes #106)
|
|
cb1dc71e
|
2017-01-13T20:10:02
|
|
fragment: simplify pkgconf_fragment_copy_munged()
|
|
27c37105
|
2017-01-13T20:06:48
|
|
fragment: when munging, do a path relocation too
|
|
7f6a1859
|
2017-01-13T19:55:54
|
|
fragment: only munge if sysroot_dir is actually set
on cygwin/msys2, it is possible for munging to be enabled for other types of munging (instead of sysroot)
|
|
4ba414f7
|
2017-01-07T15:04:34
|
|
fragment: handle oddball fragments like -framework more accurately
|
|
0c690dc8
|
2016-12-30T12:39:10
|
|
libpkgconf: fragment: fix over-optimization of cflags/linker flags in edge cases involving non-standard options
|
|
ad1e414d
|
2016-12-30T02:47:42
|
|
libpkgconf: fragment: handle -idirafter in the same way as -isystem
(https://bugs.freedesktop.org/show_bug.cgi?id=97337)
|
|
6ef4a853
|
2016-12-21T20:06:17
|
|
libpkgconf: migrate pkgconf client fragment_is_system_dir() to a libpkgconf API
|
|
c7e505fe
|
2016-12-15T18:32:43
|
|
libpkgconf: fragment: split out per-fragment length calculation and use it for all render functions (buffer overrun hardening)
|
|
63b3989f
|
2016-12-15T18:27:57
|
|
libpkgconf: document fragment module
|
|
8213d910
|
2016-12-10T16:19:40
|
|
libpkgconf: migrate to using the pkgconf_ namespaced strlcat/strlcpy symbols
|
|
0ae2d8e5
|
2016-12-10T15:47:21
|
|
fragment: fix off-by-one error in pkgconf_fragment_render_len()
|
|
d6d7ff77
|
2016-12-09T23:07:15
|
|
main: use pkgconf_fragment_render() to render fragment lists instead of custom stuff
|
|
0232ee52
|
2016-12-09T22:18:59
|
|
libpkgconf: fragment: add pkgconf_fragment_filter() to selectively copy a fragment list using a filter function
|
|
0baecbd1
|
2016-12-09T22:06:42
|
|
libpkgconf: fragment: mark fragment objects const in several internal functions
|
|
a9022030
|
2016-12-09T21:36:59
|
|
libpkgconf: fragment: simplify sysroot handling by using pkgconf_client_t.sysroot_dir presence
|
|
8740c5cd
|
2016-12-01T15:05:03
|
|
libpkgconf: begin removing global state from libpkgconf library by introducing a "client" object which holds the state
|
|
ce165646
|
2016-10-25T13:57:42
|
|
fragment: skip empty tokens (closes #99)
Due to the way that tokens are merged together for arguments which require explicit whitespace, an
empty token could result in a fragment like:
{.type = 'I', .data = '/usr/include '}
Such a fragment would be treated differently than:
{.type = 'I', .data = '/usr/include'}
This difference causes the compiler to include a system include path as part of the additional includes, thus
breaking things like include path shadowing, resulting in random build failures. As such, we skip empty tokens
from the tokenizer as they do not have any relevance anyway.
|
|
b835d74d
|
2016-08-24T18:51:02
|
|
fragment: try to apply munging to all path-only fragments (#94)
|
|
f6c96fc3
|
2016-08-24T18:39:42
|
|
fragment: add pkgconf_fragment_should_munge() to simplify the munging logic a bit (#94)
|
|
f72e1c6d
|
2016-05-19T17:05:04
|
|
fragment: genericize the fragment merge determination and add support for -isystem (closes #87)
|
|
06a45f1b
|
2015-09-06T11:45:00
|
|
libpkgconf: clean up PKG_ERRF and PKGF_ defines
|
|
571d9c75
|
2015-09-06T11:29:56
|
|
libpkgconf: PKG_BUFSIZE becomes PKGCONF_BUFSIZE, remove unused PKG_MIN/PKG_MAX.
|
|
b17f2640
|
2015-09-06T10:48:24
|
|
libpkgconf: move some utility funcs into pkgconf_ namespace
|
|
61d5fc72
|
2015-09-06T10:44:10
|
|
libpkgconf: move pkg_fragment to pkgconf_fragment namespace
|
|
4c71b25d
|
2015-09-06T10:41:40
|
|
libpkgconf: move pkg_tuple to pkgconf_tuple namespace
|
|
cc2dcc1f
|
2015-09-06T10:31:21
|
|
libpkgconf: move pkg_node and pkg_list to pkgconf_node and pkgconf_list namespaces
|
|
a706b3dc
|
2015-09-06T09:35:08
|
|
initial libtoolization for libpkgconf
|