Closed Bug 676455 Opened 13 years ago Closed 13 years ago

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

Categories

(Firefox Build System :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla8

People

(Reporter: blassey, Assigned: glandium)

References

Details

Attachments

(2 files, 2 obsolete files)

Attached patch patchSplinter Review
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)
Full analysis is in bug 676319. But since this one has a patch...
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
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-
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
(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.
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: blassey.bugs → mh+mozilla
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)
Attachment #550621 - Attachment is obsolete: true
Attachment #550621 - Flags: review?(khuey)
with an update to the comment this time.
Attachment #550714 - Flags: review?(ted.mielczarek)
Attachment #550626 - Attachment is obsolete: true
Attachment #550626 - Flags: review?(khuey)
Attachment #550714 - Flags: review?(ted.mielczarek) → review+
http://hg.mozilla.org/mozilla-central/rev/51c305f11c13
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: