nspr needs aarch64 support

Bug #1095309 reported by Riku Voipio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro AArch64 cross-distro work
Fix Released
High
Unassigned
Linaro OpenEmbedded
Fix Released
Undecided
Riku Voipio
NSPR
Fix Released
Medium

Bug Description

Nspr needs primitive type and endianness definitions in pr/include/md/_linux.cfg. nspr is important as it blocks software such as nss, which is the key crypto library in many projects.

Revision history for this message
Riku Voipio (riku-voipio) wrote :

The following patch is from fedora aarch64 porting project. I have edited it with adding support for __AARCH64EB__.

Changed in linaro-aarch64:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Riku Voipio (riku-voipio) wrote :

The nspr testsuite fails some tests:

foreign./runtests.sh: line 239: 2132 Aborted
gethost FAILED
layer./runtests.sh: line 239: 2202 Aborted
multiwait./runtests.sh: line 239: 2222 Aborted
nameshm1 FAILED
provider./runtests.sh: line 239: 4311 Aborted
semaerr FAILED
servr_kk FAILED
servr_uk FAILED
servr_ku FAILED
servr_uu FAILED

gethost is due to OE configuration, but rest seem to be pthread issues, which could be a problem.

Revision history for this message
Riku Voipio (riku-voipio) wrote :

Log from test run

Revision history for this message
Riku Voipio (riku-voipio) wrote :

Most tests fail at:

pthread_attr_setstacksize(&tattr, 64 * 1024);

64K is less than 0x20000, what appears to be the PTHREAD_STACK_MIN for Aarch64.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

This patch is part of nspr 4.9.4 release.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

ops, I need not work with code in the morning - I did not noticed Riku's change in meta-aarch64...

Revision history for this message
Riku Voipio (riku-voipio) wrote :

With the stack size fixed, remaining errors:

multiwait FAILED
-timeout

nameshm1 FAILED
semaerr FAILED

Both hang on semaphore issues. Sema and semaping tests pass.

servr_kk FAILED
servr_uk FAILED
servr_ku FAILED
servr_uu FAILED

No useful debug output...

Revision history for this message
Riku Voipio (riku-voipio) wrote :

Updated patch:

Now we set minimum stack size on aarch64 and enable atomic operations (same as on arm).

Separate patch in OE to fix testsuite on foreign and provider tests.

Revision history for this message
In , Riku Voipio (riku-voipio) wrote :

Created attachment 698613
fix-build-on-aarch64.patch

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4

Steps to reproduce:

Tried to compile NSPR for Aarch64 (64-Bit ARM). Instructions howto build for Aarch64 is here:

https://wiki.linaro.org/HowTo/ARMv8/OpenEmbedded

Note that the meta-aarch64 layer includes already the patch attached to this bug.

Actual results:

NSPR does not compile on 64-Bit ARM.

With the attached patch, (originally written by Al Stone, With my additions and fixes) NSPR compiles for Aarch64, and passes most testsuite tests. The remaining failing tests:

multiwait FAILED
- timeout due to slow emulator

nameshm1 FAILED
semaerr FAILED
- Both hang on semaphore issues. Sema and semaping tests pass.

servr_kk FAILED
servr_uk FAILED
servr_ku FAILED
servr_uu FAILED

- These tests provide no useful debug output

foreign FAILED
provider FAILED
- These hardcode thread stack size 64K, which is less than the minimum stack size on Aarch64. Theses tests are broken in this regard and should take in account PTHREAD_STACK_MIN size.

Changed in nspr:
importance: Unknown → Medium
status: Unknown → New
Changed in linaro-aarch64:
status: Triaged → In Progress
Revision history for this message
In , Wan-Teh Chang (wtc-google) wrote :

Thank you for the patch. I will take a look at it.

Changed in nspr:
status: New → In Progress
Marcin Juszkiewicz (hrw)
Changed in linaro-oe:
assignee: nobody → Riku Voipio (riku-voipio)
Marcin Juszkiewicz (hrw)
Changed in linaro-oe:
status: New → Fix Released
Changed in linaro-oe:
milestone: none → 13.01
Revision history for this message
In , Wan-Teh Chang (wtc-google) wrote :

Created attachment 712279
fix-build-on-aarch64.patch, v2, by Al Stone and Riku Voipio

I listed the new aarch64 code right below the arm code
because they are closely related.

We should look into the _MD_MINIMUM_STACK_SIZE issue. I
still checked in your _MD_MINIMUM_STACK_SIZE change, but
we should try to avoid it. Perhaps the test program should
not specify a stack size?
http://mxr.mozilla.org/nspr/ident?i=_MD_MINIMUM_STACK_SIZE

Patch checked in on the NSPR trunk (NSPR 4.9.6).

Checking in _linux.cfg;
/cvsroot/mozilla/nsprpub/pr/include/md/_linux.cfg,v <-- _linux.cfg
new revision: 3.30; previous revision: 3.29
done
Checking in _linux.h;
/cvsroot/mozilla/nsprpub/pr/include/md/_linux.h,v <-- _linux.h
new revision: 3.64; previous revision: 3.63
done

Changed in linaro-aarch64:
status: In Progress → Fix Committed
Revision history for this message
In , Riku Voipio (riku-voipio) wrote :

> Patch checked in on the NSPR trunk (NSPR 4.9.6).

Thanks!

> Perhaps the test program should not specify a stack size?

I think this would be the correct solution, I don't understand why the tests need to set stack size. But that's for another bug.

Revision history for this message
In , Wan-Teh Chang (wtc-google) wrote :

Riku: Thanks for the reply. OK, we'll deal with the 'foreign'
and 'provider' tests in another bug. Marked the bug fixed.

Changed in nspr:
status: In Progress → Fix Released
Wookey (wookey)
no longer affects: nspr (Ubuntu)
Revision history for this message
Riku Voipio (riku-voipio) wrote :

nspr 4.9.6 released

Changed in linaro-aarch64:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.