modutils fails to build with undefined references recent gold or ld --no-add-needed

RESOLVED FIXED in mozilla8

Status

()

Core
Build Config
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: blassey, Assigned: glandium)

Tracking

Trunk
mozilla8
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

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'
Attachment #550596 - Flags: review?(khuey)
(Assignee)

Comment 1

6 years ago
Full analysis is in bug 676319. But since this one has a patch...
(Assignee)

Updated

6 years ago
Duplicate of this bug: 676319
(Assignee)

Updated

6 years ago
Assignee: nobody → blassey.bugs
Summary: modutils fails to build with undefined references with gcc 4.6 on android → modutils fails to build with undefined references recent gold or ld --no-add-needed
(Assignee)

Comment 3

6 years ago
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.
Attachment #550596 - Flags: review?(khuey) → review-
(Assignee)

Comment 4

6 years ago
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?
OS: Linux → Android
Hardware: x86_64 → ARM
(Assignee)

Comment 5

6 years ago
(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.
(Assignee)

Comment 6

6 years ago
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.
Attachment #550621 - Flags: review?(khuey)
(Assignee)

Updated

6 years ago
Assignee: blassey.bugs → mh+mozilla
(Assignee)

Comment 7

6 years ago
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.
Attachment #550626 - Flags: review?(khuey)
(Assignee)

Updated

6 years ago
Attachment #550621 - Attachment is obsolete: true
Attachment #550621 - Flags: review?(khuey)
(Assignee)

Comment 8

6 years ago
Created attachment 550714 [details] [diff] [review]
Don't fail to build NSS's modutil on Android

with an update to the comment this time.
Attachment #550714 - Flags: review?(ted.mielczarek)
(Assignee)

Updated

6 years ago
Attachment #550626 - Attachment is obsolete: true
Attachment #550626 - Flags: review?(khuey)
Attachment #550714 - Flags: review?(ted.mielczarek) → review+
(Assignee)

Comment 9

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/51c305f11c13
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/51c305f11c13
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.