Ticket #6436 (assigned defect)

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

 

Opened 2 months ago

Last modified 1 month ago

static-only build from svn tag may fail because of library ordering

Reported by: jonathan@... Assigned to: michaelow (accepted)
Priority: major Milestone: 4.2
Component: tools Version: 4.0
Keywords: Cc:
Load: Xref:
Java Version: Operating System: Mac OS X 10.4.11
Project (C/J): ICU4C Weeks: 0.2
Review: srl

Description

On Mac OS X 10.4.11, building release-4-0 from svn export (e.g., in order to customize data) fails when configured with --enable-static --disable-shared, because the genrb and genuca tools fail to link. The make terminates with:

g++ -O2   -o ../../bin/genrb [SNIPPED] -L../../lib -lsicui18n -L../../lib -lsicutu [SNIPPED]   
/usr/bin/ld: Undefined symbols:
_ucal_close_4_0
_ucal_getNow_4_0
_ucal_get_4_0
_ucal_open_4_0
_ucal_setMillis_4_0
collect2: ld returned 1 exit status

This happens because of the order in which the static libs are specified; apparently, -lsicutu MUST precede -lsicui18n in the link command. Exchanging the order of the libraries in the makefiles resolves the issue:

Index: tools/genrb/Makefile.in
===================================================================
--- tools/genrb/Makefile.in     (revision 756)
+++ tools/genrb/Makefile.in     (working copy)
@@ -55,7 +55,7 @@
 CPPFLAGS += -I$(top_builddir)/common
 endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
-LIBS = $(LIBICUI18N) $(LIBICUTOOLUTIL) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
+LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = errmsg.o genrb.o parse.o read.o reslist.o ustr.o rbutil.o \
 wrtjava.o rle.o wrtxml.o prscmnts.o
Index: tools/genuca/Makefile.in
===================================================================
--- tools/genuca/Makefile.in    (revision 756)
+++ tools/genuca/Makefile.in    (working copy)
@@ -30,7 +30,7 @@
 CPPFLAGS += -I$(top_builddir)/common
 endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
-LIBS = $(LIBICUI18N) $(LIBICUTOOLUTIL) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
+LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = genuca.o 
 

I did not have the same problem on Mac OS X 10.5.4, so apparently the behavior varies between different GCC versions.

Attachments

Change History

07/16/08 11:53:32 changed by yoshito

  • owner changed from somebody to michaelow.
  • weeks changed.
  • xref changed.
  • revw changed.

07/18/08 08:32:48 changed by michaelow

  • weeks set to 0.2.
  • milestone changed from UNSCH to 4.2.

07/21/08 09:25:55 changed by hchapman

  • priority changed from assess to major.

08/07/08 13:03:30 changed by michaelow

  • status changed from new to assigned.
  • revw set to srl.

Add/Change #6436 (static-only build from svn tag may fail because of library ordering)




Anti spam check: