If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

NSS incorrectly uses C++ compiler to compile C code on AIX

RESOLVED FIXED in 3.9

Status

NSS
Build
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: Philip K. Warren, Assigned: Wan-Teh Chang)

Tracking

({fixed1.4.2})

unspecified
Other
AIX
fixed1.4.2

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

14 years ago
NSS should use the xlc_r compiler to compile C code, and xlC_r to compile C++
code on AIX. The AIX.mk file currently specifies the C++ compiler to use for
both C and C++ code. This breaks compiling Mozilla with ccache. I will attach a
patch to fix this problem.
(Reporter)

Comment 1

14 years ago
Created attachment 136065 [details] [diff] [review]
Patch v1

Changes the DEFAULT_COMPILER and CC variables in AIX.mk to xlc_r.
(Reporter)

Updated

14 years ago
Attachment #136065 - Flags: review?(wchang0222)
(Assignee)

Comment 2

14 years ago
Comment on attachment 136065 [details] [diff] [review]
Patch v1

r=wtc.	Philip, just curious: what's the problem with
compiling C code using a C++ compiler?
Attachment #136065 - Flags: review?(wchang0222) → review+
(Assignee)

Comment 3

14 years ago
Comment on attachment 136065 [details] [diff] [review]
Patch v1

I checked in this patch on the NSS tip for NSS 3.9.

mozilla/security/coreconf/AIX4.2.mk still contains
-L/usr/lpp/xlC/lib.  Is that OK?
(Reporter)

Comment 4

14 years ago
Under normal conditions, compiling .c files with the C++ compiler works 
properly. However, when using ccache, all files are first preprocessed into .i 
files, and then fed to the compiler. Since the compiler can't tell whether .i 
files are C or C++, it determines the type of the file based on the compiler 
name (xlC_r for C++, xlc_r for C). Some of the NSS C files fail to compile 
when the compiler believes they are C++. For example, try the following:

1) Compiling nsinstall.c with xlC_r:
pkw@ut:~/sb/mozilla/trunk/mozilla/security/coreconf/nsinstall$ xlC_r 
nsinstall.c -c -o nsinstall.o

2) Compiling nsinstall.i with xlC_r:
pkw@ut:~/sb/mozilla/trunk/mozilla/security/coreconf/nsinstall$ cp nsinstall.c 
nsinstall.i  
pkw@ut:~/sb/mozilla/trunk/mozilla/security/coreconf/nsinstall$ xlC_r 
nsinstall.i -c -o nsinstall.o
"nsinstall.i", line 187.35: 1540-0257 (S) An object or reference of type "char 
*" cannot be initialized with an expression of type "void * const".
"nsinstall.i", line 188.35: 1540-0257 (S) An object or reference of type "char 
*" cannot be initialized with an expression of type "void * const".
"nsinstall.i", line 189.35: 1540-0257 (S) An object or reference of type "char 
*" cannot be initialized with an expression of type "void * const".
"nsinstall.i", line 194.35: 1540-0257 (S) An object or reference of type "char 
*" cannot be initialized with an expression of type "void * const".
"nsinstall.i", line 196.35: 1540-0257 (S) An object or reference of type "char 
*" cannot be initialized with an expression of type "void * const".
"nsinstall.i", line 197.35: 1540-0257 (S) An object or reference of type "char 
*" cannot be initialized with an expression of type "void * const".

3) Compiling nsinstall.cpp with xlC_r:
pkw@ut:~/sb/mozilla/trunk/mozilla/security/coreconf/nsinstall$ cp nsinstall.c 
nsinstall.cpp
pkw@ut:~/sb/mozilla/trunk/mozilla/security/coreconf/nsinstall$ xlC_r 
nsinstall.cpp -c -o nsinstall.o
"nsinstall.cpp", line 187.35: 1540-0257 (S) An object or reference of 
type "char *" cannot be initialized with an expression of type "void * const".
"nsinstall.cpp", line 188.35: 1540-0257 (S) An object or reference of 
type "char *" cannot be initialized with an expression of type "void * const".
"nsinstall.cpp", line 189.35: 1540-0257 (S) An object or reference of 
type "char *" cannot be initialized with an expression of type "void * const".
"nsinstall.cpp", line 194.35: 1540-0257 (S) An object or reference of 
type "char *" cannot be initialized with an expression of type "void * const".
"nsinstall.cpp", line 196.35: 1540-0257 (S) An object or reference of 
type "char *" cannot be initialized with an expression of type "void * const".
"nsinstall.cpp", line 197.35: 1540-0257 (S) An object or reference of 
type "char *" cannot be initialized with an expression of type "void * const".
(Reporter)

Comment 5

14 years ago
> I checked in this patch on the NSS tip for NSS 3.9.

Thanks.

> mozilla/security/coreconf/AIX4.2.mk still contains -L/usr/lpp/xlC/lib. Is 
that OK?

I have never compiled Mozilla on AIX 4.2 (which is out of service), so I can't 
verify if that setting is correct.
(Assignee)

Comment 6

14 years ago
Philip, thank you for answering my questions.

I will ignore AIX4.2.mk since it most likely will never
get used.

If this change is important to your work, please request
drivers' approval for 1.6b.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.9
(Assignee)

Comment 7

