evilsong / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[patch] Fix for building for ARM targets #493

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
gperftools would fail to build for ARM targets for a couple of reasons:

1. there are some ARMv7 instructions used when the target is ARMv6 so those 
fail to assemble.

2. the cache line length is undefined for ARM architectures

This patch addresses both issues by defining suitable cache line lengths for 
ARM (and giving a meaningful build error for unknown platforms). It also 
includes some ARMv6 code for when the target has that architecture.

FYI: this patch was authored by Ben Avison, RISC OS Open, www.riscosopen.org

Original issue reported on code.google.com by sarev_of...@yahoo.co.uk on 15 Jan 2013 at 2:13

Attachments:

GoogleCodeExporter commented 9 years ago
Tested on Raspberry Pi hardware, OS Linux raspberrypi 3.2.27+.

$ svn info
Path: .
Working Copy Root Path: /home/pi/gperftools/gperftools-read-only
URL: http://gperftools.googlecode.com/svn/trunk
Repository Root: http://gperftools.googlecode.com/svn
Repository UUID: 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
Revision: 182
Node Kind: directory
Schedule: normal
Last Changed Author: chappedm@gmail.com
Last Changed Rev: 182
Last Changed Date: 2012-11-05 04:45:01 +0000 (Mon, 05 Nov 2012)

Original comment by sarev_of...@yahoo.co.uk on 15 Jan 2013 at 2:16

GoogleCodeExporter commented 9 years ago
r197 | chappedm@gmail.com | 2013-03-10 20:23:03 -0400 (Sun, 10 Mar 2013) | 6 
lines

issue-493: Fix for building against ARM targets

gperftools was failing to build for arm targets for the following reasons:
1. Some ARMv7 instructions used when the target is ARMv6 so those fail to 
assemble
2. The cache line length is undefined for ARM architectures

Original comment by chapp...@gmail.com on 11 Mar 2013 at 12:23

GoogleCodeExporter commented 9 years ago
There seems to be a bug in this patch.

On the line that says
#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || 
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || 
defined(__ARM_ARCH_6KZ__) || defined(__ARM_ARCH_6T2__)

__ARM__ARCH_6KZ__ does not exist, it should be __ARM__ARCH_6ZK__ instead (flip 
the K and the Z), or a || defined(__ARM_ARCH_6ZK__) can be added, just to keep 
__ARM__ARCH_6KZ__ working in case somebody is using it.

tcmalloc does not build on the Raspberry Pi because of this.

Original comment by pedron...@gmail.com on 9 Oct 2014 at 7:51

GoogleCodeExporter commented 9 years ago
Pressed send too soon. It does not build on the Raspberry Pi when using 
"-mcpu=arm1176jzf-s"

Original comment by pedron...@gmail.com on 9 Oct 2014 at 7:54

GoogleCodeExporter commented 9 years ago
This is plausible. I don't have raspberry so cannot test. Please consider 
testing this proposed fix: 
https://github.com/alk/gperftools/commit/7efda3497aa7d3f2ef32dbda4bdcc8fcc0c62ee
9

Original comment by alkondratenko on 11 Oct 2014 at 10:13

GoogleCodeExporter commented 9 years ago
Actually I've realized that my fix was terribly wrong. Correct fix is now 
uploaded to wip branch here: 
https://github.com/alk/gperftools/tree/wip-raspberry-pi-barrier-fix.

Please consider testing it.

Original comment by alkondratenko on 18 Oct 2014 at 11:50

GoogleCodeExporter commented 9 years ago
I've been out. I'll give it a try on Monday and will report back

Original comment by pedron...@gmail.com on 19 Oct 2014 at 2:36