On 7/2/20 5:01 PM, Jeremy Puhlman wrote:
> From: Jeremy Puhlman <[email protected]>
>
> Somewhere a long the line someone hand modified the yara_grammar.h file
> but didn't add code to generate the same code. The result is if the
> file is regenerated from the .y file it complains about a missing
> definition of YR_COMPILER.
>
> This is fixed in 0.103. Backported code snippet to resolve the issue.

I am seeing this error with this patch applied on a qemux86-64 machine.

|
/home/build/builds/master/tmp/work/x86_64-linux/clamav-native/0.101.5-r0/git/libclamav/yara_grammar.y:236.19-27:
error: extra characters in character literal
|   236 |     | rules error 'include' /* .. or include statement */
|       |                   ^~~~~~~~~
|
/home/build/builds/master/tmp/work/x86_64-linux/clamav-native/0.101.5-r0/git/libclamav/yara_grammar.y:
warning: fix-its can be applied.  Rerun with option '--update'. [-Wother]
| Makefile:4247: recipe for target 'yara_grammar.c' failed

-armin
>
> Signed-off-by: Jeremy Puhlman <[email protected]>
> ---
>  ...yara_grammar.h-to-include-yara_compi.patch | 32 +++++++++++++++++++
>  recipes-scanners/clamav/clamav_0.101.5.bb     |  1 +
>  2 files changed, 33 insertions(+)
>  create mode 100644 
> recipes-scanners/clamav/clamav-0.101.5/0001-force-generated-yara_grammar.h-to-include-yara_compi.patch
>
> diff --git 
> a/recipes-scanners/clamav/clamav-0.101.5/0001-force-generated-yara_grammar.h-to-include-yara_compi.patch
>  
> b/recipes-scanners/clamav/clamav-0.101.5/0001-force-generated-yara_grammar.h-to-include-yara_compi.patch
> new file mode 100644
> index 0000000..1abbaea
> --- /dev/null
> +++ 
> b/recipes-scanners/clamav/clamav-0.101.5/0001-force-generated-yara_grammar.h-to-include-yara_compi.patch
> @@ -0,0 +1,32 @@
> +From e7201870e19dea1bc3bc1bb16288c5135709ec6c Mon Sep 17 00:00:00 2001
> +From: Jeremy Puhlman <[email protected]>
> +Date: Thu, 2 Jul 2020 23:41:17 +0000
> +Subject: [PATCH] force generated yara_grammar.h to include yara_compiler.h
> +
> +Someone manually modified yara_grammar.h to inlude yara_compiler.h,
> +however if yara_grammar.h is generated from yara_grammar.y, it fails
> +to build because YR_COMPILER is not defined.
> +
> +Upstream-Status: Backport 
> [https://github.com/Cisco-Talos/clamav-devel/commit/8e765853d07098a13b4f352c2c77e4d3873905f6#diff-0a6403048e9f5a96598ba9d1d45c7b31]
> +---
> + libclamav/yara_grammar.y | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/libclamav/yara_grammar.y b/libclamav/yara_grammar.y
> +index cb893975d..eb0784a2a 100644
> +--- a/libclamav/yara_grammar.y
> ++++ b/libclamav/yara_grammar.y
> +@@ -36,6 +36,10 @@ See the License for the specific language governing 
> permissions and
> + limitations under the License.
> + */
> + 
> ++%code requires {
> ++#include "yara_compiler.h"
> ++}
> ++
> + %{
> + 
> + #include <assert.h>
> +-- 
> +2.24.3
> +
> diff --git a/recipes-scanners/clamav/clamav_0.101.5.bb 
> b/recipes-scanners/clamav/clamav_0.101.5.bb
> index 2ea2c9b..7694265 100644
> --- a/recipes-scanners/clamav/clamav_0.101.5.bb
> +++ b/recipes-scanners/clamav/clamav_0.101.5.bb
> @@ -18,6 +18,7 @@ SRC_URI = 
> "git://github.com/vrtadmin/clamav-devel;branch=rel/0.101 \
>      file://tmpfiles.clamav \
>      file://${BPN}.service \
>      file://freshclam-native.conf \
> +    file://0001-force-generated-yara_grammar.h-to-include-yara_compi.patch \
>      "
>  
>  S = "${WORKDIR}/git"
>
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49853): https://lists.yoctoproject.org/g/yocto/message/49853
Mute This Topic: https://lists.yoctoproject.org/mt/75270626/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to