Subject: port-sparc/2434: SPARC profiling kernels do not build
To: None <gnats-bugs@NetBSD.ORG>
From: None <abrown@eecs.harvard.edu>
List: netbsd-bugs
Date: 05/18/1996 10:57:20
>Number:         2434
>Category:       port-sparc
>Synopsis:       SPARC profiling kernels do not build
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 18 11:20:01 1996
>Last-Modified:
>Originator:     Aaron Brown
>Organization:
Harvard University Computer Science Department
>Release:        NetBSD-current 18 May 1996
>Environment:
SPARCstation-20, SuperSPARC-II processor
User programs and libraries current as of May 3.
System: NetBSD virtual4 1.1B NetBSD 1.1B (VIRTUAL4) #24: Fri May 3 23:08:57 EDT 1996 abrown@virtual4:/usr/src/sys/arch/sparc/compile/VIRTUAL4 sparc


>Description:
I configured a Sparc profiling kernel with "config -p GENERIC"
During the build, genassym would not build with the following error:
	cc -o genassym genassym.o
	ld: genassym.o: RRS text relocation at 0x2a60 for "mcount"
	ld: genassym.o: RRS text relocation at 0x2ab0 for "mcount"
	ld: genassym.o: RRS text relocation at 0x2e5c for "mcount"
	./genassym >assym.h
	Segmentation fault
	*** Error code 139

	Stop.
I copied a genassym from a non-profiling build and managed to get a working
assym.h. Then I ran into this problem:

cc  -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -I. -I../../../../arch -I../../../.. -DGPROF -DSUN4 -DSUN4C -DSUN4M -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DLKM -DCOMPAT_43 -DCOMPAT_10 -DCOMPAT_11 -DCOMPAT_SUNOS -DCOMPAT_SVR4 -DFFS -DQUOTA -DNFSSERVER -DNFSCLIENT -DKERNFS -DNULLFS -DMFS -DFDESC -DUMAPFS -DLFS -DPORTAL -DPROCFS -DCD9660 -DUNION -DFIFO -DINET -DTCP_COMPAT_42 -DRASTERCONSOLE -D_KERNEL -pg -c ../../../../kern/kern_clock.c
cc1: warnings being treated as errors
machine/profile.h:69: warning: `_mcount' declared `static' but never defined
*** Error code 1

Stop.

I fixed this by removing the "static" specifier in the declaration of 
_MCOUNT_DECL in sparc/include/profile.h. But I seem to remember this caused
some problem in building libc. 

>How-To-Repeat:
cd /sys/arch/sparc/conf
config -p GENERIC
cd ../compile/GENERIC
make
*boom*

>Fix:
The second problem can be fixed by removing "static" in profile.h. But this
might cause problems elsewhere.

I have no idea what the first error message even means.
>Audit-Trail:
>Unformatted: