You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Oracle Solaris 11/11.3 SPARC平台编译ICU 67.1时遭遇链接错误

Hey there, let's tackle that ICU 67.1 link error you're hitting on Oracle Solaris 11.3 SPARC with Developer Studio 12.6. That undefined symbol issue is a common gotcha with Solaris's strict linker, so let's break down what's going wrong and how to fix it.

Root Cause

The error uniset_getUnicode32Instance_67 being undefined boils down to two likely issues:

  • Incorrect link order: Solaris's ld linker processes libraries in the order they're listed. If a library is placed before the object files that reference its symbols, the linker won't resolve those symbols properly. In your command, libicuuc.so comes before the .o files that need its symbols.
  • Potential 32-bit build inconsistencies: Since you specified --with-library-bits=32, there might be a mismatch between the compiler's target architecture and the libraries you're linking against.

Step-by-Step Solutions

Navigate to the tools/makeconv directory and edit the generated Makefile to adjust the link command:

  • Locate the line that builds makeconv (it should match the error command you shared)
  • Move all ICU libraries after the object files, and reorder system libraries to come first. The corrected command should look like this:
    /opt/developerstudio12.6/bin/CC -g -O4 -xlibmil -mt -std=c++11 -o ../../bin/makeconv gencnvex.o genmbcs.o makeconv.o ucnvstat.o -lpthread -lm -mt -L../../lib -licutu -licui18n -licuuc -L../../stubdata -licudata
    
    This ensures the linker sees the object files first, knows which symbols it needs, and then finds them in the libraries that follow.

2. Enforce Strict 32-Bit Build Configuration

Make sure every part of the build targets 32-bit explicitly. Modify your runConfigureICU command to add 32-bit flags:

./runConfigureICU --enable-debug Solaris --with-library-bits=32 --prefix=/scratch/mzishan/icu CFLAGS="-m32" CXXFLAGS="-m32 -std=c++11"

This ensures the compiler generates 32-bit code, and avoids mismatches with 64-bit system libraries.

3. Perform a Clean Rebuild

Partial builds can leave inconsistent artifacts. Wipe the previous build state and start fresh:

gmake clean
rm -rf config.cache config.log
# Run the updated configure command from step 2
./runConfigureICU --enable-debug Solaris --with-library-bits=32 --prefix=/scratch/mzishan/icu CFLAGS="-m32" CXXFLAGS="-m32 -std=c++11"
gmake

4. Tweak Optimization Flags (Optional)

Developer Studio's -O4 optimization can sometimes introduce unexpected symbol resolution issues. Try downgrading to -O2 by adding it to your CXXFLAGS:

./runConfigureICU --enable-debug Solaris --with-library-bits=32 --prefix=/scratch/mzishan/icu CFLAGS="-m32 -O2" CXXFLAGS="-m32 -std=c++11 -O2"

Verification

If the build succeeds, test the makeconv tool to confirm it works:

../../bin/makeconv --version

内容的提问来源于stack exchange,提问作者Mohammed Zishan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 19:32:47