Closed
Bug 1034415
Opened 11 years ago
Closed 11 years ago
NSPR hardcodes the C compiler to cl on Windows
Categories
(NSPR :: NSPR, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
4.10.7
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
|
1.81 KB,
patch
|
ted
:
review+
wtc
:
superreview+
|
Details | Diff | Splinter Review |
NSPR seems to use AC_PROG_CC across the board <http://mxr.mozilla.org/mozilla-central/source/nsprpub/configure.in#613> except on Windows <http://mxr.mozilla.org/mozilla-central/source/nsprpub/configure.in#74> where it sets CC to cl no matter what the environment has decided to set for the C compiler. This causes us to build NSPR with MSVC even when setting CC=clang-cl in the environment. I can imagine this affects mingw similarly.
Does anyone know why things are set up this way? Is this intentional? It seems to me that changing AC_CHECK_PROGS on line 74 to set the result to a variable other than $CC will make AC_PROG_CC check the environment variable properly...
Comment 1•11 years ago
|
||
The first things AC_CHECK_PROGS does, after checking for config.cache, is to check if CC is set and use that. This is what that AC_CHECK_PROGS expands to in configure:
for ac_prog in cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CC" && break
done
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
| Assignee | ||
Comment 2•11 years ago
|
||
Oh, yes. My analysis was incorrect, but the symptoms are still real. :-)
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
| Assignee | ||
Comment 3•11 years ago
|
||
| Assignee | ||
Updated•11 years ago
|
Assignee: wtc → ehsan
| Assignee | ||
Updated•11 years ago
|
Attachment #8451185 -
Flags: review?(wtc)
Comment 4•11 years ago
|
||
Comment on attachment 8451185 [details] [diff] [review]
Do not hardcode cl.exe as the NSPR compiler on Windows; r=wtc
I sanity checked that this builds fine on Windows without setting CC in the environment.
Attachment #8451185 -
Flags: review?(wtc) → review+
Comment 5•11 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 6•11 years ago
|
||
Thanks, Ted! Should I add a NSPR_4_10_7_BETA3 tag to NSPR and merge this and bug 979278 to m-c?
Flags: needinfo?(ted)
| Assignee | ||
Comment 7•11 years ago
|
||
Landed on inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/51895ae51261
Flags: needinfo?(ted)
Updated•11 years ago
|
OS: Mac OS X → Windows 7
Priority: -- → P1
Hardware: x86 → All
Target Milestone: --- → 4.10.7
Comment 9•11 years ago
|
||
Comment on attachment 8451185 [details] [diff] [review]
Do not hardcode cl.exe as the NSPR compiler on Windows; r=wtc
Review of attachment 8451185 [details] [diff] [review]:
-----------------------------------------------------------------
r=wtc.
::: nsprpub/configure.in
@@ +1919,5 @@
> AR='lib -NOLOGO -OUT:"$@"'
> AR_FLAGS=
> RANLIB='echo not_ranlib'
> STRIP='echo not_strip'
> RC=rc.exe
LD, AR, and RC are also hardcoded. I guess "if it ain't broke,
don't fix it"?
Attachment #8451185 -
Flags: superreview+
| Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Wan-Teh Chang from comment #9)
> Comment on attachment 8451185 [details] [diff] [review]
> Do not hardcode cl.exe as the NSPR compiler on Windows; r=wtc
>
> Review of attachment 8451185 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> r=wtc.
>
> ::: nsprpub/configure.in
> @@ +1919,5 @@
> > AR='lib -NOLOGO -OUT:"$@"'
> > AR_FLAGS=
> > RANLIB='echo not_ranlib'
> > STRIP='echo not_strip'
> > RC=rc.exe
>
> LD, AR, and RC are also hardcoded. I guess "if it ain't broke,
> don't fix it"?
Yes. :-)
You need to log in
before you can comment on or make changes to this bug.
Description
•