Last Comment Bug 676455 - modutils fails to build with undefined references recent gold or ld --no-add-needed
: modutils fails to build with undefined references recent gold or ld --no-add-...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: mozilla8
Assigned To: Mike Hommey [:glandium]
:
Mentors:
: 676319 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-03 20:42 PDT by Brad Lassey [:blassey] (use needinfo?)
Modified: 2011-08-09 11:48 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (774 bytes, patch)
2011-08-03 20:42 PDT, Brad Lassey [:blassey] (use needinfo?)
mh+mozilla: review-
Details | Diff | Splinter Review
Don't fail to build NSS's modutil on Android (1.41 KB, patch)
2011-08-04 01:34 PDT, Mike Hommey [:glandium]
no flags Details | Diff | Splinter Review
Don't fail to build NSS's modutil on Android (1013 bytes, patch)
2011-08-04 02:03 PDT, Mike Hommey [:glandium]
no flags Details | Diff | Splinter Review
Don't fail to build NSS's modutil on Android (1.17 KB, patch)
2011-08-04 09:16 PDT, Mike Hommey [:glandium]
ted: review+
Details | Diff | Splinter Review

Description Brad Lassey [:blassey] (use needinfo?) 2011-08-03 20:42:34 PDT
Created attachment 550596 [details] [diff] [review]
patch

according to gladium gcc4.6 dropped -lz from its default libs, so you get:

jarfile.c:429: error: undefined reference to 'inflateInit2_'
jarfile.c:441: error: undefined reference to 'inflate'
jarfile.c:448: error: undefined reference to 'inflateEnd'
jarfile.c:342: error: undefined reference to 'inflateInit2_'
jarfile.c:379: error: undefined reference to 'inflate'
jarfile.c:398: error: undefined reference to 'inflateEnd'
Comment 1 Mike Hommey [:glandium] 2011-08-03 23:08:21 PDT
Full analysis is in bug 676319. But since this one has a patch...
Comment 2 Mike Hommey [:glandium] 2011-08-03 23:08:48 PDT
*** Bug 676319 has been marked as a duplicate of this bug. ***
Comment 3 Mike Hommey [:glandium] 2011-08-03 23:22:02 PDT
Comment on attachment 550596 [details] [diff] [review]
patch

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

This actually isn't Android specific, and considering bug 580679 comment 18, -lz is probably not the solution either.
Comment 4 Mike Hommey [:glandium] 2011-08-03 23:37:14 PDT
So this actually is Android specific, because OS_LIBS is cleared to avoid it containing -lpthread, which Android doesn't have. The effect is that it effectively prevents modutil's Makefile to add ZLIB_LIBS in that variable, thus the build failure. We can't add -lz to all link commands in NSS... but there's maybe an easy way out. Is modutil actually used at all? Do we really need to build it for Android, or at all?
Comment 5 Mike Hommey [:glandium] 2011-08-03 23:38:27 PDT
(In reply to comment #4)
> Is modutil actually used at all? Do we really
> need to build it for Android, or at all?

It's apparently only used for nss tests, and I doubt we run them on Android.
Comment 6 Mike Hommey [:glandium] 2011-08-04 01:34:10 PDT
Created attachment 550621 [details] [diff] [review]
Don't fail to build NSS's modutil on Android

This works properly. We don't need the fallback to MOZ_ZLIB_LIBS for MOZ_NATIVE_ZLIB because in that case, with the remaining change from bug 580679 that should land, we would fall on the non USE_SYSTEM_ZLIB="" case, which does put ZLIB_LIBS in EXTRA_LIBS instead of OS_LIBS in nss/cmd/modutil/Makefile.

(And we do build with system zlib on android, anyway)

The real fix would be to get rid of -lpthread on android in the nss build system, and remove the hacks from security/manager, but we all know how long that takes.
Comment 7 Mike Hommey [:glandium] 2011-08-04 02:03:12 PDT
Created attachment 550626 [details] [diff] [review]
Don't fail to build NSS's modutil on Android

When looking how to fix the root problem in nss itself, I saw that we don't actually need to override OS_LIBS to remove -lpthread from it. All we need is to override OS_PTHREAD.
Comment 8 Mike Hommey [:glandium] 2011-08-04 09:16:11 PDT
Created attachment 550714 [details] [diff] [review]
Don't fail to build NSS's modutil on Android

with an update to the comment this time.
Comment 10 :Ehsan Akhgari (away Aug 1-5) 2011-08-09 11:48:35 PDT
http://hg.mozilla.org/mozilla-central/rev/51c305f11c13

Note You need to log in before you can comment on or make changes to this bug.