Recommended Posts

So I'm trying to compile firefox 19, not a hard task you wouldn't think but it appears it is!

"/tmp/FFBUILD/src/mozilla-release/obj-x86_64-unknown-linux-gnu/dist/bin/xpcshell: symbol lookup error: /tmp/FFBUILD/src/mozilla-release/obj-x86_64-unknown-linux-gnu/dist/bin/xpcshell: undefined symbol: _Z21JS_SetContextCallbackP9JSRuntimePFiP9JSContextjE"

I have absolutley no idea what that means other than (I think) it's trying to link to some incredibly strange named function that obviously doesn't exist?

So errr, how the heck do I go about fixing this?

Link to comment
https://www.neowin.net/forum/topic/1139536-firefox-xpcshell-being-a-pain/
Share on other sites

That looks like a linker error. The linker is trying to resolve the location of a specific function that is used somewhere in the code but cannot find the function. Try greping the source for SetContextCallbackP9JSRuntimePFiP9JSContextjE to see where that function is defined and used.

I started over again from scratch using gcc this time instead of clang and it's half way through so the results might chance later but right now...

grep -r "SetContextCallbackP9JSRuntimePFiP9JSContextjE" .

Binary file ./obj-x86_64-unknown-linux-gnu/ipc/testshell/XPCShellEnvironment.i_o matches

Binary file ./obj-x86_64-unknown-linux-gnu/js/xpconnect/src/XPCLocale.i_o matches

Binary file ./obj-x86_64-unknown-linux-gnu/js/xpconnect/src/XPCJSRuntime.i_o matches

Binary file ./obj-x86_64-unknown-linux-gnu/js/src/libjs_static.a matches

Binary file ./obj-x86_64-unknown-linux-gnu/js/src/jsapi.i_o matches

Binary file ./obj-x86_64-unknown-linux-gnu/js/src/shell/js matches

...And that's it :s

Although Clang is generally an excellent compiler (I much prefer it to GCC when I'm trying to develop/debug a program due to its fantastic error messages and strict standards compliance), some complex programs which were developed to build with GCC simply won't build with it (yet). Some of those programs (including Firefox) even had to make changes to build with GCC 4.x because GCC 3.x readily accepted many language extensions that GCC 4 removed (or depreciated) to move closer to strict standards compliance. Although GCC 4.8 has much better ANSI C standard support than GCC 3.4 did, it is not perfect. Many non-standard features can still be optionally enabled by passing the compiler the right switches since those features can be very useful if you are not worried about inter-compiler support.

When I suggested greping for the function name, I intended you to search the source code not the build directory. (I was not clear about that. I apologize.) It is not especially useful to know which object files contain references to that function because you don't know which one contains the implementation. The source code will tell you the latter.

I grep'd from the top level directory (including all binary and source folders), and GCC has just got the error too now but for this

/tmpFFBUILD/src/mozilla-release/obj-x86_64-unknown-linux-gnu/dist/bin/xpcshell: symbol lookup error: /tmp/FFBUILD/src/mozilla-release/obj-x86_64-unknown-linux-gnu/dist/bin/xpcshell: undefined symbol: __gcov_indirect_call_profiler

Which distro and arch are you trying to build this on? I'm not sure exactly why you're getting that error, but I know from experience that the Iceweasel source has patches specifically to make Firefox compile on PowerPC and other architectures Mozilla does not support (but Debian does). Even if you are not using Debian, this might help. (Particularly take a look at patches contained in the Iceweasel 19.0-1 diff.)

Great, xpcshell strikes again...

" adding: hyphenation/hyph_lt.dic (deflated 51%)

adding: hyphenation/hyph_nb.dic (deflated 52%)

adding: hyphenation/hyph_la.dic (deflated 59%)

adding: hyphenation/hyph_de-1901.dic (deflated 54%)

adding: hyphenation/hyph_fr.dic (deflated 60%)"

And xpcshell has been running for about an hour in this chroot using 100% cpu doing... Nothing!?

I really don't have any specific experience developing or packaging Firefox beyond building it for Debian Squeeze PowerPC, and I have no more ideas for debugging the error you're encountering. I doubt you're going to get any more help here on Neowin considering how many people have contributed to this thread already. You should probably try asking on the Mozilla forums or asking the Arch Firefox maintainer. If you do find a solution though, I would be interested in knowing how you solved it.

I've got another SCSI drive out and installed arch on it to try again... Something pretty interesting to note is that the current version of arch is NOTHING like what it is on previous installs, for example on all over arch installs on this and my other devices, I've got /dev/eth0 /dev/eth1, on here I've got some random name, /dev/enp7s2 and /dev/enp4s0... Really not sure why.

Anyway, whilst it's compiling, I'm noticing it's passing -O2 AND -O3 for all the files, optimisation level 2 and 3... Firstly I have no idea why it's passing -O3 unless mozilla have it do that because I don't have that set on the system at all, and secondly I thought that broke a lot of things, so now I'm thinking it's breaking the build.

How ironic, it's compiled fine in a new install... I think upgrading arch has borked the whole system, no way should it stop firefox from compiling on 2 entirely different systems... Think I might be moving away from arch, the rolling release system just has way too many bugs and problems for my liking.

Ah well, trying a compile on this system using Clang/LLVM now and will upload AntiSocialFox 19 after it's finished and I go back to the other drive.

Shouldn't compiling Firefox in a clean chroot have produced the same result as compiling it on a clean install? Not to be insulting, but are you sure you setup the chroot properly? I'm not sure whether Arch has a facility like this or not, but I often use pbuilder on Debian to make sure my packages build in a clean environment. I also configured a hook in my pbuilderrc to drop me to a shell prompt in the chroot in the event of a build failure so I can investigate it.

I have also read that -O3 should generally be avoided because the optimizations it makes are potentially unsafe. It can achieve much greater optimization in some cases, but code that works with -O3 on one platform (or compiler) is not guaranteed to work on another. On the other hand, -O2 is generally considered safe.

The chroot compile gets to the point whereby it failed normally, and just sits there frozen with xpcshell running using 100% cpu but doing nothing for over 3 hours so each time I tried it I just ended up killing xpcshell and it failed. Chroot was setup fine. Being honest the problem with the chroot I think is down to either the chroot not emulating something right (like how if you try to compile things for ARM in an ARM chroot on an x86 PC all you end up with is broken binaries they don't run on the real hardware) or a problem with xpcshell or how it runs/is coded (it's some sort of javascript shell apparently).

Yeah I've no idea what was going on with -O3, it's mozilla that put them in though because the -O2 was coming from all my settings and later in the command lines/output you see mozilla mystically putting in -O3, but heck the compiled programs work fine now so all's good :)

Have you tried setting up an ARM chroot on an AMD64 installation? I don't see how that would work since the instruction set is completely different. I can run an i386 chroot on my AMD64 system because the processor and Linux kernel both support support i386 and AMD64 natively. However, I can't run a Debian GNU/kFreeBSD chroot on my Debian GNU/Linux installation even if they both use the AMD64 instruction set because the kernels are binary-incompatible. The same logic applies to ARM: AMD64 Linux is binary-incompatible with ARM Linux.

By the way, did Firefox compile in your new installation with Clang or did you revert to GCC?

Yes it's possible, you use the qemu binary and add it using binfsutils and it will run ARM binaries like they are native.

And nope, got to the same error in clang moaning about that function, I noticed there is an option for configure for adding LLVM hacks to get it to compile, can't remember if I tried it, but from reading up it only seemed to work on macs anyway.

Now I understand how its possible to run an ARM chroot on AMD64, but I submit that using qemu is cheating! You're technically running a chroot, but qemu is translating the ARM instructions into your processor's native instructions, hence "cheating". That said, it sounds a lot like the method implemented by qemubuilder (which builds packages for PowerPC on my 2.4 GHz Core2Quad much faster than I can build them natively on my 1.5 GHz G4 - despite the fact that qemu is wasting cycles doing translation on the former but not the latter). In my experience the packages built with qemubuilder work properly when installed on their target architecture.

There's 2 ways to build packages for different systems, one is using qemu and might work (just had a quick google and there's a bunch of people using qemu to compile MAME and whatnot for the raspberry pi, I was building kernels around 2 months after the RPi got released) but as qemu is an emulator, it's not guaranteed to ever work 100% like for example SNES emulators... The only accurate SNES emulator is bsnes!

