Closed Bug 232600 Opened 21 years ago Closed 18 years ago

MSVC .NET 2003 (7.1) does not support /PDB:NONE

Categories

(NSS :: Build, defect, P3)

x86
Windows XP
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.5

People

(Reporter: wtc, Assigned: nelson)

References

Details

Attachments

(3 files, 1 obsolete file)

We are currently using the /PDB:NONE linker option
when we build DLLs or EXEs to prevent the generation
of PDB files.

MSVC .NET 2003 (7.1) does not support /PDB:NONE,
and I can't find an equivalent of /PDB:NONE.  So
it looks like we will need to distribute the PDB
files with our DLLs and EXEs in our VC 7.1 debug
build binary distributions.
*** Bug 242925 has been marked as a duplicate of this bug. ***
Yes, we probably will need to distribute .pdb files with out vc7 debug builds.

I would like our Makefiles to continue to use /PDB:NONE for VC5 and VC6
builds.  (Yes, NSS still builds fine with VC5, I do it at home.)  

I would also like to see our Makefiles create directories with separate
names for VC6 obj's and BVC7 obj's, so that it is possible to build both
from a single source tree and simultaneously keep both builds separate.
QA Contact: wtchang → build
The use of /PDB:NONE was evidently introduced in 3.9.
In NSS 3.10, a patch for bug 244231 (not an NSS bug) bracketed each 
appearance of /PDB:NONE (except one) with ifndef MOZ_DEBUG_SYMBOLS.

That patch would have been (IMO) a complete fix for THIS bug, except 
for the one instance that was missed, in WIN32.mk, a line that reads:
    LDFLAGS    += -DEBUG -PDB:NONE /FIXED:NO  

I will shortly attach a patch to correct that one last occurance of 
PDB:NONE.  I am also working on a patch to install the PDB files 
into $DIST, along with the EXE and DLL files.

I discovered something curious about how MSVC 8 (a.k.a. MSVC 2005) 
interprets -PDB:NONE.  It interprets NONE as the name of the PDB file,
so it creates a PDB file named NONE (not NONE.pdb) in the source 
directory.  :(  I was happy to see that in the absence of any -PDB
option, MSVC puts the PDB file in the same directory as the built
DLL or EXE file, so we don't need to create a fancy -PDB option that 
puts the PDB file in $(OBJDIR).
Priority: -- → P3
Target Milestone: --- → 3.10
I'm asking the people who worked on the previous patch for PDB:NONE 
to review this one.
Assignee: wtchang → nelson
Status: NEW → ASSIGNED
Attachment #250062 - Flags: superreview?(wtchang)
Attachment #250062 - Flags: review?(bryner)
Adding reviewers to CC list
When MOZ_DEBUG_SYMBOLS is defined and PDB files are generated,
they will be installed in the appropriate places in $DIST.

I think these two patches will complete this bug.
Please Let me know if you disagree.
Attachment #250064 - Flags: superreview?(wtchang)
Attachment #250064 - Flags: review?(rrelyea)
Comment on attachment 250064 [details] [diff] [review]
patch v1 - install PDB files in $DIST

I worked on this problem before but I may have lost my patch.

I used a different approach.  I added a new make variable PDB_FILE,
which is defined under the right conditions in coreconf/WIN32.mk.
Then in coreconf/rules.mk, I added this install command:

 ifdef PDB_FILE
 	$(INSTALL) -m 664 $(PDB_FILE) $(SOURCE_LIB_DIR)
 endif

which looks like the install commands for all the other kinds of files.
Attachment #250064 - Flags: superreview?(wtchang) → superreview+
Wan-Teh, I like your approach better.  I'll hold off committing my patch.
Hopefully I'll have time to write a better one later this month.
Comment on attachment 250062 [details] [diff] [review]
patch v1 - bracket PDB:NONE with ifndef MOZ_DEBUG_SYMBOLS

I may also have had a patch for the -PDB:NONE problem.
I fixed the -PDB:NONE problem for NSPR in bug 242741.
You can use that patch as a reference.  Unfortunately
I didn't follow through and finish the job on NSS then.

My NSPR patch was more sophisticated because -PDB:NONE
is supported by VC6.  So it contains code to detect the
MSVC version.  I remember I also wrote the equivalent
code for NSS/coreconf, which is more cumbersome but
possible.  If you are to use my approach, you'd use
"MSVC version <= 6.0" rather than "MOZ_DEBUG_SYMBOLS
is not defined" as the condition for using -PDB:NONE.
Attachment #250062 - Flags: superreview?(wtchang) → superreview+
(In reply to comment #3)
> The use of /PDB:NONE was evidently introduced in 3.9.
> In NSS 3.10, a patch for bug 244231 (not an NSS bug) bracketed each 
> appearance of /PDB:NONE (except one) with ifndef MOZ_DEBUG_SYMBOLS.

We've always been using /PDB:NONE for shared libraries.
In NSS 3.8, we introduced the use of /PDB:NONE for programs
(added to coreconf/WIN32.mk in bug 95138).  This is the instance
of /PDB:NONE that the patch for bug 244231 (fixed in NSS 3.9.3,
not NSS 3.10) missed, probably because the MOZ_DEBUG_SYMBOLS
variable is not used with debug builds, or Mozilla only uses NSS
shared libraries.
Comment on attachment 250062 [details] [diff] [review]
patch v1 - bracket PDB:NONE with ifndef MOZ_DEBUG_SYMBOLS

In light of my comment 10, this patch isn't necessary because
it modifies a section for debug builds, with which MOZ_DEBUG_SYMBOLS
is not used (i.e., "ifndef MOZ_DEBUG_SYMBOLS" is true at that
location).
Comment on attachment 250062 [details] [diff] [review]
patch v1 - bracket PDB:NONE with ifndef MOZ_DEBUG_SYMBOLS

When I build Debug builds of NSS with MSVC 2005 Express, I define MOZ_DEBUG_SYMBOLS so that I get PDB files with reasonable names 
instead of PDB files named NONE.  That's why I found this patch to be
necessary.
My point is that MOZ_DEBUG_SYMBOLS means "I want debug symbols
in my optimized builds", so MOZ_DEBUG_SYMBOLS should only be set
when BUILD_OPT is set.  Our coreconf build system does not detect
all illegal combinations of build options, so in this case it
still does something when you build debug builds with MOZ_DEBUG_SYMBOLS
defined, but that build configuration is illegal.
Attachment #250062 - Flags: review?(rrelyea)
Comment on attachment 250064 [details] [diff] [review]
patch v1 - install PDB files in $DIST

r=rrelyea
Attachment #250064 - Flags: review?(rrelyea) → review+
Comment on attachment 250062 [details] [diff] [review]
patch v1 - bracket PDB:NONE with ifndef MOZ_DEBUG_SYMBOLS

r=rrelyea
Attachment #250062 - Flags: review?(rrelyea) → review+
Comment on attachment 250062 [details] [diff] [review]
patch v1 - bracket PDB:NONE with ifndef MOZ_DEBUG_SYMBOLS

Patch has two reviews now.
Attachment #250062 - Flags: review?(bryner)
Checkin comment:
> Bug 232600. Define MOZ_DEBUG_SYMBOLS in environment to create .pdb files
> and install them in $DIST.   r=rrelyea,wtchang

On trunk:
Checking in WIN32.mk; new revision: 1.23; previous revision: 1.22
Checking in rules.mk; new revision: 1.72; previous revision: 1.71

On branch:
Checking in WIN32.mk; new revision: 1.20.2.3; previous revision: 1.20.2.2
Checking in rules.mk; new revision: 1.66.2.5; previous revision: 1.66.2.4
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: 3.10 → 3.11.5
I just landed this patch on the Mozilla trunk, and it broke a
Windows tinderbox:
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1168724400.1168726188.23396.gz&fulltext=1

This Tinderbox does an optimized build with MOZ_DEBUG_SYMBOLS=1.
The compiler is MSVC 2005 (8).  It builds shlibsign like this:

/usr/bin/make -C /cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign MAKE="/usr/bin/make -j1" -j1 CC="/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/build/cygwin-wrapper cl" SOURCE_MD_DIR=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist DIST=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist NSPR_INCLUDE_DIR=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/include/nspr NSPR_LIB_DIR=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/lib MOZILLA_CLIENT=1 NO_MDUPDATE=1 NSS_ENABLE_ECC=1 BUILD_TREE=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla BUILD_OPT=1 NS_USE_GCC= NS_USE_NATIVE=1 OS_TARGET=WIN95

The build failure is:

/usr/bin/make -C /cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign MAKE="/usr/bin/make -j1" -j1 CC="/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/build/cygwin-wrapper cl" SOURCE_MD_DIR=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist DIST=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist NSPR_INCLUDE_DIR=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/include/nspr NSPR_LIB_DIR=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/lib MOZILLA_CLIENT=1 NO_MDUPDATE=1 NSS_ENABLE_ECC=1 BUILD_TREE=e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla BUILD_OPT=1 NS_USE_GCC= NS_USE_NATIVE=1 OS_TARGET=WIN95
make[5]: Entering directory `/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign'
make[5]: warning: -jN forced in submake: disabling jobserver mode.
cd mangle; /usr/bin/make -j1 export
make[6]: Entering directory `/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/mangle'
make[6]: Nothing to be done for `export'.
make[6]: Leaving directory `/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/mangle'
Sat Jan 13 14:09:38 PST 2007
/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/build/cygwin-wrapper cl -Foe:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.obj -c -O2 -Zi -MD -W3 -nologo -DXP_PC -DSHLIB_SUFFIX=\"dll\" -DSHLIB_PREFIX=\"\" -UDEBUG -U_DEBUG -DNDEBUG -DWIN32 -D_WINDOWS -D_X86_ -DWIN95 -DNSS_ENABLE_ECC -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/include/nspr -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/include  -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/public/nss -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/private/nss -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/include  -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/public/dbm -Ie:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/public/seccmd  e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/shlibsign.c
shlibsign.c
e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/shlibsign.c(191) : warning C4090: '=' : different 'const' qualifiers
e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/shlibsign.c(345) : warning C4018: '<' : signed/unsigned mismatch
e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/shlibsign.c(347) : warning C4018: '<' : signed/unsigned mismatch
e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/shlibsign.c(353) : warning C4018: '<' : signed/unsigned mismatch
e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign/shlibsign.c(355) : warning C4018: '<' : signed/unsigned mismatch
/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/build/cygwin-wrapper cl e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\nss\\shlibsign.obj -Fee:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe -link  e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\sectool.lib e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\smime3.lib e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\ssl3.lib e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\nss3.lib e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\plc4.lib e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\plds4.lib e:\\builds\\tinderbox\\Fx-Trunk\\WINNT_5.2_Depend\\mozilla\\dist\\lib\\nspr4.lib   
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\sectool.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\smime3.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\ssl3.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\nss3.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\plc4.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\plds4.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\dist\lib\nspr4.lib 
e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\nss\shlibsign.obj 
if test -f e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe.manifest; then \
	mt.exe -NOLOGO -MANIFEST e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe.manifest -OUTPUTRESOURCE:e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe\;1; \
	rm -f e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe.manifest; \
fi
nsinstall -m 775 e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.exe e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/bin
nsinstall -m 644 e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/nss/shlibsign.pdb e:/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/dist/bin
nsinstall: e:\builds\tinderbox\Fx-Trunk\WINNT_5.2_Depend\mozilla\nss\shlibsign.pdb: No such file or directory
make[5]: *** [libs] Error 3
make[5]: Leaving directory `/cygdrive/e/builds/tinderbox/Fx-Trunk/WINNT_5.2_Depend/mozilla/security/nss/cmd/shlibsign'
make[4]: *** [libs] Error 2
This patch fixes the problem.  When Brian Ryner added MOZ_DEBUG_SYMBOLS
to NSS, he didn't build any NSS programs (this was before shlibsign existed)
because Mozilla only used NSS DLLs, so his patch didn't change the linker
flags for building programs.  He only changed the linker flags for building
DLLs.
Comment on attachment 251400 [details] [diff] [review]
Build programs with PDBs in optimized builds with MOZ_DEBUG_SYMBOLS=1

r=nelson
Attachment #251400 - Flags: review+
I checked in this patch on the NSS trunk (NSS 3.12) and
NSS_3_11_BRANCH (NSS 3.11.5).

Checking in WIN32.mk;
/cvsroot/mozilla/security/coreconf/WIN32.mk,v  <--  WIN32.mk
new revision: 1.24; previous revision: 1.23
done

Checking in WIN32.mk;
/cvsroot/mozilla/security/coreconf/WIN32.mk,v  <--  WIN32.mk
new revision: 1.20.2.5; previous revision: 1.20.2.4
done
Attachment #251400 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: