Bug 796929

Summary: xulrunner doesn't compile on ARM
Product: [Fedora] Fedora Reporter: Peter Robinson <pbrobinson>
Component: xulrunnerAssignee: Martin Stransky <stransky>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: caillon, dmueller, gecko-bugs-nobody, johnp, stransky, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-27 23:00:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418    
Attachments:
Description Flags
Changes for spec and mozconfig
none
Patch to build on ARM none

Description Peter Robinson 2012-02-23 21:46:44 UTC
recent versions of xulrunner have added the ability to explicitly specify various ARM build options such as hard or soft floating point as well as they type of VFP. We now specify those for ARM builds.

But not all the code uses these options but rather runs some tests to see if the processor supports NEON SIMD instructions. The problem with this is not ARM processors contain NEON capabilities and we need to be able to specify what options we want so we can run on as many platforms as possible.

xulrunner should only try to detect these sort of things if they aren't explicitly specified. 

in configure.in there's this section which detects the NEON and attempts to use it.

if test "$CPU_ARCH" = "arm"; then
  AC_MSG_CHECKING(for ARM SIMD support in compiler)
  # We try to link so that this also fails when
  # building with LTO.
  AC_TRY_LINK([],
                 [asm("uqadd8 r1, r1, r2");],
                 result="yes", result="no")
  AC_MSG_RESULT("$result")
  if test "$result" = "yes"; then
      AC_DEFINE(HAVE_ARM_SIMD)
      HAVE_ARM_SIMD=1
  fi

  AC_MSG_CHECKING(for ARM NEON support in compiler)
  # We try to link so that this also fails when
  # building with LTO.
  AC_TRY_LINK([],
                 [asm(".fpu neon\n vadd.i8 d0, d0, d0");],
                 result="yes", result="no")
  AC_MSG_RESULT("$result")
  if test "$result" = "yes"; then
      AC_DEFINE(HAVE_ARM_NEON)
      HAVE_ARM_NEON=1
  fi
fi # CPU_ARCH = arm

AC_SUBST(HAVE_ARM_SIMD)
AC_SUBST(HAVE_ARM_NEON)


The build errors we get are:

/usr/bin/python2.7 ../../config/pythonpath.py -I../../config ../../config/expandlibs_exec.py --uselist --  c++  -fno-rtti -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -fstack-protector --param=ssp-buffer-size=4 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -fpermissive -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -fno-exceptions -fno-strict-aliasing -std=gnu++0x -pthread -ffunction-sections -fdata-sections -pipe  -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer -fPIC -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o libxul.so  nsStaticXULComponents.o nsUnicharUtils.o nsBidiUtils.o nsRDFResource.o    -lpthread    -Wl,-rpath-link,/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/dist/bin -Wl,-rpath-link,/usr/lib    ../../embedding/browser/gtk/src/libgtkembedmoz.a ../../toolkit/xre/libxulapp_s.a  ../../staticlib/components/libnecko.a ../../staticlib/components/libuconv.a ../../staticlib/components/libi18n.a ../../staticlib/components/libchardet.a ../../staticlib/components/libjar50.a ../../staticlib/components/libstartupcache.a ../../staticlib/components/libpref.a ../../staticlib/components/libhtmlpars.a ../../staticlib/components/libimglib2.a ../../staticlib/components/libgkgfx.a ../../staticlib/components/libgklayout.a ../../staticlib/components/libdocshell.a ../../staticlib/components/libembedcomponents.a ../../staticlib/components/libwebbrwsr.a ../../staticlib/components/libnsappshell.a ../../staticlib/components/libtxmgr.a ../../staticlib/components/libcommandlines.a ../../staticlib/components/libtoolkitcomps.a ../../staticlib/components/libpipboot.a ../../staticlib/components/libpipnss.a ../../staticlib/components/libappcomps.a ../../staticlib/components/libjsreflect.a ../../staticlib/components/libcomposer.a ../../staticlib/components/libjetpack_s.a ../../staticlib/components/libtelemetry.a ../../staticlib/components/libjsdebugger.a ../../staticlib/components/libstoragecomps.a ../../staticlib/components/librdf.a ../../staticlib/components/libwindowds.a ../../staticlib/components/libjsctypes.a ../../staticlib/components/libjsperf.a ../../staticlib/components/libgkplugin.a ../../staticlib/components/libunixproxy.a ../../staticlib/components/libjsd.a ../../staticlib/components/libautoconfig.a ../../staticlib/components/libauth.a ../../staticlib/components/libcookie.a ../../staticlib/components/libpermissions.a ../../staticlib/components/libuniversalchardet.a ../../staticlib/components/libfileview.a ../../staticlib/components/libplaces.a ../../staticlib/components/libtkautocomplete.a ../../staticlib/components/libsatchel.a ../../staticlib/components/libpippki.a ../../staticlib/components/libwidget_gtk2.a ../../staticlib/components/libsystem-pref.a ../../staticlib/components/libimgicon.a ../../staticlib/components/libaccessibility.a ../../staticlib/components/libremoteservice.a ../../staticlib/components/libspellchecker.a ../../staticlib/components/libzipwriter.a ../../staticlib/components/libservices-crypto.a ../../staticlib/libjsipc_s.a ../../staticlib/libdomipc_s.a ../../staticlib/libdomplugins_s.a ../../staticlib/libmozipc_s.a ../../staticlib/libmozipdlgen_s.a ../../staticlib/libipcshell_s.a ../../staticlib/libgfx2d.a ../../staticlib/libgfxipc_s.a ../../staticlib/libhal_s.a ../../staticlib/libxpcom_core.a ../../staticlib/libucvutil_s.a ../../staticlib/libchromium_s.a ../../staticlib/libmozreg_s.a ../../staticlib/libgtkxtbin.a ../../staticlib/libthebes.a ../../staticlib/libycbcr.a ../../staticlib/libangle.a  -L../../dist/bin -L../../dist/lib -ljpeg  ../../media/libpng/libmozpng.a ../../gfx/qcms/libmozqcms.a /builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/dist/lib/libmozjs.a -Wl,-rpath-link,/usr/lib -L/usr/lib -lssl3 -lsmime3 -lnss3 -lnssutil3 -lcrmf -lcairo -lpixman-1 -lfreetype -lfontconfig    -lXrender -lcairo -lX11   ../../gfx/harfbuzz/src/libmozharfbuzz.a ../../gfx/ots/src/libmozots.a  ../../dist/lib/libmozsqlite3.a  -lz  -lhunspell-1.2   -L/usr/lib -lvpx -lasound   -lrt -L../../dist/bin -L../../dist/lib  -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl ../../dist/lib/libmozalloc.a -pthread -L/lib -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0    -lX11  -lXext  -pthread -lpangoft2-1.0 -lfreetype -lfontconfig -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -pthread -lgtk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lgdk-x11-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpng12 -lm -lpango-1.0 -lcairo -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lXt -lgthread-2.0 -lfreetype -lstartup-notification-1   -ldl  -lrt    
../../xpcom/base/nsSystemInfo.o: In function `mozilla::supports_edsp()':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/xpcom/base/../../dist/include/mozilla/arm.h:153: undefined reference to `mozilla::arm_private::edsp_enabled'
../../xpcom/base/nsSystemInfo.o: In function `mozilla::supports_armv6()':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/xpcom/base/../../dist/include/mozilla/arm.h:163: undefined reference to `mozilla::arm_private::armv6_enabled'
../../xpcom/base/nsSystemInfo.o: In function `mozilla::supports_neon()':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/xpcom/base/../../dist/include/mozilla/arm.h:173: undefined reference to `mozilla::arm_private::neon_enabled'
../../gfx/ycbcr/ycbcr_to_rgb565.o: In function `mozilla::gfx::ScaleYCbCrToRGB565(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char*, int, int, int, int, int, int, int, int, int, mozilla::gfx::YUVType, mozilla::gfx::ScaleFilter)':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/gfx/ycbcr/ycbcr_to_rgb565.cpp:570: undefined reference to `mozilla::arm_private::neon_enabled'
../../gfx/ycbcr/ycbcr_to_rgb565.o: In function `mozilla::gfx::IsScaleYCbCrToRGB565Fast(int, int, int, int, int, int, mozilla::gfx::YUVType, mozilla::gfx::ScaleFilter)':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/gfx/ycbcr/ycbcr_to_rgb565.cpp:601: undefined reference to `mozilla::arm_private::neon_enabled'
../../gfx/ycbcr/ycbcr_to_rgb565.o: In function `mozilla::gfx::ConvertYCbCrToRGB565(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char*, int, int, int, int, int, int, int, mozilla::gfx::YUVType)':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/gfx/ycbcr/ycbcr_to_rgb565.cpp:684: undefined reference to `mozilla::arm_private::neon_enabled'
../../gfx/ycbcr/ycbcr_to_rgb565.o: In function `mozilla::gfx::IsConvertYCbCrToRGB565Fast(int, int, int, int, mozilla::gfx::YUVType)':
/builddir/build/BUILD/xulrunner-10.0.1/mozilla-release/gfx/ycbcr/ycbcr_to_rgb565.cpp:697: undefined reference to `mozilla::arm_private::neon_enabled'
collect2: ld returned 1 exit status
make[5]: *** [libxul.so] Error 1

It appears with the addition of the ability to specify the ARM options some bits were missed. It would be awesome if we could have a patch to allow us to build xulrunner on ARM and move forward on F-17 building.

Comment 1 Peter Robinson 2012-02-23 21:48:19 UTC
A failed build example http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=375237

Comment 2 Dirk Mueller 2012-02-26 23:04:19 UTC
there is a patch proposed upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=724615

Comment 3 Peter Robinson 2012-02-27 10:06:08 UTC
Martin: If I add the following two patches:
- Upstream patch
- Mod to spec file/xulrunner-mozconfig

it compiles on ARM sfp/hfp. Can you please add to our mainline xulrunner builds.

Comment 4 Peter Robinson 2012-02-27 10:07:21 UTC
Created attachment 566003 [details]
Changes for spec and mozconfig

Attached are the minor changes needed to build successfully on ARM

Comment 5 Peter Robinson 2012-02-27 10:08:35 UTC
Created attachment 566004 [details]
Patch to build on ARM

This is the upstream mozilla patch to build o ARM

Comment 6 Martin Stransky 2012-02-27 10:30:43 UTC
Okay, I'll add it.

Comment 7 Martin Stransky 2012-02-27 11:33:31 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=3821831
Package xulrunner-10.0.1-4.fc18

Please test the build on arm and close the bug then.

Comment 8 Peter Robinson 2012-02-27 23:00:30 UTC
Builds on ARM F-17. Merged the rawhide changes into F-17 as well.