Hi,
As suggested in the title, I got a linking issue.
Context : build OpenOffice.org on Tiger PowerPC (10.4.10 ), with 10.3 as target. No problem building OpenOffice.org with usual method ( only Tiger targeted), for both Aqua and X11 version. XCode version is 2.4.1 Milestone m233 ( no build issue known on Mac OS X )
Reading the sal error log (see below) , the issue seems to be caused by libstlport ( OpenOfffice.org builds it's own patched version). And the point is : * _sinl is not found *.
FYI, OpenOffice.org source tree counts ~150 modules, built in some order, respecting a dependency scheme ( works fine, no issue this side).
The building environment is mostly defined in the module called solenv, and I did the following changes :
Index: solenv/inc/unxmacxp.mk =================================================================== RCS file: /cvs/tools/solenv/inc/unxmacxp.mk,v retrieving revision 1.58 diff -u -r1.58 unxmacxp.mk --- solenv/inc/unxmacxp.mk 8 Mar 2006 14:13:29 -0000 1.58 +++ solenv/inc/unxmacxp.mk 29 Oct 2007 18:36:18 -0000 @@ -43,3 +43,17 @@ # Include generic Mac OS X makefile .INCLUDE : unxmacx.mk + +# be Panther compatible +MACOSX_TARGET= -DMACOSX_DEPLOYMENT_TARGET=10.3 + +# use Panther compatibility SDK +DEPLOYMENT_SDK=/Developer/SDKs/MacOSX10.3.9.sdk + +SDK_CFLAGS+= $(MACOSX_TARGET) -isysroot $(DEPLOYMENT_SDK) +SDK_LDFLAGS+= $(MACOSX_TARGET) -Wl,-syslibroot,$(DEPLOYMENT_SDK) + +CFLAGSCC+=$(SDK_CFLAGS) +CFLAGSCXX+=$(SDK_CFLAGS) + +LINKFLAGS+=$(SDK_LDFLAGS)
(other variables for the environment ..etc )
OpenOffice.org is a framework : once the environment correctly defined, we first build the basics (most low level tools). Then once they are built, some dependencies are satisfied, and other modules are built, and so on, until the end, building sc, sw sd ..and packaging.
The breakage described in this mail does concern an early part (system abstraction layer, aka "sal"), and that leads me to believe something basic is certainly wrong.
But what ?
The stderr building sal :
aking: ../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3 g++ -Wl,-multiply_defined,suppress -Wl -lobjc -DMACOSX_DEPLOYMENT_TARGET=10.3 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk -Wl,-exported_symbols_list ../unxmacxp.pro/misc/gcc3_uno_salhelpergcc3.map -dynamiclib -single_module -install_name @executable_path/libuno_salhelpergcc3.dylib.3 -L../unxmacxp.pro/lib -L/Volumes/extension1/SRC680_m233/solver/680/unxmacxp.pro/lib -L/usr/lib -o ../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3 -dylib_file @executable_path/libuno_sal.dylib:/Volumes/extension1/SRC680_m233/solver/680/unxmacxp.pro/lib/libuno_sal.dylib -luno_sal -lpthread -lstdc++ -lm -lstlport_gcc -filelist ../unxmacxp.pro/misc/libuno_salhelpergcc3.dylib.list Making: ../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3.jnilib macosx-create-bundle: ../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3.jnilib successfully created /Volumes/extension1/SRC680_m233/solenv/bin/checkdll.sh -L../unxmacxp.pro/lib -L/Volumes/extension1/SRC680_m233/solver/680/unxmacxp.pro/lib -L/usr/lib ../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3 Checking DLL ../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3 ...: ERROR: dlopen(../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3, 2): Symbol not found: _sinl Referenced from: /Volumes/extension1/SRC680_m233/solver/680/unxmacxp.pro/lib/libstlport_gcc.dylib Expected in: /usr/lib/libstdc++.6.dylib
dmake: Error code 1, while making '../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3' dmake: '../unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3' removed.
To go further, I did some changes in stlport makefile. e.g. building main.o, we can see the correct SDK is used :
g++ -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -DBUILD_OS_APPLEOSX -DBUILD_OS_MAJOR=10 -DBUILD_OS_MINOR=4 -DBUILD_OS_REV=10 -DQUARTZ -I../stlport -DGXX_INCLUDE_PATH=/usr/include/c++/4.0.0 -D_REENTRANT -D_PTHREADS -ftemplate-depth-32 -malign-natural -no-cpp-precomp -fexceptions -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -Wno-long-double -O2 -fPIC dll_main.cpp -c -o ../lib/obj/GCC/ReleaseD/dll_main.o
The diff (to be sure my changes are ok) gives :
Index: stlport/STLport-4.5-macxp-panther.patch =================================================================== RCS file: /cvs/external/stlport/STLport-4.5-macxp-panther.patch,v retrieving revision 1.11 diff -u -r1.11 STLport-4.5-macxp-panther.patch --- stlport/STLport-4.5-macxp-panther.patch 18 Jun 2007 16:34:54 -0000 1.11 +++ stlport/STLport-4.5-macxp-panther.patch 29 Oct 2007 18:33:08 -0000 @@ -106,7 +106,7 @@ ! LINK=libtool -static -o ! DYN_LINK=g++ -o ! -! LDFLAGS_COMMON_dynamic= -dynamiclib -single_module +! LDFLAGS_COMMON_dynamic= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk -dynamiclib -single_module ! ! LDFLAGS_RELEASE_dynamic= $(LDFLAGS_COMMON_dynamic) -install_name @executable_path/libstlport_gcc.dylib ! LDFLAGS_DEBUG_dynamic= $(LDFLAGS_COMMON_dynamic) -install_name @executable_path/libstlport_gcc.dylib @@ -127,7 +127,7 @@ ! ! WARNING_FLAGS= -Wall -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -Wno-long-double ! -! CXXFLAGS_COMMON = ${ENVCDEFS} -I${STLPORT_DIR} -DGXX_INCLUDE_PATH=${GXX_INCLUDE_PATH} -D_REENTRANT -D_PTHREADS -ftemplate-depth-32 -malign-natural -no-cpp-precomp -fexceptions ${WARNING_FLAGS} ${ARCH_FLAGS} +! CXXFLAGS_COMMON = -isysroot /Developer/SDKs/MacOSX10.3.9.sdk ${ENVCDEFS} -I${STLPORT_DIR} -DGXX_INCLUDE_PATH=${GXX_INCLUDE_PATH} -D_REENTRANT -D_PTHREADS -ftemplate-depth-32 -malign-natural -no-cpp-precomp -fexceptions ${WARNING_FLAGS} ${ARCH_FLAGS} ! ! CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2 -fPIC ! CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
To add more informations, I have attached the linking part. I'm prtetty sure soemthing is maybe wrong here :
libtool -static -o ../lib/libstlport_gcc_stldebug.a ../lib/obj/GCC/DebugSTL/dll_main.o ../lib/obj/GCC/DebugSTL/fstream.o ../lib/obj/GCC/DebugSTL/strstream.o ../lib/obj/GCC/DebugSTL/sstream.o ../lib/obj/GCC/DebugSTL/ios.o ../lib/obj/GCC/DebugSTL/streambuf.o ../lib/obj/GCC/DebugSTL/stdio_streambuf.o ../lib/obj/GCC/DebugSTL/istream.o ../lib/obj/GCC/DebugSTL/ostream.o ../lib/obj/GCC/DebugSTL/iostream.o ../lib/obj/GCC/DebugSTL/codecvt.o ../lib/obj/GCC/DebugSTL/collate.o ../lib/obj/GCC/DebugSTL/ctype.o ../lib/obj/GCC/DebugSTL/monetary.o ../lib/obj/GCC/DebugSTL/num_get.o ../lib/obj/GCC/DebugSTL/num_put.o ../lib/obj/GCC/DebugSTL/num_get_float.o ../lib/obj/GCC/DebugSTL/num_put_float.o ../lib/obj/GCC/DebugSTL/numpunct.o ../lib/obj/GCC/DebugSTL/time_facets.o ../lib/obj/GCC/DebugSTL/messages.o ../lib/obj/GCC/DebugSTL/locale_impl.o ../lib/obj/GCC/DebugSTL/locale.o ../lib/obj/GCC/DebugSTL/locale_catalog.o ../lib/obj/GCC/DebugSTL/facets_byname.o ../lib/obj/GCC/DebugSTL/c_locale.o ../lib/obj/GCC/DebugSTL/c_locale_stub.o ../lib/obj/GCC/DebugSTL/complex.o ../lib/obj/GCC/DebugSTL/complex_exp.o ../lib/obj/GCC/DebugSTL/complex_io.o ../lib/obj/GCC/DebugSTL/complex_trig.o ../lib/obj/GCC/DebugSTL/complex_io_w.o ../lib/obj/GCC/DebugSTL/string_w.o rm -fr ../lib/libstlport_gcc.dylib rm -fr ../lib/libstlport_gcc_stldebug.dylib ln -s libstlport_gcc.dylib.4.5 ../lib/libstlport_gcc.dylib ln -s libstlport_gcc_stldebug.dylib.4.5 ../lib/libstlport_gcc_stldebug.dylib touch ./unxmacxp.pro/misc/build/so_installed_so_stlport cp -f ./unxmacxp.pro/misc/build/STLport-4.5/lib/lib* ./unxmacxp.pro/lib cp -f -r ./unxmacxp.pro/misc/build/STLport-4.5/stlport ./unxmacxp.pro/inc touch ./unxmacxp.pro/misc/build/so_predeliver_so_stlport
Note: all compilation products are "delivered" (i.e. copied) in the "solver, who does contain everything to be used at packaging time.
I hope I have provided all important informations. Don't hesitate to ask me if something is missing, I'll try to answer asap.
Last but not least, I'm using Mac OS X 10.4.10, and I found 2 libstdc++ in /usr/lib: 6.0.3 and 6.0.4 .
A symlink libstdc++.dylib points to 6.0.4, and 6.0.3 stands as it, and can be used only if called explicitely.
One does include the missing symbol, while the other not. Maybe this is useless, but I don't know. Shouldn't it be the libstdc++ from /Developer/SDKs/MacOSX10.3.9.sdk used instead ?
Thanks in advance for any information or help :)
Eric Bachard |