Subject: [alpine-devel] can't build xulrunner-22.0

From: Dubiousjim <[email-masked]>
Date: Wed, 17 Jul 2013 18:39:14 -0400

I'm trying to version bump xulrunner to 22.0. One of the patches from
21.0 fails to apply and needs this fix:

diff --git a/main/xulrunner/ns_min.patch b/main/xulrunner/ns_min.patch
index 826a18b..05a7c1b 100644
--- a/main/xulrunner/ns_min.patch
+++ b/main/xulrunner/ns_min.patch
@@ -4,8 +4,8 @@
                      rv = stream->Tell(&avail);
                      NS_ENSURE_SUCCESS(rv, rv);
  
--                    int64_t newPos = streamPos + XPCOM_MIN(avail, std::abs(remaining));
-+                    int64_t newPos = streamPos + XPCOM_MIN(avail, (int64_t)std::abs(remaining));
+-                    int64_t newPos = streamPos + XPCOM_MIN(avail, DeprecatedAbs(remaining));
++                    int64_t newPos = streamPos + XPCOM_MIN(avail, (int64_t)DeprecatedAbs(remaining));
  
                      rv = stream->Seek(NS_SEEK_END, -newPos);
                      NS_ENSURE_SUCCESS(rv, rv);

if indeed any such patch is still needed, which I haven't checked. Anyway, I assume the typecast the patch introduces does no harm.

But xulrunner still fails to build, because at one point it's looking to include <stab.h>, which isn't anywhere on my machine:

c++ -o stabs_reader.o -c -I../../../../../dist/stl_wrappers -I../../../../../dist/system_wrappers -include /home/repos/aports/main/xulrunner/src/mozilla-release/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -I/home/repos/aports/main/xulrunner/src/mozilla-release/toolkit/crashreporter/google-breakpad/src/common/.. -I../../../../../dist/include  -fPIC -Os -fomit-frame-pointer -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wcast-align -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe -DHAVE_A_OUT_H  -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer  -Os -fomit-frame-pointer -DMOZILLA_CLIENT -include ../../../../../mozilla-config.h -MD -MF .deps/stabs_reader.o.pp  /home/repos/aports/main/xulrunner/src/mozilla-release/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
/home/repos/aports/main/xulrunner/src/mozilla-release/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc:37:18: fatal error: stab.h: No such file or directory
 #include <stab.h>
                  ^
compilation terminated.
make[6]: *** [stabs_reader.o] Error 1

There is one such file in the xulrunner/firefox sources, at:

src/mozilla-release/toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h

but I'm not going to assume that this "android" file is also appropriate for my arch (x86) unless I get specific instructions saying so.

Perhaps the fix is that we need to add some new makedepends to xulrunner, but I haven't yet figured out what it is. I'll keep looking into it, but thought I'd send this query to see if others might have better ideas than I do yet.

-- 
Dubiousjim
[email-masked]

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 18 Jul 2013 09:33:16 +0200

On Wed, 17 Jul 2013 18:39:14 -0400

> +++ b/main/xulrunner/ns_min.patch

I think it has been fixed upstream so the patch should not be needed anymore.

> make[6]: *** [stabs_reader.o] Error 1

Thats as far I came too. Didn't have time to find a fix.
 
> Perhaps the fix is that we need to add some new makedepends to xulrunner, but I haven't yet figured out what it is. I'll keep looking into it, but thought I'd send this query to see if others might…

A wild guess, the build scripts finds out that oh its not GNU libc, but
its linux, then it must be android, and assumes it needs stab.h. other
parts that should pull in the include find out that oh, this is not
android so the stab.h is not pulled in. or something in that
direction...

Most likely it can be fixed in some place
from:
#if defined(__ANDROID__)

to:
#if defined(__ANDROID__) || defined(__UCLIBC__)

or similar.

(firefox devs is more and more doing if <platform> then..., rather than
the if HAVE_SPECIFIC_FEATURE. The previouly mentioned ffi issue is a
good example of that. Rather than try detect the exact /libc/libc.so.*
name they had a static list of known supported libc.so's. oh well...)

-nc

---