Apache OpenOffice (AOO) Bugzilla – Issue 39927
patch for necessary main function in padmin Mac OSX SRC680
Last modified: 2005-04-10 20:56:09 UTC
padmin patch Necessary / build stopper Error message : Making: ../unxmacxp.pro/bin/spadmin.bin unx gcc -Wl,-multiply_defined,suppress -bind_at_load -L../unxmacxp.pro/lib -L/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib -L/usr/lib -L/usr/X11R6/lib -o ../unxmacxp.pro/bin/spadmin.bin -dylib_file @executable_path/libspa680mxp.dylib:../unxmacxp.pro/lib/libspa680mxp.dylib -dylib_file @executable_path/libvcl680mxp.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libvcl680mxp.dylib -dylib_file @executable_path/libsot680mxp.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libsot680mxp.dylib -dylib_file @executable_path/libtl680mxp.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libtl680mxp.dylib -dylib_file @executable_path/libucbhelper3gcc3.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libucbhelper3gcc3.dylib -dylib_file @executable_path/libuno_cppuhelpergcc3.dylib.3:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libuno_cppuhelpergcc3.dylib.3 -dylib_file @executable_path/libuno_sal.dylib.3:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libuno_sal.dylib.3 -dylib_file @executable_path/libstlport_gcc.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libstlport_gcc.dylib -dylib_file @executable_path/libuno_cppu.dylib.3:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libuno_cppu.dylib.3 -dylib_file @executable_path/libuno_salhelpergcc3.dylib.3:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libuno_salhelpergcc3.dylib.3 -dylib_file @executable_path/libvos3gcc3.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libvos3gcc3.dylib -dylib_file @executable_path/libbasegfx680mxp.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libbasegfx680mxp.dylib -dylib_file @executable_path/libutl680mxp.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libutl680mxp.dylib -dylib_file @executable_path/libcomphelp4gcc3.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libcomphelp4gcc3.dylib -dylib_file @executable_path/libicuuc.dylib.26:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libicuuc.dylib.26 -dylib_file @executable_path/libicudata.dylib.26:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libicudata.dylib.26 -dylib_file @executable_path/libicule.dylib.26:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libicule.dylib.26 -dylib_file @executable_path/libjvmaccessgcc3.dylib.3:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libjvmaccessgcc3.dylib.3 -dylib_file @executable_path/libpsp680mxp.dylib:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libpsp680mxp.dylib -dylib_file @executable_path/libjvmfwk.dylib.3:/Users/ericb/Desktop/OpenOffice.org680/solver/680/unxmacxp.pro/lib/libjvmfwk.dylib.3 -lspa680mxp -lvcl680mxp -ltl680mxp -lucbhelper3gcc3 -lcomphelp4gcc3 -luno_cppuhelpergcc3 -luno_cppu -luno_sal -lXext -lX11 -lpthread -lm -lstlport_gcc -lstdc++ -filelist ../unxmacxp.pro/misc/spadmin.list ld: Undefined symbols: _main dmake: Error code 1, while making '../unxmacxp.pro/bin/spadmin.bin' '---* tg_merge.mk *---' ERROR: Error 65280 occurred while making /Users/ericb/Desktop/OpenOffice.org680/padmin/source dmake: Error code 1, while making 'build_all' '---* tg_merge.mk *---' Under Mac OS X, main function *must exist* in an executable. just add this function make gcc happy :-) These patch is from Kevin Hendricks.
Created attachment 21084 [details] patch for necessary main function in pamain.cxx Mac OSX SRC680
cc for Pavel Janik
Yes, missing _main is issue now -> confirming. Patch could solve it (I haven't tried yet though). The question is: why it happens? How it was solved in 1.1.4 where this change is not needed? We can't apply such patch without knowing the principal issue here.
The real main function should come from the VCL though, in here: unx/source/app/salmain.cxx:int main( int argc, char *argv[] ) It appears that salmain.cxx is gone with 680, see: Revision 1.10.38.1 Commit info 2003-10-21 07:53:52-0800 (15 months, 1 week ago) by pl Branch cws_src680_vclplug #i21232# first round of virtualizing the Sal classes, Unix works, Windows to come Wherever main() actually is now, is what needs to get linked in. I assume that the X11 VCL plug still has a main, since OOo needs to run under X11 without the GTK or KDE VCLplugs. Eric, I think that there's just some missing build-variables that you need to set here now to build the correct bits of the VCLplug stuff. OOo needs a main() anyway, we just have to find out where its built now.
Eric, Changes made to the VCL mean that most functions are now virtual and the VCL should load a correct VCLplug on startup. However, I'm totally unsure how that works. Phillip Lohmann will know, adding him to CC. Look in vcl/unx/source/plugadapt/salmain.cxx for the new main() definition. Mac OS X will need whatever library this is linked into the binary for padmin. I think this library is either 'libvclplug_gen645' or 'libvclplug_dummy645'. You'll probably need to add '-lvclplug_gen645' or '-lvclplug_dummy645' to the link flags for padmin's makefile.mk. Do something like: padmin/source/makefile.mk: APP1STDLIBS= \ -l$(SHL1TARGET) \ $(VCLLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ -lXext -lX11 +.IF "$(OS)$(GUI)$(GUIBASE)"=="MACOSXUNXunx" + APP1STDLIBS+=-lvclplug_gen645 +.ENDIF And see if that works. If it doesn't try -lvclplug_dummy645, or try both of them at the same time. If that doesn't work, try just doing "$(OS)"=="MACOSX". If that doesn't work, then PL will ahve to help :)
grr, remeber the "mxp" at the end of those library names, ie "-lvclplug_gen645mxp" and "-lvclplug_dummy645mxp"
salmain.cxx is not gone at all, it just went to vcl/unx/source/plugadapt and is the same as before. It's still linked to libvcl (not any of the plugins as suggested), so actually not much has changed. linking spadmin to a plugin would be a really bad idea since the whole plugin process is exactly there because the plugins are meant to be interchangeable. BTW: you don't need spadmin at all, since Mac uses CUPS anyway, you don't need a clumsy OOo tool to configure your system printers. What you didn't write is which version you are trying to compile; if this is m73 or later, then you might have stumbled about the new export symbol reduction, so what possibly could fix that by changing the SAL_DEFINE_CRT_ENTRY macro in sal/inc/sal/main.h so it does not read "int main( int argc, char** argv )" but "int SAL_DLLEXPORT main(int argc, char** argv)". Just my 2 cents.
*** Issue 42239 has been marked as a duplicate of this issue. ***
*** Issue 39914 has been marked as a duplicate of this issue. ***
fheckl stated in issue 42239: Comparing with an intel linux build I figured that the problem is that the entry $OOOSRCDIR/solver/680/unxmacxp.pro/lib/salmain.o is missing in the respective object file lists e.g. in automation/unxmacxp.pro/misc/testtool.list. Since I couldn't figure out when and how those lists are compiled I cannot offer a patch yet. Any help is welcome. maybe this gives some hint
looks like STDOBJVCL=$(L)$/salmain.o is missing in unxmacxp.mk ericb: can you please test this?
*** Issue 40203 has been marked as a duplicate of this issue. ***
I can confirm that it solves the problem for me, yes. Thank you.
Hi all, I just follow Kevin's patches without verify more what caused the problem. I think my patch is not valid, and Pavel's solution is the best here. Searching, salmain.o was effectively missing in solver/*/lib, excepted in Linux build. A new patch follows as attachment. I have not tested it, so, wiating, can someone confirm it works ? fa, pl, gh : thank you very much for your help. Of course, I learn a lot with all your explanations :-) Regards, eric bachard
Created attachment 22334 [details] new patch fixing missing salmain.o in Mac OSX build SRC680 m71s1
OK. I'll take care about merging it in. fheckl already confirmed it works, ericb: would be nice to get OK also from you.
.
Fixed in macosx02. I moved the line to the place where other files have it so it is easier to sync these files. ericb: please verify that this fixed this issues. It did for me ;-)
adding macjogi
Verified : works fine in m78 + macosx02 Regards, ericb
works fine in m79 from eric.b
Closing.