Closed Bug 1198952 Opened 4 years ago Closed 4 years ago

Can't build b2g on linux

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed
b2g-v2.5 --- fixed

People

(Reporter: eeejay, Assigned: glandium)

References

Details

Attachments

(7 files, 2 obsolete files)

Assuming this is related to bug 1172609. It is similar to the mac build failures seen in 1198237, but the patch there does not remedy the issue on linux.

---

    INPUT("../../modules/zlib/src/inftrees.o")
    INPUT("../../modules/zlib/src/trees.o")
    INPUT("../../modules/zlib/src/uncompr.o")
    INPUT("../../modules/zlib/src/zutil.o")
    INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o")

/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol 'vorbis_info_init' in /opt/gecko-dev/objdir-gonk/toolkit/library/../../media/libtremor/lib/tremor_info.o is referenced by DSO /opt/B2G/out/target/product/flame/obj/lib/libstagefright.so
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol 'vorbis_comment_init' in /opt/gecko-dev/objdir-gonk/toolkit/library/../../media/libtremor/lib/tremor_info.o is referenced by DSO /opt/B2G/out/target/product/flame/obj/lib/libstagefright.so
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol 'vorbis_comment_clear' in /opt/gecko-dev/objdir-gonk/toolkit/library/../../media/libtremor/lib/tremor_info.o is referenced by DSO /opt/B2G/out/target/product/flame/obj/lib/libstagefright.so
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol 'vorbis_info_clear' in /opt/gecko-dev/objdir-gonk/toolkit/library/../../media/libtremor/lib/tremor_info.o is referenced by DSO /opt/B2G/out/target/product/flame/obj/lib/libstagefright.so
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol 'oggpack_readinit' in /opt/gecko-dev/objdir-gonk/toolkit/library/../../media/libogg/Unified_c_media_libogg0.o is referenced by DSO /opt/B2G/out/target/product/flame/obj/lib/libstagefright.so
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol 'oggpack_read' in /opt/gecko-dev/objdir-gonk/toolkit/library/../../media/libogg/Unified_c_media_libogg0.o is referenced by DSO /opt/B2G/out/target/product/flame/obj/lib/libstagefright.so
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ../../js/src/libjs_static.a(Unified_cpp_js_src0.o): requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
/opt/B2G/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: read-only segment has dynamic relocations
/opt/gecko-dev/js/src/builtin/Intl.cpp:1649: error: undefined reference to 'udat_close_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1734: error: undefined reference to 'udat_countAvailable_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1734: error: undefined reference to 'udat_getAvailable_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1768: error: undefined reference to 'ucal_open_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1769: error: undefined reference to 'ucal_getType_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1774: error: undefined reference to 'ucal_close_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1783: error: undefined reference to 'ucal_getKeywordValuesForLocale_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1839: error: undefined reference to 'udatpg_open_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1847: error: undefined reference to 'udatpg_getBestPattern_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:539: error: undefined reference to 'udatpg_close_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1858: error: undefined reference to 'udatpg_getBestPattern_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1967: error: undefined reference to 'udat_format_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1972: error: undefined reference to 'udat_format_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1938: error: undefined reference to 'udat_open_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1946: error: undefined reference to 'udat_getCalendar_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:1947: error: undefined reference to 'ucal_setGregorianChange_55'
/opt/gecko-dev/js/src/builtin/Intl.cpp:2025: error: undefined reference to 'udat_close_55'
/opt/gecko-dev/js/src/jsapi.cpp:599: error: undefined reference to 'u_init_55'
/opt/gecko-dev/js/src/jsapi.cpp:6262: error: undefined reference to 'icu_55::TimeZone::recreateDefault()'
/opt/gecko-dev/js/src/jsstr.cpp:941: error: undefined reference to 'unorm_normalize_55'
/opt/gecko-dev/js/src/jsstr.cpp:951: error: undefined reference to 'unorm_normalize_55'
collect2: error: ld returned 1 exit status
make[6]: *** [libxul.so] Error 1
make[5]: *** [toolkit/library/target] Error 2
make[4]: *** [compile] Error 2
make[3]: *** [default] Error 2
make[2]: *** [realbuild] Error 2
make[1]: *** [build] Error 2
make: *** [out/target/product/flame/obj/DATA/gecko_intermediates/gecko] Error 2

real  21m24.478s
user  128m3.784s
sys 12m2.592s

> Build failed! <
Ted, does this look like a regression from bug 1172609?
Flags: needinfo?(tclancy)
Assignee: nobody → tclancy
Flags: needinfo?(tclancy)
Having the same issues here.
Both hub and I use Fedora 22.
After the build failed I went to objdir-gecko and typed |make|

Then back to the toplevel and ./build.sh again.

Then I flashed and it worked.
Hey Eitan. Does Hub's fix work for you?
It's not a fix. it is a 'workaround'.
Right, that's what I meant.

Obviously I have to try to reproduce this and provide a fix. But it would be great if there's a workaround in the meantime. I'm a little swamped right now.
Duplicate of this bug: 1201009
I ran into this problem on Debian 8, while Debian 7 worked correctly.

When I built with -j1, linking libxul.so failed with the error message. Restarting the build finally compiled libicu, so I suspect there could be a problem with the dependencies in Gecko's build system.

Once I get libicu compiled, I don't see the problem again until I delete the object directory.
Thanks for the info, Thomas.

I can't reproduce this problem on Ubuntu, which is odd, because Ubuntu is based on Debian.

I'll attempt to reproduce the problem on Debian.
I'm sorry for the delay on this. I requested a floater laptop so I can install Fedora or Debian, but I haven't received it yet.
I wasn't able to reproduce this using Debian 8. I had other build obstacles (like the Android makefile complaining that it didn't support make 4.0), but nothing that looked like the build problem you're reporting.

I'm going to try again on Fedora 22.
Make sure you run with the proper number of parallel builds (-j). I have '4' cores.
Hi,

Here's a list of Debian packages I had to install for building b2g. :gsvelto built a compatible make, which you can find at [1].

[1] http://people.mozilla.org/~gsvelto/make-3.82-fc21.tar.xz
My build runs with -j4 as well.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #14)
> Created attachment 8661101 [details]
> List of Debian packages for B2G
> 
> Hi,
> 
> Here's a list of Debian packages I had to install for building b2g.

It builds fine on Debian-based distros, apparently. I know to use an older version of make as well.

The issues is Fedora 22. Specifically after the patch from bug 1172609. It looks like an inconsistency between which version of libicu it is built with, and which it tries to link with.
Oh, sorry. Didn't read your comment correctly.
(In reply to Eitan Isaacson [:eeejay] from comment #16)
> (In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #14)
> > Created attachment 8661101 [details]
> > List of Debian packages for B2G
> > 
> > Hi,
> > 
> > Here's a list of Debian packages I had to install for building b2g.
> 
> It builds fine on Debian-based distros, apparently. I know to use an older
> version of make as well.

It used to work on Debian 7; and the old bundled version of libicu used to work on Debian 8 as well. But the new one doesn't build reliably on Debian 8.

> The issues is Fedora 22. Specifically after the patch from bug 1172609. It
> looks like an inconsistency between which version of libicu it is built
> with, and which it tries to link with.

Isn't Gecko's libicu self-contained? IIRC it doesn't depend on a locally installed version of libicu, but I can't say for sure.
Attached file .userconfig
> I wasn't able to reproduce this using Debian 8

Here's my .userconfig. Maybe that's helpful for reproducing the bug.
I successfully built B2G on Fedora 22. The only issue was the Android makefile complaining about my version of make (which I simply worked around by commenting out the version check in the makefile).

I don't know if this issue was fixed by some other patch in the meantime, but I'm going to have to mark this WORKSFORME.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
(And yes, I used -j4.)
I believe 4 core make a -j8. I got hit by it yesterday again.
It has not been fixed. Here's the output of a failed build of emulator-l with today's Gecko repository. The command was

  VERBOSE=1 ./build.sh -j1

It's not even required to build multiple files in parallel.
Assignee: tclancy → nobody
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
I'm having the same problem for rpi.
i'm on Ubuntu 14.04.3 LTS.
i use this command

git branch
* master

VERBOSE=1 ./build.sh -j1

for me the above mentioned workaround is not working
cc'ing the intl/ owners.
I did some debugging of the build process.

Building libicu creates a number of static libraries that are linked into libxul.so.

Step 1 creates the libraries with '.ao' object files, but libxul.so does not link correctly with these libraries. Step 2 and 3 build '.o' files from libicu and adds them to the static libraries. For each source file, there's now a '.ao' and a '.o' object file in the library. According to readelf, both files are the same.

 1) It appears that libxul does not link against .ao files.

 2) According to the libicu Makefiles, it should not build the '.o' files at all. It's configured for building static libraries only. '.o' is only used when building shared libraries. [1][2][3]

[1] https://dxr.mozilla.org/mozilla-central/source/intl/icu/source/i18n/Makefile.in?offset=600#30
[2] https://dxr.mozilla.org/mozilla-central/source/intl/icu/source/i18n/Makefile.in?offset=0#103
[3] https://dxr.mozilla.org/mozilla-central/source/intl/icu/source/i18n/Makefile.in?offset=600#178
This appears to be a problem in the build system or the integration of libicu. cc'ing some build-system and icu devs.
Flags: needinfo?(mh+mozilla)
Flags: needinfo?(jeff.walden)
Flags: needinfo?(gps)
Thomas, did you try using a fresh checkout of the B2G tree, as described here?:

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Preparing_for_your_first_B2G_build
Flags: needinfo?(tzimmermann)
I'm using a fresh checkout of the B2G as described in that link.
The .ao thing is likely a red herring, because we override that when invoking ICU's build system from config/external/icu/Makefile.in
Flags: needinfo?(mh+mozilla)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #23)
> Created attachment 8662225 [details]
> Complete output of a failed build of emulator-l
> 
> It has not been fixed. Here's the output of a failed build of emulator-l
> with today's Gecko repository. The command was
> 
>   VERBOSE=1 ./build.sh -j1
> 
> It's not even required to build multiple files in parallel.

