diff options
| author | Kai Kang <kai.kang@windriver.com> | 2021-03-11 17:34:58 +0800 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2021-03-18 08:01:19 -0700 |
| commit | db86cfad19a8990ca2208cbfef1a6bd0cc987060 (patch) | |
| tree | bf9358579fcbd8b0f1371e87f954861e119ed59c | |
| parent | d4e7769be2f1e8950a7ddd3d38bcf5048100b1b5 (diff) | |
| download | meta-security-db86cfad19a8990ca2208cbfef1a6bd0cc987060.tar.gz | |
samhain: fix compile error on powerpc
It fails to comile samhain for powerpc(qemuppc):
| x_sh_dbIO.c: In function 'swap_short':
| x_sh_dbIO.c:229:36: error: initializer element is not constant
| 229 | static unsigned short ooop = *iptr;
| | ^
Assign after initialization of the static variable to avoid the failure.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | recipes-ids/samhain/files/samhain-fix-initializer-element-is-not-constant.patch | 28 | ||||
| -rw-r--r-- | recipes-ids/samhain/samhain.inc | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/recipes-ids/samhain/files/samhain-fix-initializer-element-is-not-constant.patch b/recipes-ids/samhain/files/samhain-fix-initializer-element-is-not-constant.patch new file mode 100644 index 0000000..72cb880 --- /dev/null +++ b/recipes-ids/samhain/files/samhain-fix-initializer-element-is-not-constant.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | Fix error when compile for powerpc: | ||
| 2 | |||
| 3 | | x_sh_dbIO.c: In function 'swap_short': | ||
| 4 | | x_sh_dbIO.c:229:36: error: initializer element is not constant | ||
| 5 | | 229 | static unsigned short ooop = *iptr; | ||
| 6 | | | ^ | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 11 | --- | ||
| 12 | src/sh_dbIO.c | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/src/sh_dbIO.c b/src/sh_dbIO.c | ||
| 16 | index b547ac5..23a9621 100644 | ||
| 17 | --- a/src/sh_dbIO.c | ||
| 18 | +++ b/src/sh_dbIO.c | ||
| 19 | @@ -226,7 +226,8 @@ static unsigned short * swap_short (unsigned short * iptr) | ||
| 20 | else | ||
| 21 | { | ||
| 22 | /* alignment problem */ | ||
| 23 | - static unsigned short ooop = *iptr; | ||
| 24 | + static unsigned short ooop; | ||
| 25 | + ooop = *iptr; | ||
| 26 | unsigned short hi = (ooop & 0xff00); | ||
| 27 | unsigned short lo = (ooop & 0xff); | ||
| 28 | ooop = (lo << 8) | (hi >> 8); | ||
diff --git a/recipes-ids/samhain/samhain.inc b/recipes-ids/samhain/samhain.inc index 6a2eb08..0148e46 100644 --- a/recipes-ids/samhain/samhain.inc +++ b/recipes-ids/samhain/samhain.inc | |||
| @@ -18,6 +18,7 @@ SRC_URI = "https://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \ | |||
| 18 | file://samhain-avoid-searching-host-for-postgresql.patch \ | 18 | file://samhain-avoid-searching-host-for-postgresql.patch \ |
| 19 | file://samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch \ | 19 | file://samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch \ |
| 20 | file://fix-build-with-new-version-attr.patch \ | 20 | file://fix-build-with-new-version-attr.patch \ |
| 21 | file://samhain-fix-initializer-element-is-not-constant.patch \ | ||
| 21 | " | 22 | " |
| 22 | 23 | ||
| 23 | SRC_URI[sha256sum] = "3e57574036d5055e9557ec5095818b419ea6c4365370fc2ccce1e9f87f9fad08" | 24 | SRC_URI[sha256sum] = "3e57574036d5055e9557ec5095818b419ea6c4365370fc2ccce1e9f87f9fad08" |