The other method is doing a cross-compile using the GCC (or other compiler) tools compiled for your architecture but with all the code translation for the target system and not your processor (binaries are guaranteed to work this way as the compiler/assembler/linker is the same as if you were running it natively on the target system) and you can also do everything GCC can do such as distcc builds for faster compilation.

In terms of qemu you've also got the problem of the actual CPU architecture, e.g. the raspberry pi is an armv6h, h standing for hardware floating point, and from what I remember qemu emulates a generic ARM CPU not a specific type so if for exampleit emulated armv7, you'd be generating instructions that the armv6 isn't able to run. This isn't too much of a problem for other CPUs such as powerpcs or x86 CPUs for example, e.g. x86's got extra instruction sets added such as SSE1, SSE2, AES-on-chip, Intel TXT, etc. but these are not part of the core x86 instruction set (i686) and require special -mtune parameters when these features want to be used using GCC and other compilers.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Good. I hope more people sue them for focusing on this worthless junk.
    • How about fire the guy who approved all the bad decisions? The guy who bought these studios in the first place? Oh wait, Satya is safe with his billions while the workers pay the price.
    • This had nothing to do with games. This is all about management wanting to squeeze as much money from Xbox to keep Microsoft's AI ambitions afloat. Someone has to make money to burn on AI.
    • GeekBook X16 Pro Intel Core Ultra 9 thin and light laptop gets a 17% discount by Steven Parker GEEKOM is back with a 17% discount on its top-of-the-range X16 Pro laptop. You may remember that we reviewed the X14 Pro back in February, which marked GEEKOM's debut into the ultrathin laptop segment. You can view the full specs below. GEEKOM X16 Pro Model NX14CM Dimensions 322.58 × 213.36 × 5.8 mm (12.7"L x 8.4"W x 0.23"T) Weight 997 g / 2.2 lbs Material Unibody Magnesium Alloy CPU Intel Ultra 5 125H (14C/18T, 24MB L3, 2.3-5.1 GHz, TDP 20W) Intel Ultra 9 185H (16C/22T, 24MB L3, 2.3-4.5 GHz, TDP 35W) Graphics Intel Arc graphics 8 Xe-cores @ 2350MHz 1024 shading units/stream processors (128 CUs), 8 Raytracing Cores, 64 texture mapping units, and 32 ROPs NPU Intel AI Boost, 11 TOPS / Up to 33 TOPS (CPU+NPU+GPU) Memory 32GB Dual-channel LPDDR5x 7467 MT/s Micron SODIMM Storage 1 x M.2 2280 PCIe Gen 4x4, Wodposit 1TB, 2 TB Display 16.0" IPS LCD, 2560 × 1600 (16:10) 100% sRGB, 120Hz Refresh Rate Camera 2MP 1080P 1 × Light sensor in camera module 1 × LED indicator in the camera module Windows Hello Support: No Mic 2 x Digital Mics integrated in the camera module Speakers 2 x 3813 (4Ω×2W) built in body Audio Codec: ALC269QN-VC3-GR Certificate: DTS: X Ultra Operating System Windows 11 Pro 25H2 Bluetooth Bluetooth 5.4 Wireless LAN MediaTek MT7922 M.2 Wi-Fi 6E LAN card Left I/O ports 1 x HDMI 2.0 2 x USB4 (40 Gbps) Right I/O ports 1 x USB 3.2 Gen 1 Type-A (5 Gbps) 1 x 3.5 mm Audio jack 1 x Camera Privacy Shutter Keyboard 78Key 1.2±0.2mm / Height 3.5±0.2mm (with backlight) White LED light in Caps Lock and Fn key Language: Default US Touch Pad Dimension: 120 x 71mm Material: Mylar Position: Middle Interface: I2C, Dualpoint button Dock Input port: 1 x Type-C 2 x USB 3.0, 1 x RJ45 1 x PD 1 x HDMI (Bio) Security Fingerprint sensor (in the power button) SD Card slot No Kensington Lock No Battery 77Wh (Input 20V, 3.25A) Power 65W PD GaN Fast Charge, USB-C to USB-C Warranty 2 years (Early Bird 1+1 Years) Deal price $1119.67 The X16 Pro is powered by the Intel Ultra 9 185H, which was released in Q4 2023 and is a 14th Gen Meteor Lake CPU designed for laptop/mobile using the Intel 4 architecture based on a 7nm process. The Ultra 9 185H features 16 cores and 22 threads running at up to 5.1 GHz. It also includes a dedicated NPU utilizing Intel AI Boost at 11 TOPS. On the graphics front, the 185H includes the still fairly capable ARC Graphics (not to be confused with the newer ARC 140T) integrated GPU with a max GPU frequency of 2350 MHz across 8 Xe-cores. It has been said that the iGPU is equivalent to the NVIDIA GeForce 3050 and GTX 1650 in gaming and synthetic benchmarks. Other highlights include an AMOLED display, LPDDR5x memory at 7467 MT/s, WiFi 6E, Bluetooth 5.4, and a fingerprint sensor built into the power button. AI PC? Although the Intel Core Ultra 9 185H includes a dedicated NPU, it's only 11 TOPS; therefore, it does not qualify as a Copilot+ PC. However, it can reach up to 33 TOPS with a combination of NPU, CPU, and GPU. As I said, although we only reviewed the X14 Pro, the unboxing is the same for the X16 Pro, which I noted in my review. The packaging is quite a nice experience. The outer box houses the X16 Pro box with a small compartment that contains the 5-in-1 Dock ($40 value), which appears to be an "Early Bird" inclusion. Upon removing the box cover, the X16 Pro is revealed sitting in a cardboard compartment with two small booklets of documentation. To the left of the X16 Pro are two cardboard compartments containing the 65W charger and Type-C USB cable. What’s In The Box 1 x GEEKOM X16 Pro Ultra-thin Laptop 1 x Type-C to Type-C cable 1.8M 1 x 65W GaN PD Fast Charger 1 x Warranty Card 1 x Thank You Card 1 x User Guide All products sold by GEEKOM receive a 3-year free Warranty from the date you receive the product. If needed, you can RMA or return locally relative to your region (the U.S. has a U.S. warehouse, mainland E.U. has a German warehouse). GEEKOM X16 Pro at GEEKOM U.S. for $1,119.67 was $1,349 (17% off) Use coupon code NWGBX1617 when checking out. This flash deal expires on July 2. Huge Summer Sale As a reminder, yesterday GEEKOM kicked off their Huge Summer Sale, in which there are deep discounts on a range of other GEEKOM products. From June 15 to June 30, the GEEKOM Official Store will be running its Summer Sale, with discounts starting from 15% off across the entire lineup, up to 50%! This is their biggest promotion of the year so far, offering pricing that is even lower than select Prime Day deals. You can check out the discounts at the dedicated Summer Sale landing pages below. GEEKOM U.S. Summer Sale GEEKOM U.K. Summer Sale While the Summer Sale ends on June 30, this deal will remain active until July 2.
    • We are reached to the point that apple looks affordable and better choice than anything else, in what dystopia are we living in....
  • Recent Achievements

    • One Year In
      Console General earned a badge
      One Year In
    • One Year In
      Twozo Technologies earned a badge
      One Year In
    • One Month Later
      Twozo Technologies earned a badge
      One Month Later
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
    • Veteran
      branfont went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      520
    2. 2
      +Edouard
      200
    3. 3
      PsYcHoKiLLa
      110
    4. 4
      Steven P.
      89
    5. 5
      Nick H.
      71
  • Tell a friend

    Love Neowin? Tell a friend!