Bug 24588 - __clear_cache in mini-arm.c not supported in gcc toolchain
Summary: __clear_cache in mini-arm.c not supported in gcc toolchain
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 3.8.0
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-11-17 14:39 UTC by Richard Dunkley
Modified: 2014-11-17 15:47 UTC (History)
3 users (show)

See Also:
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.

Note You need to log in before you can comment on or make changes to this bug.