You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rob Herring
abbd523bae
pylibfdt: Work-around SWIG limitations with flexible arrays
Commit a41509bea3 ("libfdt: Replace deprecated 0-length arrays with
proper flexible arrays") fails to build pylibfdt:
./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_node_header_name_set’:
./pylibfdt/libfdt_wrap.c:4350:18: error: cast specifies array type
4350 | arg1->name = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
| ^
./pylibfdt/libfdt_wrap.c:4350:16: error: invalid use of flexible array member
4350 | arg1->name = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
| ^
./pylibfdt/libfdt_wrap.c:4352:16: error: invalid use of flexible array member
4352 | arg1->name = 0;
| ^
./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_property_data_set’:
./pylibfdt/libfdt_wrap.c:4613:18: error: cast specifies array type
4613 | arg1->data = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
| ^
./pylibfdt/libfdt_wrap.c:4613:16: error: invalid use of flexible array member
4613 | arg1->data = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
| ^
./pylibfdt/libfdt_wrap.c:4615:16: error: invalid use of flexible array member
4615 | arg1->data = 0;
| ^
Turns out this is known issue with SWIG: https://github.com/swig/swig/issues/1699
Implement the work-around to ignore the flexible array member.
Fixes: a41509bea3 ("libfdt: Replace deprecated 0-length arrays with proper flexible arrays")
Cc: Kees Cook <keescook@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20230201224441.305757-1-robh@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
2 years ago |
.. |
.gitignore
|
Use Python3 by default
|
6 years ago |
Makefile.pylibfdt
|
pylibfdt: Move setup.py to the top level
|
3 years ago |
libfdt.i
|
pylibfdt: Work-around SWIG limitations with flexible arrays
|
2 years ago |
meson.build
|
pylibfdt: Move setup.py to the top level
|
3 years ago |