Re: Failed building NSS 3.44 on MacOSX

2019-06-26 Thread Martin Thomson
https://bugzilla.mozilla.org/show_bug.cgi?id=1561510 is where we should
keep discussing this.

On Wed, Jun 26, 2019 at 4:19 PM Martin Thomson  wrote:

> OK, this looks like I hit a problem in my system (which I only use
> rarely).  I am now hitting your issue.
>
> This is a failure in Bug 1310168. I don't know why this hasn't manifest
> before now, but the code there is not working as designed, which can you
> can see from this test:
>
> ```
> CC=a b c
> TEST := CC="$(CC)"
> TEST := $(filter-out b c,$(TEST))
> all:
> echo '<$(TEST)>'
> ```
>
> For some reason CC is being configured as 'CC -arch x86_64', but the fix
> in
> https://hg.mozilla.org/projects/nss/rev/ad2a42aed57a01cfc1d8b14fad8c782f52e17093
> doesn't work here if these arguments are at the end of the string.  Maybe
> it is because the version of make we now have on mac quotes the arguments
> (as it should). The fix is simple enough; I'll get something in review soon.
>
>
>
>
>
> On Wed, Jun 26, 2019 at 3:30 PM John Jiang 
> wrote:
>
>> Hi Martin,
>> Thanks for your reply!
>>
>> On Wed, Jun 26, 2019 at 8:58 AM Martin Thomson  wrote:
>>
>> > I had trouble myself, but it turns out that even if you are all up to
>> date,
>> > XCode isn't upgraded.  The error I get is the result of XCode being out
>> of
>> > date.
>> >
>> > Confirm by looking for a config.log in the NSPR directory.  If it
>> contains
>> > a message like the one below, the outdated XCode is the problem.
>> >
>> > configure:: gccconftest.c  >&5
>> > ld: malformed
>> >
>> file/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18:
>> > error: unknown enumerated scalar
>> > platform:zippered
>> >  ^~~~
>> >  file
>> >
>> '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
>> > clang: error: linker command failed with exit code 1 (use -v to see
>> > invocation)
>> >
>> I don't find such stuff in my config.log.
>>
>> My config.log contains the following lines,
>> ==
>> configure:3466: checking for C compiler version
>> configure:3475: cc x86_64 --version >&5
>> Apple LLVM version 10.0.0 (clang-1000.10.44.4)
>> Target: x86_64-apple-darwin17.7.0
>> Thread model: posix
>> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
>> configure:3486: $? = 0
>> configure:3475: cc x86_64 -v >&5
>> Apple LLVM version 10.0.0 (clang-1000.10.44.4)
>> Target: x86_64-apple-darwin17.7.0
>> Thread model: posix
>> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
>> clang: error: no such file or directory: 'x86_64'
>> configure:3486: $? = 1
>> configure:3475: cc x86_64 -V >&5
>> clang: error: argument to '-V' is missing (expected 1 value)
>> clang: error: no such file or directory: 'x86_64'
>> clang: error: no input files
>> configure:3486: $? = 1
>> configure:3475: cc x86_64 -qversion >&5
>> clang: error: unknown argument: '-qversion'
>> clang: error: no such file or directory: 'x86_64'
>> clang: error: no input files
>> configure:3486: $? = 1
>> configure:3506: checking whether the C compiler works
>> configure:3528: cc x86_64conftest.c  >&5
>> clang: error: no such file or directory: 'x86_64'
>> configure:3532: $? = 1
>> configure:3570: result: no
>> configure: failed program was:
>> | /* confdefs.h */
>> | #define PACKAGE_NAME ""
>> | #define PACKAGE_TARNAME ""
>> | #define PACKAGE_VERSION ""
>> | #define PACKAGE_STRING ""
>> | #define PACKAGE_BUGREPORT ""
>> | #define PACKAGE_URL ""
>> | #define DEBUG 1
>> | /* end confdefs.h.  */
>> |
>> | int
>> | main ()
>> | {
>> |
>> |   ;
>> |   return 0;
>> | }
>> configure:3575: error: in
>>
>> `/Users/sha.jiang/work/software/nss/nss-3.44/nspr/Darwin17.7.0_cc_64_DBG.OBJ':
>> configure:3577: error: C compiler cannot create executables
>> See `config.log' for more details
>> ==
>>
>> I also checked the config.log for NSS 3.43, it looks cc doesn't use option
>> "x86_64".
>>
>> Thanks!
>>
>>
>> >
>> > On Sun, Jun 23, 2019 at 6:27 PM John Jiang 
>> > wrote:
>> >
>> > > Hi,
>> > > I tried to build NSS 3.44 on MacOSX 10.13.6 (Darwin Kernel Version
>> > 17.7.0).
>> > > Just run "make nss_build_all" in directory nss-3.44/nss, and got the
>> > below
>> > > errors,
>> > > mkdir -p ./../nspr/Darwin17.7.0_cc_64_OPT.OBJ
>> > > cd ./../nspr/Darwin17.7.0_cc_64_OPT.OBJ ; \
>> > > CC="cc x86_64" CXX="g++ x86_64" sh ../configure \
>> > > --disable-debug --enable-optimize --enable-64bit \
>> > >
>> > >
>> >
>> --with-dist-prefix='path/to/nss-3.44/nss/../dist/Darwin17.7.0_cc_64_OPT.OBJ'
>> > > \
>> > >
>> > >
>> >
>> --with-dist-includedir='path/to/nss-3.44/nss/../dist/Darwin17.7.0_cc_64_OPT.OBJ/include'
>> > > checking build system type... x86_64-apple-darwin17.7.0
>> > > checking host system type... x86_64-apple-darwin17.7.0
>> > > checking target system type... x86_64-apple-darwin17.7.0
>> > > checking for whoami... /usr/bin/whoami
>> > > checking for gcc... cc x86_64
>> > > checking whether the C compiler 

Re: Failed building NSS 3.44 on MacOSX

2019-06-26 Thread Martin Thomson
OK, this looks like I hit a problem in my system (which I only use
rarely).  I am now hitting your issue.

This is a failure in Bug 1310168. I don't know why this hasn't manifest
before now, but the code there is not working as designed, which can you
can see from this test:

```
CC=a b c
TEST := CC="$(CC)"
TEST := $(filter-out b c,$(TEST))
all:
echo '<$(TEST)>'
```

For some reason CC is being configured as 'CC -arch x86_64', but the fix in
https://hg.mozilla.org/projects/nss/rev/ad2a42aed57a01cfc1d8b14fad8c782f52e17093
doesn't work here if these arguments are at the end of the string.  Maybe
it is because the version of make we now have on mac quotes the arguments
(as it should). The fix is simple enough; I'll get something in review soon.





On Wed, Jun 26, 2019 at 3:30 PM John Jiang  wrote:

> Hi Martin,
> Thanks for your reply!
>
> On Wed, Jun 26, 2019 at 8:58 AM Martin Thomson  wrote:
>
> > I had trouble myself, but it turns out that even if you are all up to
> date,
> > XCode isn't upgraded.  The error I get is the result of XCode being out
> of
> > date.
> >
> > Confirm by looking for a config.log in the NSPR directory.  If it
> contains
> > a message like the one below, the outdated XCode is the problem.
> >
> > configure:: gccconftest.c  >&5
> > ld: malformed
> >
> file/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18:
> > error: unknown enumerated scalar
> > platform:zippered
> >  ^~~~
> >  file
> >
> '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
> > clang: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> >
> I don't find such stuff in my config.log.
>
> My config.log contains the following lines,
> ==
> configure:3466: checking for C compiler version
> configure:3475: cc x86_64 --version >&5
> Apple LLVM version 10.0.0 (clang-1000.10.44.4)
> Target: x86_64-apple-darwin17.7.0
> Thread model: posix
> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
> configure:3486: $? = 0
> configure:3475: cc x86_64 -v >&5
> Apple LLVM version 10.0.0 (clang-1000.10.44.4)
> Target: x86_64-apple-darwin17.7.0
> Thread model: posix
> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
> clang: error: no such file or directory: 'x86_64'
> configure:3486: $? = 1
> configure:3475: cc x86_64 -V >&5
> clang: error: argument to '-V' is missing (expected 1 value)
> clang: error: no such file or directory: 'x86_64'
> clang: error: no input files
> configure:3486: $? = 1
> configure:3475: cc x86_64 -qversion >&5
> clang: error: unknown argument: '-qversion'
> clang: error: no such file or directory: 'x86_64'
> clang: error: no input files
> configure:3486: $? = 1
> configure:3506: checking whether the C compiler works
> configure:3528: cc x86_64conftest.c  >&5
> clang: error: no such file or directory: 'x86_64'
> configure:3532: $? = 1
> configure:3570: result: no
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME ""
> | #define PACKAGE_TARNAME ""
> | #define PACKAGE_VERSION ""
> | #define PACKAGE_STRING ""
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE_URL ""
> | #define DEBUG 1
> | /* end confdefs.h.  */
> |
> | int
> | main ()
> | {
> |
> |   ;
> |   return 0;
> | }
> configure:3575: error: in
>
> `/Users/sha.jiang/work/software/nss/nss-3.44/nspr/Darwin17.7.0_cc_64_DBG.OBJ':
> configure:3577: error: C compiler cannot create executables
> See `config.log' for more details
> ==
>
> I also checked the config.log for NSS 3.43, it looks cc doesn't use option
> "x86_64".
>
> Thanks!
>
>
> >
> > On Sun, Jun 23, 2019 at 6:27 PM John Jiang 
> > wrote:
> >
> > > Hi,
> > > I tried to build NSS 3.44 on MacOSX 10.13.6 (Darwin Kernel Version
> > 17.7.0).
> > > Just run "make nss_build_all" in directory nss-3.44/nss, and got the
> > below
> > > errors,
> > > mkdir -p ./../nspr/Darwin17.7.0_cc_64_OPT.OBJ
> > > cd ./../nspr/Darwin17.7.0_cc_64_OPT.OBJ ; \
> > > CC="cc x86_64" CXX="g++ x86_64" sh ../configure \
> > > --disable-debug --enable-optimize --enable-64bit \
> > >
> > >
> >
> --with-dist-prefix='path/to/nss-3.44/nss/../dist/Darwin17.7.0_cc_64_OPT.OBJ'
> > > \
> > >
> > >
> >
> --with-dist-includedir='path/to/nss-3.44/nss/../dist/Darwin17.7.0_cc_64_OPT.OBJ/include'
> > > checking build system type... x86_64-apple-darwin17.7.0
> > > checking host system type... x86_64-apple-darwin17.7.0
> > > checking target system type... x86_64-apple-darwin17.7.0
> > > checking for whoami... /usr/bin/whoami
> > > checking for gcc... cc x86_64
> > > checking whether the C compiler works... no
> > > configure: error: in
> `path/to/nss-3.44/nspr/Darwin17.7.0_cc_64_OPT.OBJ':
> > > configure: error: C compiler cannot create executables
> > > See `config.log' for more details
> > > make: *** [../nspr/Darwin17.7.0_cc_64_OPT.OBJ/config.status] Error 77
> > >
> > > but on the same machine, I didn't get any