aix gcc Duplicate symbol 문제
aix 장비에서 gcc로 poco 라는 오픈소스 프레임워크를 빌드하고 있습니다.
https://github.com/pocoproject/poco
아래 설정으로 빌드하고 있는데
LINKMODE ?= SHARED
SANITIZEFLAGS ?=
CC = ${CROSS_COMPILE}gcc
CXX = ${CROSS_COMPILE}g++
LINK = $(CXX)
LIB = $(CROSS_COMPILE)ar -cr -X32_64
RANLIB = $(CROSS_COMPILE)ranlib
SHLIB = $(CXX) $(LDFLAGS) -shared -Wl,-bexpfull -maix64 -Wl,-bnoquiet -o $@
SHLIBLN = $(POCO_BASE)/build/script/shlibln
STRIP = $(CROSS_COMPILE)strip -X32_64
DEP = $(POCO_BASE)/build/script/makedepend.gcc
SHELL = sh
RM = rm -rf
CP = cp
MKDIR = mkdir -p
LDFLAGS += -Wl,-bbigtoc
SHAREDLIBEXT = .so.$(target_version)
SHAREDLIBLINKEXT = .a
CFLAGS = $(SANITIZEFLAGS) -std=c11 -maix64 -Wl,-b64 -pthread
CFLAGS32 =
CFLAGS64 =
CXXFLAGS = $(SANITIZEFLAGS) -std=c++14 -Wno-sign-compare -maix64 -Wl,-b64 -pthread
CXXFLAGS32 =
CXXFLAGS64 =
LINKFLAGS = $(SANITIZEFLAGS) -maix64 -Wl,-b64
LINKFLAGS32 =
LINKFLAGS64 =
STATICOPT_CC =
STATICOPT_CXX =
STATICOPT_LINK = -static
SHAREDOPT_CC = -fPIC
SHAREDOPT_CXX = -fPIC
SHAREDOPT_LINK =
DEBUGOPT_CC = -g -D_DEBUG
DEBUGOPT_CXX = -g -D_DEBUG
DEBUGOPT_LINK = -g
RELEASEOPT_CC = -O2 -DNDEBUG
RELEASEOPT_CXX = -O2 -DNDEBUG
RELEASEOPT_LINK = -O2
SYSFLAGS = -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D_POCO_HAVE_FD_POLL -D__STDC_FORMAT_MACROS -D_POCO_HAVE_IPv6
SYSLIBS = -lpthread -latomic -ldl -lrt
아무리 빌드 옵션을 바꿔도 아래처럼 에러가 발생합니다.
ld: 0711-224 WARNING: Duplicate symbol: global destructors keyed to 65535_0___dso_handle
ld: 0711-224 WARNING: Duplicate symbol: .global destructors keyed to 65535_0___dso_handle
ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit
ld: 0711-224 WARNING: Duplicate symbol: __dso_handle
ld: 0711-224 WARNING: Duplicate symbol: __init_aix_libgcc_cxa_atexit
ld: 0711-228 WARNING: Duplicate symbols were found while resolving symbols.
The following duplicates were found:
Symbol Source-File(Object) OR Import-File{Shared-object}
------------------------- -------------------------------------------------
global destructors keyed to 65535_0___dso_handle ../../../../gcc-5.5.0/libgcc/config/rs6000/crtcxa.c(/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/5.5.0/ppc64/crtcxa_s.o)
** Duplicate ** {/home/secums/workspace/Prebuild/src/poco-1.12.2-all/lib/AIX/00F6B0674C00/libPocoFoundation.a}
.global destructors keyed to 65535_0___dso_handle ../../../../gcc-5.5.0/libgcc/config/rs6000/crtcxa.c(/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/5.5.0/ppc64/crtcxa_s.o)
** Duplicate ** {/home/secums/workspace/Prebuild/src/poco-1.12.2-all/lib/AIX/00F6B0674C00/libPocoFoundation.a}
.__init_aix_libgcc_cxa_atexit ../../../../gcc-5.5.0/libgcc/config/rs6000/crtcxa.c(/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/5.5.0/ppc64/crtcxa_s.o)
** Duplicate ** {/home/secums/workspace/Prebuild/src/poco-1.12.2-all/lib/AIX/00F6B0674C00/libPocoFoundation.a}
__dso_handle ../../../../gcc-5.5.0/libgcc/config/rs6000/crtcxa.c(/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/5.5.0/ppc64/crtcxa_s.o)
** Duplicate ** {/home/secums/workspace/Prebuild/src/poco-1.12.2-all/lib/AIX/00F6B0674C00/libPocoFoundation.a}
__init_aix_libgcc_cxa_atexit ../../../../gcc-5.5.0/libgcc/config/rs6000/crtcxa.c(/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/5.5.0/ppc64/crtcxa_s.o)
** Duplicate ** {/home/secums/workspace/Prebuild/src/poco-1.12.2-all/lib/AIX/00F6B0674C00/libPocoFoundation.a}
몇주째 삽질 중인데 혹시 해결방법 아시는분이 계실까요?...
libPocoFoundation.a 와 crtcxa
libPocoFoundation.a 와 crtcxa_s.o 에 동일한 이름의 symbol 이 있어서 충돌이 발생하는 것 같은데요.
문제는 그게 빌드 옵션 문제인지 소스 문제인지 모르겠습니다.
우서 소스상에 동일한 symbol로 추정되는 코드는 없습니다..
링크 옵션을 잘 못 줘서 발생하는 문제인지 소스코드가 하자가 있는지를 모르겠네요..
게다가 프레임워크 소스라 그 양이 매우 방대합니다..
쟤들은 문의 해봐도 유닉스는 알아서 하던가 유료 지원을 사라고만 하고..
댓글 달기