Closed
Bug 1353817
Opened 4 years ago
Closed 3 years ago
skia build error on aarch64, with esr52: "SkHalf.h:43:5: error: 'float32x4_t' was not declared in this scope"
Categories
(Core :: Graphics, defect, P3)
Core
Graphics
Tracking
()
RESOLVED
WONTFIX
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | affected |
People
(Reporter: dholbert, Unassigned)
References
Details
(Whiteboard: gfx-noted)
Filing this bug on behalf of cgrobertson, via this firefox-dev posting: https://mail.mozilla.org/pipermail/firefox-dev/2017-April/005274.html I'm build Firefox 52 ESR on an aarch64 machine and am getting this compile error: ======================================================================================================= [ 1688s] In file included from /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkColorSpaceXform.cpp:12:0: [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h: In function 'Sk4f SkHalfToFloat_finite_ftz(const Sk4h&)': [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:43:5: error: 'float32x4_t' was not declared in this scope [ 1688s] float32x4_t fs; [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:43:17: error: expected ';' before 'fs' [ 1688s] float32x4_t fs; [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:45:22: error: 'fs' was not declared in this scope [ 1688s] : [fs] "=w" (fs) // =w: write-only NEON register [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:46:24: error: 'const Sk4h' has no member named 'fVec' [ 1688s] : [hs] "w" (hs.fVec)); // w: read-only NEON register [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h: In function 'Sk4h SkFloatToHalf_finite_ftz(const Sk4f&)': [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:69:5: error: 'float32x4_t' was not declared in this scope [ 1688s] float32x4_t vec = fs.fVec; [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:69:17: error: expected ';' before 'vec' [ 1688s] float32x4_t vec = fs.fVec; [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:71:23: error: 'vec' was not declared in this scope [ 1688s] : [vec] "+w" (vec)); // +w: read-write NEON register [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:72:49: error: 'vget_low_f32' was not declared in this scope [ 1688s] return vreinterpret_u16_f32(vget_low_f32(vec)); [ 1688s] ^ [ 1688s] /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:72:50: error: 'vreinterpret_u16_f32' was not declared in this scope [ 1688s] return vreinterpret_u16_f32(vget_low_f32(vec)); ======================================================================================================= It all has to do with the code in SkHalf.h within this #if def... : #if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) Can anyone help me figure out how to make this compile? Any help is greatly appreciated. Thanks Cheers Charles Robertson Firefox Maintainer SUSE
| Reporter | ||
Comment 1•4 years ago
|
||
Note: we had bug 1142056, "Skia does not build on arm64 (aarch64)", which is marked as being fixed in Firefox 52. So presumably we're expecting that it should build successfully in ESR52 as well, though maybe there's another factor or a regression of some sort here. m_kato, perhaps you might be able to help Charles figure out what's going on here?
Depends on: 1142056
Flags: needinfo?(m_kato)
| Reporter | ||
Comment 2•4 years ago
|
||
(Also, Charles: if you haven't already done so, could you try building trunk ( https://hg.mozilla.org/mozilla-central/ ) on the same machine & see if you hit the same build error there? It'd be good to know if this is ESR52-specific or not. )
Flags: needinfo?(cgrobertson)
Comment 3•4 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #2) > (Also, Charles: if you haven't already done so, could you try building trunk > ( https://hg.mozilla.org/mozilla-central/ ) on the same machine & see if you > hit the same build error there? It'd be good to know if this is > ESR52-specific or not. ) I'll give it a try.
Flags: needinfo?(cgrobertson)
Comment 4•4 years ago
|
||
FWIW, ESR52 builds fine on Debian aarch64.
Comment 5•4 years ago
|
||
I think that arm_neon.h might not included correctly on Charles's machine.
Flags: needinfo?(m_kato)
Comment 6•4 years ago
|
||
(In reply to Makoto Kato [:m_kato] from comment #5) > I think that arm_neon.h might not included correctly on Charles's machine. That was my original thinking. I tried adding "#include <arm_neon.h>" in SkHalf.h. It solved the "'float32x4_t' was not declared in this scope" issue but there were still compiler errors: ========================================================================================================================= In file included from /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkColorSpaceXform.cpp:12:0: /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h: In function ‘Sk4f SkHalfToFloat_finite_ftz(const Sk4h&)’: /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:48:24: error: ‘const Sk4h’ has no member named ‘fVec’ : [hs] "w" (hs.fVec)); // w: read-only NEON register ^ /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:49:12: error: could not convert ‘fs’ from ‘float32x4_t {aka __vector(4) __builtin_aarch64_simd_sf}’ to ‘Sk4f {aka SkNx<4, float>}’ return fs; ^ /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h: In function ‘Sk4h SkFloatToHalf_finite_ftz(const Sk4f&)’: /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:71:26: error: ‘const Sk4f’ has no member named ‘fVec’ float32x4_t vec = fs.fVec; ^ /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:74:50: error: could not convert ‘vreinterpret_u16_f32(vget_low_f32(vec))’ from ‘uint16x4_t {aka __vector(4) __builtin_aarch64_simd_uhi}’ to ‘Sk4h {aka SkNx<4, short unsigned int>}’ return vreinterpret_u16_f32(vget_low_f32(vec)); ^ /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkHalf.h:88:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ========================================================================================================================= I wonder if there might be some configuration switch or define I need to add to my build environment to get all these defines and typedefs turned on properly.
Comment 7•4 years ago
|
||
(In reply to Charles Robertson from comment #3) > (In reply to Daniel Holbert [:dholbert] from comment #2) > > (Also, Charles: if you haven't already done so, could you try building trunk > > ( https://hg.mozilla.org/mozilla-central/ ) on the same machine & see if you > > hit the same build error there? It'd be good to know if this is > > ESR52-specific or not. ) > > I'll give it a try. Apparently trunk requires GCC 4.9 or newer: 0:12.59 ERROR: Only GCC 4.9 or newer is supported (found version 4.8.5). We are building ESR 52 with GCC 4.8. Builds just fine on other platforms such as x86_64, ppc64 and s390x all using GCC 4.8. Could there be a dependency on arm in the SKIA code that requires GCC 4.9+? There is a comment in SkHalf.h that may imply this: ~Line 39: "// GCC 4.9 lacks the intrinsics to use ARMv8 f16<->f32 instructions, so we use inline assembly."
Comment 8•4 years ago
|
||
Mike, are you building 52 with GCC < 4.9 on any Debian release (wheezy)?
Flags: needinfo?(mh+mozilla)
Comment 10•4 years ago
|
||
Hey, I came across this issue in a meeting with Fedora ARM developpers. I just notice that SkNx_neon.h is only included on neon enable ARM 32bit, while this file is also needed for ARM64. I could not test it my self, but a plausible fix for this build issues would be: https://paste.fedoraproject.org/paste/9PPK3VEl4N4~OqB5KbDkHV5M1UNdIGYhyRLivL9gydE= Hopefully this helps.
Comment 11•4 years ago
|
||
(Please notice the = sign that was not included by bugzilla automatic link) (In reply to Charles Robertson from comment #6) > (In reply to Makoto Kato [:m_kato] from comment #5) > > I think that arm_neon.h might not included correctly on Charles's machine. > > That was my original thinking. I tried adding "#include <arm_neon.h>" in > SkHalf.h. It solved the "'float32x4_t' was not declared in this scope" issue > but there were still compiler errors: Properly including SkNx_neon.h will both include arm_neon.h and implement the required converters.
Comment 12•4 years ago
|
||
(In reply to Nicolas Dufresne from comment #10) > Hey, I came across this issue in a meeting with Fedora ARM developpers. I > just notice that SkNx_neon.h is only included on neon enable ARM 32bit, > while this file is also needed for ARM64. I could not test it my self, but a > plausible fix for this build issues would be: > > https://paste.fedoraproject.org/paste/ > 9PPK3VEl4N4~OqB5KbDkHV5M1UNdIGYhyRLivL9gydE= > > Hopefully this helps. See https://cs.chromium.org/chromium/src/third_party/skia/include/core/SkPreConfig.h?type=cs&q=SK_ARM_HAS_NEON+package:%5Echromium$&l=196 aarch64 defines __ARM_NEON. SK_ARM_HAS_NEON is defined on aarch64. So SkNx_neon.h is included by https://cs.chromium.org/chromium/src/third_party/skia/src/core/SkNx.h?type=cs&q=SK_ARM_HAS_NEON&l=362
Comment 13•4 years ago
|
||
Our requirement is gcc 4.9+ by bug 1322792. This is only on ESR tree.
Comment 14•4 years ago
|
||
(In reply to Makoto Kato [:m_kato] from comment #13) > Our requirement is gcc 4.9+ by bug 1322792. This is only on ESR tree. Yes, you already said that. Fedora 25 builds with GCC 6+ and 26 with GCC 7+, this is not the issue. (In reply to Makoto Kato [:m_kato] from comment #12) > See > https://cs.chromium.org/chromium/src/third_party/skia/include/core/ > SkPreConfig.h?type=cs&q=SK_ARM_HAS_NEON+package:%5Echromium$&l=196 > > aarch64 defines __ARM_NEON. SK_ARM_HAS_NEON is defined on aarch64. So > SkNx_neon.h is included by > https://cs.chromium.org/chromium/src/third_party/skia/src/core/SkNx. > h?type=cs&q=SK_ARM_HAS_NEON&l=362 I'll need to raise this to Fedora dev. Running "gcc -dM -E - < /dev/null | grep -i neon" on GCC 6.3.1 does show "#define __ARM_NEON 1". So that only remaining problem I can think of is if they have SK_BUILD_NO_OPTS defined. In that case, SkHalf.h will like fail to build if included, since it does not check for that define.
Updated•4 years ago
|
Whiteboard: gfx-noted
Updated•4 years ago
|
Priority: -- → P3
Comment 15•3 years ago
|
||
We aren't maintaining esr52 anymore.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•