Issue 39927 - patch for necessary main function in padmin Mac OSX SRC680
Summary: patch for necessary main function in padmin Mac OSX SRC680
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: 680m67
Hardware: PowerPC (PPC) Mac OS X, all
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: pavel
QA Contact: issues@porting
URL:
Keywords:
: 39914 40203 42239 (view as issue list)
Depends on:
Blocks: 42382
  Show dependency tree
 
Reported: 2005-01-05 09:34 UTC by eric.bachard
Modified: 2005-04-10 20:56 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch for necessary main function in pamain.cxx Mac OSX SRC680 (544 bytes, patch)
2005-01-05 09:35 UTC, eric.bachard
no flags Details | Diff
new patch fixing missing salmain.o in Mac OSX build SRC680 m71s1 (230 bytes, patch)
2005-02-08 14:29 UTC, eric.bachard
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description eric.bachard 2005-01-05 09:34:46 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.
Comment 1 eric.bachard 2005-01-05 09:35:42 UTC
Created attachment 21084 [details]
patch for necessary main function in pamain.cxx  Mac OSX SRC680
Comment 2 eric.bachard 2005-01-05 09:36:11 UTC
cc for Pavel Janik
Comment 3 pavel 2005-01-31 21:20:08 UTC
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.
Comment 4 fa 2005-01-31 21:40:08 UTC
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.
Comment 5 fa 2005-01-31 21:50:54 UTC
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 :)
Comment 6 fa 2005-01-31 21:52:14 UTC
grr, remeber the "mxp" at the end of those library names, ie
"-lvclplug_gen645mxp" and "-lvclplug_dummy645mxp"
Comment 7 philipp.lohmann 2005-02-01 10:18:26 UTC
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.
Comment 8 pavel 2005-02-08 08:30:21 UTC
*** Issue 42239 has been marked as a duplicate of this issue. ***
Comment 9 pavel 2005-02-08 08:31:17 UTC
*** Issue 39914 has been marked as a duplicate of this issue. ***
Comment 10 gregor.hartmann 2005-02-08 08:39:12 UTC
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
Comment 11 pavel 2005-02-08 08:43:18 UTC
looks like STDOBJVCL=$(L)$/salmain.o is missing in unxmacxp.mk

ericb: can you please test this?
Comment 12 gregor.hartmann 2005-02-08 09:27:44 UTC
*** Issue 40203 has been marked as a duplicate of this issue. ***
Comment 13 florian 2005-02-08 09:29:24 UTC
I can confirm that it solves the problem for me, yes. Thank you.
Comment 14 eric.bachard 2005-02-08 14:28:01 UTC
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
Comment 15 eric.bachard 2005-02-08 14:29:01 UTC
Created attachment 22334 [details]
new patch fixing missing  salmain.o in Mac OSX build SRC680 m71s1
Comment 16 pavel 2005-02-08 14:31:03 UTC
OK.

I'll take care about merging it in.

fheckl already confirmed it works, ericb: would be nice to get OK also from you.
Comment 17 pavel 2005-02-08 14:31:18 UTC
.
Comment 18 pavel 2005-02-08 19:35:26 UTC
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 ;-)
Comment 19 jogi 2005-02-09 18:54:36 UTC
adding macjogi
Comment 20 eric.bachard 2005-02-14 14:10:35 UTC
Verified :  works fine in m78 + macosx02

Regards,
ericb
Comment 21 jogi 2005-02-24 14:53:22 UTC
works fine in m79 from eric.b
Comment 22 pavel 2005-04-10 20:56:09 UTC
Closing.