Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 681941
Summary: | Unnecessary libicu linkage | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jerry James <loganjerry> |
Component: | icu | Assignee: | Caolan McNamara <caolanm> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | caolanm, denis.arnaud_fedora, jcm |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | icu-4.8.1.1-2.fc17 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-01-31 09:29:51 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 245418 |
Description
Jerry James
2011-03-03 16:42:35 UTC
Sure, cook up a patch. There won't be any updates for Fedora 14 to move icu to a new version, icu upgrades change all the symbol names so would have to rebuild a crazy amount of packages. But good for rawhide, haven't had the time to look at bumping rawhide icu to 4.6 yet. bumping rawhide to 4.6, dropping -lm as well from direct .so link flags done in rawhide (I think, rpmlint doesn't moan anyway) Really? I'm getting exactly the same output from rpmlint on rawhide after building from git head. Are you running rpmlint on the binary RPMs, or on the installed packages? As far as I know, the linkage tests cannot be run on the former. I applied the following patch to the spec file and eliminated all of the warnings about unnecessary links. The -nostdlib flag appears to be necessary to avoid picking up -lm transitively. diff --git a/icu.spec b/icu.spec index 4353f4b..5bb0db3 100644 --- a/icu.spec +++ b/icu.spec @@ -12,7 +12,6 @@ Requires: lib%{name} = %{version}-%{release} Patch1: icu.8198.revert.icu5431.patch Patch2: icu.8320.freeserif.crash.patch -Patch3: icu.rhbz681941.extralinklm.patch %description Tools and utilities for developing with icu. @@ -54,7 +53,6 @@ BuildArch: noarch %setup -q -n %{name} %patch1 -p2 -R -b .icu8198.revert.icu5431.patch %patch2 -p1 -b .icu8320.freeserif.crash.patch -%patch3 -p1 -b .rhbz681941.extralinklm.patch %build cd source @@ -64,6 +62,13 @@ CXXFLAGS='%optflags -fno-strict-aliasing' %configure --with-data-packaging=library --disable-samples #rhbz#225896 sed -i -- "s/-nodefaultlibs -nostdlib//" config/mh-linux +#rhbz#681491 +sed -i 's|^LIBS =.*|LIBS = -L../lib -licuuc -lpthread -lm|' i18n/Makefile +sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -licui18n -lc|' io/Makefie +sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -lc|' layout/Makefile +sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -licule -lc|' layoutex/Makefile +sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../../lib -licutu -licuuc -lc|' tools/ctestfw/Makefile +sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../../lib -licui18n -licuuc -lpthread -lc|' tools/toolutil/Makefile make # %{?_smp_mflags} # -j(X>1) may "break" man pages as of 3.2, b.f.u #2357 make doc The last hunk of this patch also fixes the problem on Fedora 15 with 4.4.2, by the way. I don't know if you want to mess with it at this point, where so many packages depend on libicu, but there's a solution if you want it. "Are you running rpmlint on the binary RPMs, or on the installed packages?" ah, indeed, on the rpms. So shovelled your patch in there instead now, for rawhide. Thank you very much! Hello Jerry, Caolan, I understand how frustrating it can be to have a few extra libraries linked against an application if you are trying to be as minimal as possible, and I understand the intention behind including these sed scripts. However, I have re-opened this bug because the change that has been made to icu to avoid linking in the math library has had an unfortunate consequence of introducing an unrelated FTBFS on ARM. Let me summarize what the breakage was, then offer some advice that I hope will be helpful as you try to find an alternative solution that is less heavyweight than the one that is currently used. A slight digression into GCC atomic functions within libgcc...On ARM systems, "intrinsic" functions like __sync_synchronize are implemented differently from x86. On x86 systems, such calls are replaced at compile time with inline assembly code that performs a data memory barrier. On ARM, the call is to a real function that is implemented within libgcc. The same is true on some other architectures. Beyond that, libgcc provides many useful functions that could be needed in future updates of this package on any architecture. Therefore, it is very important that libgcc is always available, which it is unless gcc is specifically told not to include it during link time :) There are other similar libraries that can be required, making it very difficult to use "nostdlib". The current icu SPEC file intends to tell gcc not to use any of its standard libraries, and then lists those libraries that it should be linking against. While this will prevent unwanted linkage against the math library, it also causes gcc to no longer link against libgcc, and may cause other important libraries to be missed during linkage. As a temporary fix solely for the ARM problem, it is possible to include "-lgcc" during the build of the "io" LIBS in the io/Makefile, but I do not believe that is a long term solution to this bug because a similar issue may cause breakage in the future. In general, I would recommend strongly not to use "nostdlib" or similar, and find an alternative. Please can I request the following one line change in the interim: sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -licui18n -lc|' io/Makefile to this line: sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -licui18n -lc -lgcc|' io/Makefile That will allow icu to build on rawhide for ARM systems, and pass the tests. I would strongly recommend an alternative to the current sed scripts in the longer term, but I am quite sure that you had that in mind anyway. Thanks very much, Jon. I see that change went into rawhide already |