Ticket #5985 (closed defect: fixed)

Bug contains 1 commit(s) | SVN Diffs for #5985

 

Opened 1 year ago

Last modified 1 year ago

Incomplete building shared/archive libs on aix (5.3) with gcc except for data/

Reported by: mhaubi@... Assigned to: grhoten
Priority: trivial Milestone: 3.8.1
Component: config_build Version: 3.8
Keywords: Cc:
Load: Xref: 4738
Java Version: Operating System: aix5.3
Project (C/J): ICU4C Weeks: 0.2
Review: emmons

Description (Last modified by grhoten)

When building on aix (5.3) with gcc (don't know for xlc) there is an inconsistency in building aix-sharelibs between data/ and others, mainly stubdata/, causing this build error:

LIBPATH=../../lib:../../stubdata:../../tools/ctestfw:$LIBPATH  ../../bin/genrb -e UTF-8 -s /source/icu/source/extra/uconv/resources -d uconvmsg root.txt
Could not load program ../../bin/genrb:
Could not load module ../lib/libicuuc38.a.
        Dependent module ../../lib/libicudata38.a could not be loaded.
        The module has an invalid magic number.
Could not load module genrb.
        Dependent module ../lib/libicuuc38.a could not be loaded.
Could not load module .
                gmake[2]: *** [uconvmsg/root.res] Error 255
                gmake[2]: Leaving directory `/build/extra/uconv'
                gmake[1]: *** [all-recursive] Error 2
                gmake[1]: Leaving directory `/build/extra'
                gmake: *** [all-recursive] Error 2

Some analysis: When building genrb, data/ is not built yet, and genrb is linked against stubdata/libicudata38.a For genrb execution, LIBPATH is set to find lib/libicudata38.a if available, instead of stubdata/libicudata38.a

But lib/libicudata38.a is built differently than stubdata/libicudata38.a:

lib/libicudata38.a is an ar-archive:
$ file lib/libicudata38.a
lib/libicudata38.a: archive (big format)
$ ar tv lib/libicudata38.a
rwxrwxrwx   854/1999  11176712 Oct  9 17:02 2007 libicudata38.0.a

$ file stubdata/libicudata38.a
stubdata/libicudata38.a: executable (RISC System/6000) or object module not stripped

Now looking at the build commands for stubdata/libicudata38.a:

$ rm stubdata/libicudata*
$ gmake --no-print-directory
gmake[0]: Making `all' in `stubdata'
rm -f libicudata38.0.a ;  gcc -g -O2   -Wl,-bbigtoc -nodefaultlibs -nostdlib -shared -Wl,-bexpall  -o libicudata38.0.a stubdata.o 
rm -f libicudata38.a && ln -s libicudata38.0.a libicudata38.a
rm -f libicudata.a && ln -s libicudata38.0.a libicudata.a
gmake[0]: Making `all' in `common'
<snip>

And for lib/libicudata38.a:

$ rm lib/libicudata*
$ gmake --no-print-directory
<snip>
gmake[0]: Making `all' in `data'
LIBPATH=../stubdata:../lib:../tools/ctestfw:$LIBPATH  MAKEFLAGS= ../bin/pkgdata -O ../data/icupkg.inc -q -c -s /build/data/out/build/icudt38b -d ../lib -M'PKGDATA_LDFLAGS="-nodefaultlibs -nostdlib"' -e icudt38 -T ./out/tmp -p icudt38b -m dll -r 38.0 -L icudata ./out/tmp/icudata.lst
gmake[2]: Entering directory `/build/data'
rm -f ../lib/libicudata38.0.a ;  gcc -g -O2  -nodefaultlibs -nostdlib -shared -Wl,-bexpall -o libicudata38.0.a ./out/tmp/icudt38b_dat.o   -Wl,-bE:icudt38b.map,-bnoexpall
/bin/ar r ../lib/libicudata38.0.a libicudata38.0.a
ar: creating an archive file ../lib/libicudata38.0.a
/bin/ar vt ../lib/libicudata38.0.a
rwxrwxrwx   854/1999  11176712 Oct  9 17:21 2007 libicudata38.0.a
rm -f ../lib/libicudata38.a && ln -s libicudata38.0.a ../lib/libicudata38.a
rm -f ../lib/libicudata.a && ln -s libicudata38.0.a ../lib/libicudata.a
gmake[2]: Leaving directory `/build/data'
gmake[0]: Making `all' in `io'

So stubdata/libicudata38.a directly is the shared object, while lib/libicudata38.a is an archive containing the shared object.

Each lib/libicu*.a besides lib/libicudata*.a is the shared object directly, not an archive containing the shared object:

$ file lib/libicu*38.0.a
lib/libicudata38.0.a: archive (big format)
lib/libicui18n38.0.a: executable (RISC System/6000) or object module not stripped
lib/libicuio38.0.a: executable (RISC System/6000) or object module not stripped
lib/libicule38.0.a: executable (RISC System/6000) or object module not stripped
lib/libiculx38.0.a: executable (RISC System/6000) or object module not stripped
lib/libicutu38.0.a: executable (RISC System/6000) or object module not stripped
lib/libicuuc38.0.a: executable (RISC System/6000) or object module not stripped

Seems that ticket 4738 also applies to each library except in data/ ?

When using "LDFLAGS=-Wl,-brtl", having lib*.a as shared objects works, so only the different build methods for data/ and stubdata/ remains as problem, as they produce libraries with identical names.

Attachments

Change History

10/09/07 09:33:54 changed by grhoten

  • xref changed.
  • description changed.
  • summary changed from incomplete building shared/archive libs on aix (5.3) with gcc except for data/ to Incomplete building shared/archive libs on aix (5.3) with gcc except for data/.
  • priority changed from major to trivial.
  • owner changed from somebody to emmons.
  • weeks set to 0.2.
  • revw changed.

ICU on AIX normally builds with the Visual Age compiler. The gcc compiler is almost never tested on AIX.

As a work around, you should use the Visual Age compiler instead, which is ICU's reference platform. The Visual Age compiler is known to work. Using -Wl,-brtl is not a good option because it's not the default behavior of AIX shared libraries, and it causes performance problems.

Ticket #4738 is probably the reason why shared libraries are correctly built with the Visual Age compiler but not the gcc compiler.

10/09/07 09:34:15 changed by grhoten

  • xref set to 4738.

12/12/07 09:28:46 changed by grhoten

  • owner changed from emmons to grhoten.
  • revw set to emmons.
  • milestone changed from UNSCH to 3.8.1.

01/04/08 12:10:53 changed by emmons

  • status changed from new to closed.
  • resolution set to fixed.

Add/Change #5985 (Incomplete building shared/archive libs on aix (5.3) with gcc except for data/)




Anti spam check: