Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch] Fix for building for ARM targets #496

Closed
alk opened this issue Aug 23, 2015 · 7 comments
Closed

[patch] Fix for building for ARM targets #496

alk opened this issue Aug 23, 2015 · 7 comments

Comments

@alk
Copy link
Contributor

alk commented Aug 23, 2015

Originally reported on Google Code with ID 493

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

Reported by sarev_of_aona@yahoo.co.uk on 2013-01-15 14:13:01


- _Attachment: [gperftools.patch](https://storage.googleapis.com/google-code-attachments/gperftools/issue-493/comment-0/gperftools.patch)_
@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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)

Reported by sarev_of_aona@yahoo.co.uk on 2013-01-15 14:16:12

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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

Reported by chappedm on 2013-03-11 00:23:33

  • Status changed: Fixed

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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.

Reported by pedronavf on 2014-10-09 19:51:43

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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

Reported by pedronavf on 2014-10-09 19:54:05

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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

Reported by alkondratenko on 2014-10-11 22:13:04

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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.

Reported by alkondratenko on 2014-10-18 23:50:26

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

I've been out. I'll give it a try on Monday and will report back

Reported by pedronavf on 2014-10-19 02:36:54

@alk alk closed this as completed Aug 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant