Closed Bug 1121869 Opened 10 years ago Closed 10 years ago

[flatfish] build break by "Error: bad type in Neon instruction"

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dliang, Assigned: ethlin)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file build.log
The error message as following:

{standard input}: Assembler messages:
{standard input}:241: Error: bad type in Neon instruction -- `vcgt.u8 d17,d17,#0'
In the directory  /home/dannyliang/work/codes/b2g_flatfish_github/objdir-gecko/layout/svg
The following command failed to execute properly:
/usr/bin/ccache /home/dannyliang/work/codes/b2g_flatfish_github/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-g++ -o nsSVGMaskFrameNEON.o -c -I../../dist/system_wrappers -include /home/dannyliang/work/codes/b2g_flatfish_github/gecko/config/gcc_hidden_dso_handle.h -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg -I. -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg/../../widget -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg/../base -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg/../generic -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg/../style -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg/../xul -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/dom/base -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/dom/svg -I../../dist/include -I/home/dannyliang/work/codes/b2g_flatfish_github/objdir-gecko/dist/include/nspr -I/home/dannyliang/work/codes/b2g_flatfish_github/objdir-gecko/dist/include/nss -fPIC -DANDROID -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/arch-arm/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libstdc++/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/kernel/common -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/kernel/arch-arm -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libm/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libm/include/arm -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libthread_db/include -I/home/dannyliang/work/codes/b2g_flatfish_github/system -I/home/dannyliang/work/codes/b2g_flatfish_github/system/core/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic -I/home/dannyliang/work/codes/b2g_flatfish_github/hardware/libhardware/include -I/home/dannyliang/work/codes/b2g_flatfish_github/external/valgrind/fxos-include -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/native/include -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/include -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/include/media -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/include/camera -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/native/include/media/openmax -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/media/libstagefright/include -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MP -MF .deps/nsSVGMaskFrameNEON.o.pp -DANDROID -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/arch-arm/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libstdc++/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/kernel/common -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libc/kernel/arch-arm -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libm/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libm/include/arm -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic/libthread_db/include -I/home/dannyliang/work/codes/b2g_flatfish_github/system -I/home/dannyliang/work/codes/b2g_flatfish_github/system/core/include -isystem /home/dannyliang/work/codes/b2g_flatfish_github/bionic -I/home/dannyliang/work/codes/b2g_flatfish_github/hardware/libhardware/include -I/home/dannyliang/work/codes/b2g_flatfish_github/external/valgrind/fxos-include -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/native/include -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/include -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/include/media -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/include/camera -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/native/include/media/openmax -I/home/dannyliang/work/codes/b2g_flatfish_github/frameworks/av/media/libstagefright/include -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -mandroid -fno-short-enums -fno-exceptions -Wno-psabi -DMOZ_ENABLE_JS_DUMP -include /home/dannyliang/work/codes/b2g_flatfish_github/gonk-misc/Unicode.h -I/home/dannyliang/work/codes/b2g_flatfish_github/gecko/build/stlport/stlport -I/home/dannyliang/work/codes/b2g_flatfish_github/ndk/sources/cxx-stl/system/include -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -g -freorder-blocks -Os -fno-reorder-functions -funwind-tables -Werror -mfpu=neon /home/dannyliang/work/codes/b2g_flatfish_github/gecko/layout/svg/nsSVGMaskFrameNEON.cpp
make[6]: *** [nsSVGMaskFrameNEON.o] Error 1
make[5]: *** [layout/svg/target] Error 2
make[5]: *** Waiting for unfinished jobs....
Hi Ethan,
The build break might be caused by your commit for bug 1120294, would you mind check this build break on flatfish? With reverting related commits, flatfish built pass. Thanks,
Depends on: 1120294
Flags: needinfo?(etlin)
See Also: → 1121907, 1121900
If you pull out the second argument to vmul_u8 into its own variable does that fix anything. There's some mention in the bug about it working if that is a register.
Comment on attachment 8550682 [details] [diff] [review]
check gcc pr51534 before using arm neon intrinsic function vcgt. v1

gcc has some error for neon vcgt_u8 function. check gcc has this fix before using that in svg mask.
Attachment #8550682 - Flags: feedback?(gps)
Hi!
I just successfully built by upgrading the toolchain to gcc.4.8.
I opened bug 1122932 to track this upgrade.
Attached patch Change neon intrinsic function (obsolete) — Splinter Review
Hi Robert,
I tried pull out the second argument into its own variable, and the error was the same.
In this patch, I used another neon intrinsic function that can do the same thing. Since the gcc4.8 can fix this issue, I think we don't need to commit this patch.
Flags: needinfo?(etlin)
Comment on attachment 8550682 [details] [diff] [review]
check gcc pr51534 before using arm neon intrinsic function vcgt. v1

I'm at a week long meeting. Redirecting to glandium.
Attachment #8550682 - Flags: feedback?(gps) → feedback?(mh+mozilla)
Comment on attachment 8550682 [details] [diff] [review]
check gcc pr51534 before using arm neon intrinsic function vcgt. v1

Review of attachment 8550682 [details] [diff] [review]:
-----------------------------------------------------------------

::: build/autoconf/gcc-pr51534.m4
@@ +11,5 @@
> +if test "$GNU_CC" -a -n "$BUILD_ARM_NEON" ; then
> +AC_MSG_CHECKING(for gcc PR51534)
> +ac_have_gcc_pr51534="no"
> +AC_LANG_SAVE
> +AC_LANG_CPLUSPLUS

Presumably, this is not a C++ specific failure, so no need to switch to c++ for this test.

@@ +28,5 @@
> +{
> +  return vcgt_u32 (in, vdup_n_u32 (0));
> +}
> +], [],
> +   ac_have_gcc_pr51534="yes",

Seeing the gcc bug is about bad code gen, testing if that code compiles is not going to give you the right answer.

::: layout/svg/nsSVGMaskFrameNEON.cpp
@@ +8,5 @@
>  #include <arm_neon.h>
>  
> +#ifndef MOZ_HAVE_GCC_PR51534
> +#error "Some gcc version has a bug for neon vcgt_u8 function."
> +#endif

This file is still being built, so the build will fail with gcc 4.6.

@@ +52,1 @@
>        uint8x8_t alphaVector = vcgt_u8(argb.val[GFX_ARGB32_OFFSET_A], zeroVector);

The whole patch would be much simpler if you just used inline assembly instead of the intrinsic.
Attachment #8550682 - Flags: feedback?(mh+mozilla) → feedback-
(In reply to Mike Hommey [:glandium] from comment #9)
> Seeing the gcc bug is about bad code gen, testing if that code compiles is
> not going to give you the right answer.

Oh, I see comment #0, now, and yes, it will.
(In reply to Ethan Lin[:Ethan] from comment #7)
> Created attachment 8551017 [details] [diff] [review]
> Change neon intrinsic function
> 
> Since the gcc4.8 can fix this issue, I think we don't need to commit
> this patch.

As long as we support building with gcc 4.6, this should be fixed.
Update the patch for fixing the neon compile problem in gcc4.6. Tryserver result: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9237736c0577
Attachment #8551017 - Attachment is obsolete: true
Attachment #8551565 - Flags: review?(longsonr)
Attachment #8551565 - Flags: review?(longsonr) → review+
Please land the attachment 8551565 [details] [diff] [review] to mozilla-central.
Assignee: nobody → etlin
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e1a9476d44f6
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: