Closed Bug 64650 Opened 24 years ago Closed 24 years ago

Get mozilla PSM working for hp-ux

Categories

(Core :: Security, defect, P2)

HP
HP-UX
defect

Tracking

()

VERIFIED FIXED
mozilla0.8

People

(Reporter: jdunn, Assigned: jdunn)

References

Details

Attachments

(6 files)

following cls's instructions for building psm
-do a normal trunk pull and build
-gmake -f client.mk pull_all BUILD_MODULES=psm
-gmake BUILD_MODULES=psm

Need to make changes to get the HP psm building.

diffs will follow.
updating fields & accepting
Status: NEW → ASSIGNED
Priority: -- → P2
QA Contact: ckritzer → barrettl
Target Milestone: --- → mozilla0.8
The diffs i just put in are for the following:

security/coreconf/HP-UXB.11.mk
-I modified the CC & OS_CFLAGS define in HP-UXB.11.mk to match
 how we are building the rest of mozilla for hpux 11.00
-we don't use -lrt
-we use aCC ($CCC) to make sharelibs AND progs

security/psm/lib/nlslayer/nlslayer.cpp
-declaring something extern and static doesn't make sense...
 the HP compiler doesn't like this.  These symbols are
 needed elsewhere... (which is why i am assuming someone
 declared them extern)

security/psm/server/Makefile
- -lpthread is already included... so why have it again
- remove the -shared from LINK_LIBS... not needed
- HP (and AIX) requires that .so/.sl be executable so instead
  of installing them as 644 we need to do it as 755
- for building the XPI... now that psm sits in the 'package'
  directory we no longer need to include XPCOM/NSPR/COMPONENTS
  do we?  And if we don't need these, then we don't need to have
  start-regxpcom (since if run in the package dir, it will overwrite
  the mozilla component.reg.

security/pxm/server/main.c
- hp's compiler has an issue if a program with 'main' in a .c
  invokes any C++ routines (in this case, psm links in the
  nlslayer.cpp).  So in order to do the 'c++' initialization
  we must 'force' a call to _main.  I ifdef'd this HPUX.

security/psm/server/ start-psm & start-regxpcom
- add LIBPATH (AIX) and SHLIB_PATH (HP-UX) settings.

wtc, david?  What do u guys think?

Blocks: 18687
adding cls... thought I had him before
security/pxm/server/main.c: Since PSM now links with
C++ code, I think we should link PSM with the C++
compiler.  I remember that the main() function for a
C++ program must be in a C++ file, so main.c may need
to be renamed main.cpp.  Doing this should fix bug #64427
and the second problem in bug #64713 automatically
(-lstdc++ or -lC).

security/coreconf/HP-UXB.11.mk: Changes to this file need
to be carefully reviewed and tested because security/coreconf
is also used by NSS and JSS.
I looked at the changes in the mozilla/security/psm subdirectories.  They look
good.  

wtc's suggestion is a good one, but I'm not sure how easy it would be to make
psm link with c++ instead of cc.

wtc, do you know if coreconf has a flag for setting the linker?
With the exception of the changes to Makefile to
clean up build_xpi... my changes are all relatively
harmless and HP specific.  Event he change to main.c
won't effect others... I would rather NOT include the
switch from main.c to main.cpp in this change... since
that will effect other unixes/mac/windows (i think).

I have 2 questions...
do I have someone r=?
do one of you have sr= or a= approval for this?

2ndly does ANYTHING other than mozilla psm use this code
(i.e. with my mucking with HP's security/coreconf defines
 muck up any other product at netscape/iPlanet/mozilla?)
Jim:

Patch id=22412 is the only change I will make to
mozilla/security/coreconf/HP-UXB.11.mk.  Comments on
the rejected changes.
1. -lrt is required when linking with the (unsupported)
   static NSPR libraries.  When we really do not build
   NSPR static libraries at all, we can remove -lrt.
   Right now it is harmless because libnspr4.sl will
   pull it in anyway as an implicit dependency.
2. We cannot use the C++ compiler to link the shared
   libraries and programs *by default* because
   mozilla/security/coreconf is also used by NSS, which
   does not have C++ code.
3. +DAportable is the flag recommended by the HP engineer
   that worked with us before.
4. The default value of CC is cc.  If you insist we can
   set CC to cc explicitly.  (I was going for minimal
   change.)

Regarding the C++ main() function problem, I think we
should implement the real solution.  Your suggested change
works for aCC but will break when people try to build
with g++ on HP-UX.  If the C++ language requires that the
main() function be in a C++ file, we should do that.

Javi:

To use the C++ compiler to link the PSM server, just
set MKPROG to $(CCC).  By default, MKPROG is $(CC).
Attached patch new diffSplinter Review
Ok, I made changes based on the comments...
-the only reason I am doing the CC=cc is that by
 definition for building mozilla we set CC=cc -ext -Ae +DA1.1 +DS2.0
 in our env.  and security doesn't like this.  So by explicitly setting
 CC=cc we override this.
-I moved MKSHLIB & MKPROG to security/psm/server/Makefile
-i have a new file main.cpp (security/psm/seerver/Makefile) which
 is essentially the same as main.c with some changes required by
 hp (see the diff).
-I removed main.c from the manifest.mn and added main.cpp

I tested this on HP and Linux... I will try to do it on Win32...
but can't on MAC which is why I didn't want to even attempt adding
a new file (main.cpp).  I need someone to try this out for me
(preferably on mac and win32).
 
This will break the Mac when it goes in.

The Mac projects will have to be updated to have the new file.  Unfortunately, 
I'm extremely busy right now, and won't have time until sometime next week.

Also, I'd like to leave the rules for releas_md in the server Makefiles as is 
because that rules tends to be for building PSM package for Communicator.  The 
changes you made for building the XPI are fine.

jdunn, looks like we'll have to carpool between ourselves to land this.
ok... lets carpool next week.

I am fighting trying to build win32 right now...
talk to u next week.
I checked in the +DAportable +DS2.0 change on the tip and the
NSS_3_1_BRANCH.
/cvsroot/mozilla/security/coreconf/HP-UXB.11.mk, revisions 1.3 and 1.1.8.1.

I set CC=cc explicitly in HP-UX.mk, which applies to all HP-UX releases.
I checked this in on the tip and the NSS_3_1_BRANCH.
/cvsroot/mozilla/security/coreconf/HP-UX.mk, revisions 1.4 and 1.2.2.1.
Ok, here are my latest changes.
-I no longer set CC=cc in HP-UXB.11.00.mk file,
 I keep DAportable and just change to DS2.0
-in the 2 security/psm/server/start scripts
 i still set SHLIB_PATH & LIBPATH for HP-UX and AIX
-in security/psm/server/
 -I added main.cpp that calls psm_main()
  psm_main is in psmain.c (formally main.c - since u can't have
  2 main.o)
 -I changed main.c to psmmain.c in manifest.mn and add
  main.cpp as a CPPSRCS
 -in Makefile
  I did my normal HP things
  for build_xpi changes... i just chmod 755 instead of 644 for
  'libs', since HP & AIX require them to be executable
-in nlslayer.cpp I am still removing the 'static' from the 3
 symbols which are marked extern

guys how does this look?
javi when is good for you to carpool?
Blocks: 66185
This patch has been checked in.  jdunn, please verify.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
I got this to work today...
Here are my steps to build

cvs co mozilla/client.mk
cd mozilla
set .mozconfig to
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-hppa-hp-hpux11.00
    ac_add_options --enable-nspr-autoconf
set env to /u/jdunn/bin/mkmozhp11
gmake -f client.mk pull_and_build_all
unset CFLAGS, CXXFLAGS
set CC=cc
set CXX=aCC
gmake -f client.mk pull_all BUILD_MODULES=psm
gmake -f client.mk build_all BUILD_MODULES=psm
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: