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
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 3.8.0
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-17 14:39 UTC by Richard Dunkley
Modified: 2014-11-17 15:47 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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.