This log is unfortunately useless, no command lines are present for the Gecko build.
Wrong Jeff, but I have nothing to add here as I don't really know the build system bits of our intl stuff, and I don't have much build system knowledge to begin with, so it's not practical for me to investigate this.
Flags: needinfo?(jeff.walden)
(In reply to Ted Clancy [:tedders1] from comment #29)
> Thomas, did you try using a fresh checkout of the B2G tree, as described
> here?:
> 
> https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/
> Preparing_for_your_first_B2G_build

Clean checkouts don't fix this problem.
Flags: needinfo?(tzimmermann)
Hi

(In reply to Mike Hommey [:glandium] from comment #31)
> The .ao thing is likely a red herring, because we override that when
> invoking ICU's build system from config/external/icu/Makefile.in

Oh, sorry. I looked at this file, but must have missed that.

I manually set STATIC_O to 'o' in the config files in [1] and the build completed successfully. Something seems wrong with how the override works. How do I tell make to print all invoked commands?

[1] https://dxr.mozilla.org/mozilla-central/source/intl/icu/source/config
Chandrakanth, your problems are unrelated to the other problems here. Could you open a separate ticket? You'll need to talk to someone who knows more about the raspberry pi platform than I do.
okay, I'll.
Thank you.
Hi Mike, please see my question in comment 35.
Flags: needinfo?(mh+mozilla)
I don't know. Somewhere, the b2g build system adds -s. Remove that.
Flags: needinfo?(mh+mozilla)
This is a total shot in the dark inspired by tdz's fix in comment #35. It works for me. I don't know if this is the right way to go about this. It is still odd that this issue does not plague every distro and setup. I think someone should get to the bottom of why. If this is the solution, it should ultimately be reviewed by a build peer.
Attachment #8666240 - Flags: feedback?(tclancy)
I think perhaps OBJ_SUFFIX is not getting set correctly when gecko is built via the B2G tree.
Comment on attachment 8666240 [details] [diff] [review]
Patch ICU so it builds b2g on linux.

That's what I did locally. I did not yet have time to further investigate.
I filed bug 907890 a long time ago to not build Gecko with `make -s` so build people would have the necessary context from output to debug issues like this. It saddens me that the bug is still open.

Unfortunately, like glandium, I can't tell anything from the logs because necessary details aren't there. Someone should push a try build that doesn't `make -s` so we have something useful to look at. I'd do this, but I don't even know what jobs to trigger since this detail appears to be missing from the bug (I don't know much about B2G automation).

Sorry :/
Flags: needinfo?(gps)
Bug 907890 should probably be resolved fixed; the "showcommands" affordance it added is there and works.  This is the result of running "./build.sh gecko showcommands" after nuking the objdir.  (Because, as noted elsewhere in the bug, the build process will eventually succeed even without the patch.)

Note that this log is the result of using remake 3.82+dbg0.9+dfsg-2 as my make and so may look different than normal.  (Because I am on Ubuntu 15.10 which ships make 4.0 which results in "./config.sh aries" spitting android errors about make 4.0 not being a viable option.)

Also note I had to gzip due to size limits.
Attached file buildlog.txt.gz
Wasn't sure if the log above is with -j1 or not, so I did my own clobber build.
Ted, which version of make do you use? I recently downgraded from make 3.82 to make 3.81 and I haven't the problem since then.
Flags: needinfo?(tclancy)
'...haven't seen...'
This fixes build problems for me. Can we land the patch?
The patch in comment 40 also fixes the problem for me. Who should review this?
Comment on attachment 8666240 [details] [diff] [review]
Patch ICU so it builds b2g on linux.

Long overdue... this fixes builds for me and others. Can we land?
Attachment #8666240 - Flags: feedback?(ted.clancy) → review?(mh+mozilla)
Comment on attachment 8666240 [details] [diff] [review]
Patch ICU so it builds b2g on linux.

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

The core of the problem is a bug in make 3.82 that doesn't happen in either 3.81 or 4.x. It's related to MAKEOVERRIDES losing some of the overrides while recursing with additional overrides *and* make restarting itself because of additional dep files to include.

We should either reject make 3.82 or work around this bug in a better way, because it affects more than just STATIC_O (technically, it also affects GENRBOPTS, although in practice it doesn't matter that much).
Attachment #8666240 - Flags: review?(mh+mozilla) → review-
Assignee: nobody → mh+mozilla
Attachment #8666240 - Attachment is obsolete: true
Attachment #8685220 - Flags: review?(gps)
With a slightly clearer comment.
Attachment #8685220 - Attachment is obsolete: true
Attachment #8685220 - Flags: review?(gps)
Attachment #8685224 - Flags: review?(gps)
Comment on attachment 8685224 [details] [diff] [review]
Work around GNU make 3.82 bug when recursing the ICU build system

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

Good sleuthing in this bug!
Attachment #8685224 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/58611d7d0dcb
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Flags: needinfo?(ted.clancy)
Comment on attachment 8685224 [details] [diff] [review]
Work around GNU make 3.82 bug when recursing the ICU build system

Can't build locally for 2.5 on Make 3.82 without this patch in.
Attachment #8685224 - Flags: approval‑mozilla‑b2g44?
Turns out that this patch needs to be on 44 as well for 2.5 building ( locally ) for Make 3.82.
gps, would you mind rebasing for 44, please?  I'm requesting uplift approval from mahe
Flags: needinfo?(mpotharaju)
Flags: needinfo?(gps)
Comment on attachment 8685224 [details] [diff] [review]
Work around GNU make 3.82 bug when recursing the ICU build system

Looks like it applies cleanly.  Sorry gps.  Mahe, can we get an uplift please?
Flags: needinfo?(gps)
Attachment #8685224 - Flags: approval‑mozilla‑b2g44?
Comment on attachment 8685224 [details] [diff] [review]
Work around GNU make 3.82 bug when recursing the ICU build system

Approved for 2.5 uplift. 

Thanks
Flags: needinfo?(mpotharaju)
Attachment #8685224 - Flags: approval‑mozilla‑b2g44? → approval‑mozilla‑b2g44+
Tomcat, could you uplift to 2.5 which is on gecko 44 : http://hg.mozilla.org/releases/mozilla-b2g44_v2_5/ please?
Flags: needinfo?(cbook)
(In reply to Naoki Hirata :nhirata (please use needinfo instead of cc) from comment #62)
> Tomcat, could you uplift to 2.5 which is on gecko 44 :
> http://hg.mozilla.org/releases/mozilla-b2g44_v2_5/ please?

sure! done !

 https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/d9857364b874

also setting the right flags here :)
Flags: needinfo?(cbook)
You need to log in before you can comment on or make changes to this bug.