14 years ago
Philip, NSPR (also C code only) is also compiled with xlC_r.
Should we also change NSPR to use xlc_r to compile C code?

(I may have made NSPR compilable as C++ code before.  Someone
accidentally compiled NSPR with a C++ compiler on IRIX and
I remember I checked in his patches.)
(Reporter)

Comment 8

14 years ago
Created attachment 136119 [details] [diff] [review]
NSPR Patch

I have tested this patch works properly for NSPR. I have removed the section
which adds -qarch=com to the command line options - this is the default for the
compiler.

I did not have any problems using ccache to compile NSPR, however this doesn't
hurt to specify the C compiler here.
(Reporter)

Updated

14 years ago
Attachment #136119 - Flags: review?(wchang0222)
(Assignee)

Updated

14 years ago
Attachment #136119 - Flags: review?(wchang0222) → review+
(Assignee)

Comment 9

14 years ago
Created attachment 136154 [details] [diff] [review]
NSS supplemental patch

Philip, I guess we can remove -qarch=com from NSS's coreconf
build system, too.
(Assignee)

Updated

14 years ago
Attachment #136154 - Flags: review?(pkw)
(Reporter)

Updated

14 years ago
Attachment #136154 - Flags: review?(pkw) → review+
(Assignee)

Comment 10

14 years ago
Comment on attachment 136154 [details] [diff] [review]
NSS supplemental patch

This NSS patch has been checked into the NSS tip (NSS 3.9).
(Assignee)

Comment 11

14 years ago
Comment on attachment 136119 [details] [diff] [review]
NSPR Patch

This NSPR patch has been checked into the NSPR tip (NSPR 4.5).
(Reporter)

Comment 12

14 years ago
Comment on attachment 136065 [details] [diff] [review]
Patch v1

Seeking approval to get these checked in to the 1.4 and 1.6 branches. This is
an AIX-specific change which just specifies that the C compiler should be used
to compile C code instead of the C++ compiler.
Attachment #136065 - Flags: approval1.6?
Attachment #136065 - Flags: approval1.4.2?
(Reporter)

Comment 13

14 years ago
Comment on attachment 136119 [details] [diff] [review]
NSPR Patch

Seeking approval to get these checked in to the 1.4 and 1.6 branches. This is
an AIX-specific change which just specifies that the C compiler should be used
to compile C code instead of the C++ compiler.
Attachment #136119 - Flags: approval1.6?
Attachment #136119 - Flags: approval1.4.2?
(Reporter)

Comment 14

14 years ago
Comment on attachment 136154 [details] [diff] [review]
NSS supplemental patch

Seeking approval to get these checked in to the 1.4 and 1.6 branches. This is
an AIX-specific change which removes the usage of the qarch=com compiler
argument, which is already the default.
Attachment #136154 - Flags: approval1.6?
Attachment #136154 - Flags: approval1.4.2?

Comment 15

14 years ago
Comment on attachment 136065 [details] [diff] [review]
Patch v1

a=mkaply
Attachment #136065 - Flags: approval1.6?
Attachment #136065 - Flags: approval1.6+
Attachment #136065 - Flags: approval1.4.2?
Attachment #136065 - Flags: approval1.4.2+

Comment 16

14 years ago
Comment on attachment 136119 [details] [diff] [review]
NSPR Patch

a=mkaply
Attachment #136119 - Flags: approval1.6?
Attachment #136119 - Flags: approval1.6+
Attachment #136119 - Flags: approval1.4.2?
Attachment #136119 - Flags: approval1.4.2+

Comment 17

14 years ago
Comment on attachment 136154 [details] [diff] [review]
NSS supplemental patch

a=mkaply
Attachment #136154 - Flags: approval1.6?
Attachment #136154 - Flags: approval1.6+
Attachment #136154 - Flags: approval1.4.2?
Attachment #136154 - Flags: approval1.4.2+
(Assignee)

Comment 18

14 years ago
Comment on attachment 136065 [details] [diff] [review]
Patch v1

This patch has been checked into NSS_CLIENT_TAG
for Mozilla 1.6.
(Assignee)

Comment 19

14 years ago
Comment on attachment 136154 [details] [diff] [review]
NSS supplemental patch

This patch has been checked into NSS_CLIENT_TAG for
Mozilla 1.6.
(Assignee)

Comment 20

14 years ago
Comment on attachment 136119 [details] [diff] [review]
NSPR Patch

This patch has been checked into the NSPRPUB_PRE_4_2_CLIENT_BRANCH
for Mozilla 1.6.
(Reporter)

Comment 21

14 years ago
Fixed on 1.4 branch.

Checking in security/coreconf/AIX.mk;
/cvsroot/mozilla/security/coreconf/AIX.mk,v  <--  AIX.mk
new revision: 1.4.6.1; previous revision: 1.4
done
Checking in nsprpub/configure;
/cvsroot/mozilla/nsprpub/configure,v  <--  configure
new revision: 1.78.2.63.2.1; previous revision: 1.78.2.63
done
Checking in nsprpub/configure.in;
/cvsroot/mozilla/nsprpub/configure.in,v  <--  configure.in
new revision: 1.83.2.63.2.3; previous revision: 1.83.2.63.2.2
done

Updated

14 years ago
Keywords: fixed1.4.2
You need to log in before you can comment on or make changes to this bug.