ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

ACE build with iconv fails in Linux

Open gadh opened this issue 4 years ago • 2 comments

Version

6.5.5

Host machine and operating system

intel x86_64 cpu, Linux x64, CentOS 7.5

Target machine and operating system (if different from host)

same

Compiler name and version (including patch level)

g++ 4.8.2 (native)

The $ACE_ROOT/ace/config.h file

#include "ace/config-linux.h" 
#define ACE_HAS_STANDARD_CPP_LIBRARY   1
#define ACE_HAS_WCHAR
#define ACE_USES_WCHAR

#define ACE_HAS_ICONV

The $ACE_ROOT/include/makeinclude/platform_macros.GNU file

include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

The problem effects:

when using iconv in linux + ACE

Synopsis

ACE examples build with iconv fails in Linux

Description

when compiling ACE+ACEXML with these config/platform files, ACEXML examples fail to link :

make[1]: Entering directory `/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/apps/JAWS2/JAWS'

GNUmakefile: /root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/apps/JAWS2/JAWS/GNUmakefile.JAWS2 MAKEFLAGS=w --jobserver-fds=4,5 -j

g++ -fvisibility=hidden -fvisibility-inlines-hidden -Wnon-virtual-dtor -O3 -ggdb -pthread -fno-strict-aliasing -Wall -W -Wpointer-arith -pipe -D_GNU_SOURCE   -I/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers -D__ACE_INLINE__ -I../../.. -I.. -DJAWS_BUILD_DLL  -c -fPIC -o .shobj/Assoc_Array.o /root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/apps/JAWS2/JAWS/Assoc_Array.cpp
g++ -fvisibility=hidden -fvisibility-inlines-hidden -Wnon-virtual-dtor -O3 -ggdb -pthread -fno-strict-aliasing -Wall -W -Wpointer-arith -pipe -D_GNU_SOURCE   -I/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers -D__ACE_INLINE__ -I../../.. -DACE_BUILD_SVC_DLL  -c -fPIC -o .shobj/HTTP_Request.o /root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/apps/JAWS/server/HTTP_Request.cpp
g++ -fvisibility=hidden -fvisibility-inlines-hidden -Wnon-virtual-dtor -O3 -ggdb -pthread -fno-strict-aliasing -Wall -W -Wpointer-arith -pipe -D_GNU_SOURCE   -I/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers -D__ACE_INLINE__ -I../../.. -I.. -DJAWS_BUILD_DLL  -c -fPIC -o .shobj/Cache_Manager.o /root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/apps/JAWS2/JAWS/Cache_Manager.cpp
g++ -fvisibility=hidden -fvisibility-inlines-hidden -Wnon-virtual-dtor -O3 -ggdb -pthread -fno-strict-aliasing -Wall -W -Wpointer-arith -pipe -D_GNU_SOURCE   -I/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers -D__ACE_INLINE__ -I../../../..  -Wl,-E -L/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/lib -L.  -L../../../../lib            -o blobby .obj/Blob.o .obj/Blob_Handler.o .obj/Options.o .obj/blobby.o -lACE -ldl -lrt
.obj/Blob.o: In function `ACE_Blob::open(wchar_t const*, wchar_t const*, unsigned short)':
/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/ace/ace_wchar.inl:95: undefined reference to `ACE_Wide_To_Ascii::ACE_Wide_To_Ascii_iconv_env'
/root/git/Externals/ACE/6.5.5/linux/ACE_wrappers/ace/ace_wchar.inl:97: undefined reference to `ACE_Wide_To_Ascii::ACE_Wide_To_Ascii_iconv_env'

i tried to add in platform_macros.GNU this - no_hidden_visibility = 1 (the cause is the hidden symbols) but it did not help

Sample fix/ workaround

add to platform_macros.GNU this:

CCFLAGS:=$(filter-out -fvisibility=hidden,$(CCFLAGS))
CCFLAGS:=$(filter-out -fvisibility-inlines-hidden,$(CCFLAGS))

(hard removing the default visibiliy settings)

gadh avatar Oct 30 '19 14:10 gadh

Try to add a ACE_Export to the ACE_Wide_To_Ascii class as we do for other classes in ACE.

jwillemsen avatar Oct 30 '19 15:10 jwillemsen

When this works please open a pull request with the necessary changes

jwillemsen avatar Oct 31 '19 18:10 jwillemsen