1 diff -ur icu.org/source/config/mh-aix-gcc icu/source/config/mh-aix-gcc
2 --- icu.org/source/config/mh-aix-gcc 2016-06-15 20:58:17.000000000 +0200
3 +++ icu/source/config/mh-aix-gcc 2017-04-21 21:58:49.731432198 +0200
5 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
6 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
9 -## We need to use the C++ linker, even when linking C programs, since
10 -## our libraries contain C++ code (C++ static init not called)
11 -LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
12 -LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
14 -## Shared library options
15 -LD_SOOPTIONS= -Wl,-bsymbolic
17 -## Commands to make a shared library
18 -SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS)
19 -SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS)
21 -## Compiler switch to embed a runtime search path
24 +## Flags for position independent code
25 +SHAREDLIBCFLAGS = -fPIC
26 +SHAREDLIBCXXFLAGS = -fPIC
27 +SHAREDLIBCPPFLAGS = -DPIC
29 +## Additional flags when building libraries and with threads
30 +THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
33 -## enable the shared lib loader
34 -LDFLAGS += -Wl,-bbigtoc
38 ## These are the library specific LDFLAGS
39 LDFLAGSICUDT=-nodefaultlibs -nostdlib
41 -## We need to delete things prior to linking, or else we'll get
42 -## SEVERE ERROR: output file in use .. on AIX.
43 -## But, shell script version should NOT delete target as we don't
44 -## have $@ in that context. (SH = only shell script, icu-config)
45 -AIX_PREDELETE=rm -f $@ ;
48 ## Environment variable to set a runtime search path
49 LDLIBRARYPATH_ENVVAR = LIBPATH
51 -## Override Versioned target for a shared library.
52 -FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
53 -MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
54 -SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
55 -SHARED_OBJECT_NO_VERSION = $(basename $(SO_TARGET)).$(SOBJ)
57 -# The following is for Makefile.inc's use.
58 -ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
60 -# this one is for icudefs.mk's use
61 -ifeq ($(ENABLE_SHARED),YES)
62 -SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
65 -## Compiler switch to embed a library name. Not present on AIX.
68 -## The type of assembly needed when pkgdata is used for generating shared libraries.
69 -GENCCODE_ASSEMBLY=-a xlc
71 ## Shared object suffix
73 -# without the -brtl option, the library names use .a. AIX is funny that way.
78 ## Non-shared intermediate object suffix
83 -## Build archive from shared object
85 - ln -f $< $(SHARED_OBJECT_NO_VERSION)
86 - $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
87 - rm -f $(SHARED_OBJECT_NO_VERSION)
89 - ln -f $< $(SHARED_OBJECT_NO_VERSION)
90 - $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
91 - rm -f $(SHARED_OBJECT_NO_VERSION)
93 -## Build import list from export list
95 - @echo "Building an import list for $<"
96 - @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
100 %.$(STATIC_O): $(srcdir)/%.c
102 [ -s $@ ] || rm -f $@'
104 ## Versioned libraries rules
105 -%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
106 - $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
107 -%.$(SO): %$(SO_TARGET_VERSION).$(SO)
108 - $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
109 +%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
110 + $(RM) $@ && ln -s ${<F} $@
111 +%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
112 + $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
115 ## BIR - bind with internal references [so app data and icu data doesn't collide]
116 diff -ur icu.org/source/tools/pkgdata/pkgdata.cpp icu/source/tools/pkgdata/pkgdata.cpp
117 --- icu.org/source/tools/pkgdata/pkgdata.cpp 2017-03-21 02:03:49.000000000 +0100
118 +++ icu/source/tools/pkgdata/pkgdata.cpp 2017-04-21 21:58:49.732432195 +0200
121 uprv_strcat(pkgDataFlags[SO_EXT], ".");
122 uprv_strcat(pkgDataFlags[SO_EXT], pkgDataFlags[A_EXT]);
123 -#elif U_PLATFORM == U_PF_OS400 || defined(_AIX)
124 +#elif U_PLATFORM == U_PF_OS400
125 sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s%s%s",
126 libFileNames[LIB_FILE],
128 @@ -1407,15 +1407,6 @@
129 pkgDataFlags[LDICUDTFLAGS],
131 libFileNames[LIB_FILE_CYGWIN_VERSION],
132 -#elif U_PLATFORM == U_PF_AIX
133 - sprintf(cmd, "%s %s%s;%s %s -o %s%s %s %s%s %s %s",
136 - libFileNames[LIB_FILE_VERSION_TMP],
137 - pkgDataFlags[GENLIB],
138 - pkgDataFlags[LDICUDTFLAGS],
140 - libFileNames[LIB_FILE_VERSION_TMP],
142 sprintf(cmd, "%s %s -o %s%s %s %s%s %s %s",
143 pkgDataFlags[GENLIB],