Bug 24588

Summary: __clear_cache in mini-arm.c not supported in gcc toolchain
Product: [Mono] Runtime Reporter: Richard Dunkley <rick.dunkley>
Component: JITAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime, vargaz
Priority: ---    
Version: 3.8.0   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Richard Dunkley 2014-11-17 14:39:06 UTC
I am using Petalinux 2014.2 to cross-compile Mono for the Zynq-7000 SoC from Xilinx. It uses GCC v4.8.1 (Sourcery Codebench Lite 2013.11-53). The build fails stating that __clear_cache is implicitly declared. My understanding is ___builtin__clear_cache replaced __clear_cache in 4.3.1 or later.

The following code in mono/mini/mini-arm.c (line 1154) fails to compile:

...
#elif __APPLE__
    sys_icache_invalidate(code, size);
#elif __GNUC_PREREQ(4, 1)
    __clear_cache (code, code + size);
...

The following modification works:

...
#elif __APPLE__
    sys_icache_invalidate(code, size);
#elif __GNUC_PREREQ(4, 3)
    __builtin___clear_cache (code, code + size);
#elif __GNUC_PREREQ(4, 1)
    __clear_cache (code, code + size);
...
Comment 1 Zoltan Varga 2014-11-17 15:47:02 UTC
Applied in e52d20ed7d3ca29041ecdb20ff5fe003bf4102de. Thanks.