[analyzed] bmake (installed as default make): make: illegal option -- J

From: Boris Samorodov <bsam_at_passap.ru>
Date: Mon, 20 May 2013 13:53:28 +0400
17.05.2013 23:45, Florent Peterschmitt пишет:
> Hi,
> 
> With the r250749 revision of head, rebuilt world with make -j4
> buildworld, all was fine.
> 
> Then install new world, reboot and so:
> 
> $ cd /usr/src
> $ make -j4 kernel
> --- buildkernel ---
> make: illegal option -- J
> usage: make [-BPSXeiknpqrstv] [-C directory] [-D variable]
>         [-d flags] [-E variable] [-f makefile] [-I directory]
>         [-j max_jobs] [-m directory] [-V variable]
>         [variable=value] [target ...]
> *** [buildkernel] Error code 2
> 
> make: stopped in /usr/src
> 1 error
> 
> make: stopped in /usr/src
> 
> It's not from bmake itself because if I build something anywhere (like
> bmake itself), -jx works.
> 
> I tried to look in Makefile* and a grep -rn "JFLAG" in /usr/share/mk/,
> but I really don't know where and what to search, sorry :(
> 
> Can someone help ?

Seems to be a feature of the CURRENT build infrastructure.

I have got almost two identical systems FreeBSD 10-amd64
which I update several times a week. One is affected while
the other is not.

I managed to build/install world/kernel without '-j' option.
But this did not help to recover '-j' option. Here is my further
investigation.

At the affected system I run "make -j 5" under ktrace. Here is the
relevant part of kdump:
-----
[...]
 38629 sh       CALL  read(0,0x624100,0x400)
 38629 sh       GIO   fd 0 read 247 bytes
       "{ cd /usr/src; PATH=/sbin:/bin:/usr/sbin:/usr/bin `if [ -x
/usr/obj/usr/src/make.amd64/make ]; then echo /usr/obj/usr/src/make.a"
 38629 sh       RET   read 247/0xf7
[...]
 38629 sh       CALL  wait4(0xffffffff,0x7fffffffd5f4,0<><invalid>0,0)
 38631 sh       CALL  execve(0x801889778,0x8018898a0,0x8018898e8)
 38631 sh       NAMI  "/usr/obj/usr/src/make.amd64/make"
 38631 make     RET   execve 0
[...]
 38631 make     CALL  write(0x2,0x7fffffffbe80,0x1a)
 38631 make     GIO   fd 2 wrote 26 bytes
       "make: illegal option -- J
       "
[...]
-----

So, if there is a file /usr/obj/usr/src/make.amd64/make, it is
launched. And if this make file is of the wrong version, it boils out.

The affected system:
-----
% uname -a
FreeBSD BB049.int.wart.ru 10.0-CURRENT FreeBSD 10.0-CURRENT #24 r250806:
Sun May 19 15:08:43 SAMT 2013
bsam_at_BB049.int.wart.ru:/usr/obj/usr/src/sys/BB64X  amd64

% LANG=C ls -l /usr/obj/usr/src/make.amd64
total 1476
-rwxr-xr-x  1 bsam  wheel  751094 May 17 14:52 bmake
-rwxr-xr-x  1 bsam  wheel  686618 May 15 23:31 make
drwxr-xr-x  3 bsam  wheel     512 Dec  9 12:19 usr

% /usr/obj/usr/src/make.amd64/make -V MAKE_VERSION
10201205300
-----

Not affected system:
-----
% uname -a
FreeBSD bsam.int.wart.ru 10.0-CURRENT FreeBSD 10.0-CURRENT #22 r250806:
Sun May 19 22:07:39 SAMT 2013
bsam_at_bsam.int.wart.ru:/usr/obj/usr/src/sys/BB64X  amd64

% LANG=C ls -l /usr/obj/usr/src/make.amd64
total 1543
-rwxr-xr-x  1 bsam  wheel  751094 May 17 14:52 bmake
-rwxr-xr-x  1 bsam  wheel  751060 May 19 16:31 make
drwxr-xr-x  3 bsam  wheel       3 Jan  5 02:18 usr

% /usr/obj/usr/src/make.amd64/make -V MAKE_VERSION
20130330
-----

So, the affected system has and uses the wrong version of
/usr/obj/usr/src/make.amd64/make. And it even is not
overritten while building (at least without -j option).

Sure, if this file is removed, the whole status-quo is restored
(i.e. the build with '-j' option proceeds).

Well, where this behaviuor is expected or not remains a question
I have no answer to.
-- 
WBR, Boris Samorodov (bsam)
FreeBSD Committer, http://www.FreeBSD.org The Power To Serve
Received on Mon May 20 2013 - 07:53:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:37 UTC