Subject: kern/14024: current (2001-09-20) src/usr.sbin/config can't build on 1.5.2
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cagney@mac.com>
List: netbsd-bugs
Date: 09/20/2001 11:03:26
>Number: 14024
>Category: kern
>Synopsis: current (2001-09-20) src/usr.sbin/config can't build on 1.5.2
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 20 11:04:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Andrew Cagney
>Release: 1.5.2 userland, more recent kernel
>Organization:
>Environment:
NetBSD localhost 1.5X NetBSD 1.5X (NETLUX) #0: Fri Aug 24 19:03:24 EDT 2001 boor@localhost:/usr/src/sys/arch/macppc/compile/NETLUX macppc
>Description:
Ref notes:
http://www.netbsd.org/Documentation/kernel/#how_to_build_a_kernel
It is not possible to build a current usr.sbin/config using 1.5.2 userland:
bash-2.04# make
...
cc -O -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -I/usr/src/usr.sbin/config -I. -c main.c
cc1: warnings being treated as errors
main.c: In function `main':
main.c:113: warning: implicit declaration of function `setprogname'
*** Error code 1
gaging the warning results in:
bash-2.04# make CFLAGS=-g
....
cc -o config files.o gram.o hash.o main.o mkheaders.o mkioconf.o mkmakefile.o mkswap.o pack.o scan.o sem.o util.o
main.o: In function `main':
/usr/src/usr.sbin/config/main.c:113: undefined reference to `setprogname'
collect2: ld returned 1 exit status
*** Error code 1
and specifying ``-DMAKE_BOOTSTRAP'' doesn't help either.
>How-To-Repeat:
See ``Full Description''.
>Fix:
The patch below gets:
# make CFLAGS=-DMAKE_BOOTSTRAP
to work
bash-2.04# diff -c main.c new-main.c
*** main.c Thu Sep 20 13:55:20 2001
--- new-main.c Thu Sep 20 13:15:14 2001
***************
*** 110,116 ****
--- 110,120 ----
const char *last_component;
int pflag, ch;
+ #ifdef MAKE_BOOTSTRAP
+ progname = argv[0];
+ #else
setprogname(argv[0]);
+ #endif
pflag = 0;
while ((ch = getopt(argc, argv, "DPgpvb:s:")) != -1) {
>Release-Note:
>Audit-Trail:
>Unformatted: