I'm having trouble building a XPCOM component using the "dynamic glue"
strategy described in
http://developer.mozilla.org/en/docs/XPCOM_Glue#Using_Frozen_linkage_.28dependent_on_xpcom.dll.29
on the Mac.  It built on Linux and Windows.  The linker dies with
unresolved symbol errors since it can't seem to find
libxpcom_core.dylib, which contains symbols used by libxpcom.dylib,
which I'm linking against.  (But I'm not linking against
libxpcom_core.dylib, nor should I be.)

The source code I'm building from is here:
http://dbaron.org/mozilla/leak-monitor/leak-monitor-0.1rc3.tar.bz2
(I'm just dumping it inside mozilla/extensions/ in a 1.8.0 branch tree
and piggybacking on the Mozilla build process.)

The output of make is:

rm -f libleakmon.dylib
c++  -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align 
-Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor 
-Wno-long-long -nostdinc -nostdinc++ 
-I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3/c++ 
-I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3/c++/ppc-darwin 
-I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3/c++/backward 
-isystem /Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 -isystem 
/Developer/SDKs/MacOSX10.2.8.sdk/usr/include 
-F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks 
-F/Developer/SDKs/MacOSX10.2.8.sdk/Library/Frameworks -fpascal-strings 
-no-cpp-precomp -fno-common -fshort-wchar 
-I/Developer/SDKs/MacOSX10.2.8.sdk/Developer/Headers/FlatCarbon -pipe  -DNDEBUG 
-DTRIMMED -O2 -fPIC  -o libleakmon.dylib  leakmonModule.o leakmonReport.o 
leakmonService.o leakmonJSObjectInfo.o nsVoidArray.o      -Wl,-dead_strip 
../../../dist/lib/libxpcomglue_s.a -L../../../dist/bin  -lxpcom 
-L../../../dist/bin -lmozjs -L../../../dist/lib -lplds4 -lplc4 -lnspr4 
-L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin 
-L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 
-L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib  -Wl,-exported_symbols_list 
-Wl,/builds/dbaron/1.8.0/mozilla/build/unix/gnu-ld-scripts/components-export-list
 -bundle -lm -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin 
-L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 
-L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib    
ld: warning -prebind has no effect with -bundle
ld: warning can't open dynamic library: @executable_path/libxpcom_core.dylib 
(checking for undefined symbols may be affected) (No such file or directory, 
errno = 2)
ld: Undefined symbols:
_NS_Alloc_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringCloneData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringContainerFinish_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringContainerInit2_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringContainerInit_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringCopy_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringGetData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringGetMutableData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringSetDataRange_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringSetData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_CStringToUTF16_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_Free_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_GetComponentManager_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_GetComponentRegistrar_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_GetDebug_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_GetMemoryManager_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_GetServiceManager_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_GetTraceRefcnt_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_InitXPCOM2_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_InitXPCOM3_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_NewLocalFile_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_NewNativeLocalFile_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_Realloc_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_RegisterXPCOMExitRoutine_P referenced from libxpcom expected to be defined 
in @executable_path/libxpcom_core.dylib
_NS_ShutdownXPCOM_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringCloneData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringContainerFinish_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringContainerInit2_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringContainerInit_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringCopy_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringGetData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringGetMutableData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringSetDataRange_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_StringSetData_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_UTF16ToCString_P referenced from libxpcom expected to be defined in 
@executable_path/libxpcom_core.dylib
_NS_UnregisterXPCOMExitRoutine_P referenced from libxpcom expected to be 
defined in @executable_path/libxpcom_core.dylib
make: *** [libleakmon.dylib] Error 1

Any ideas?

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Attachment: pgpvA3ncvLXnb.pgp
Description: PGP signature

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to