tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -current sparc build failure with MKDEBUG=yes/COPTS=-g



At Fri, 18 Nov 2011 16:57:31 +1100, matthew green <mrg%eterna.com.au@localhost> 
wrote:
Subject: re: -current sparc build failure with MKDEBUG=yes/COPTS=-g
> 
> 
> wait.  is that COPTS=-g also means "no -O"?  if so, then
> i recommend that you use "COPTS=-g -O2".  actually, i've
> always thought the right way is to set DBG, not COPTS.


I've been using something close to this for years, and then I can leave
COPTS for any other more magical things, such as "-pipe", or the various
other wacky things added there by <bsd.sys.mk>:

---------- mk.conf ----------
# Note DBG and OPTIM must not use ?= and must not be defined at all if
# you want the defaults in <sys.mk> to take effect.
#
.if ${DBG:M*-g*} == ""
DBG =           -g
.endif
#OPTIM =        -O2
---------- mk.conf ----------


Index: share/mk/sys.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/share/mk/sys.mk,v
retrieving revision 1.99
diff -u -r1.99 sys.mk
--- share/mk/sys.mk     7 Sep 2008 15:54:52 -0000       1.99
+++ share/mk/sys.mk     12 Apr 2010 22:34:58 -0000
@@ -14,9 +14,9 @@
 AS?=           as
 AFLAGS?=
 COMPILE.s?=    ${CC} ${AFLAGS} -c
-LINK.s?=       ${CC} ${AFLAGS} ${LDFLAGS}
+LINK.s?=       ${CC} ${AFLAGS} ${LDSTATIC} ${LDFLAGS}
 COMPILE.S?=    ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
-LINK.S?=       ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.S?=       ${CC} ${AFLAGS} ${LDSTATIC} ${LDFLAGS}
 
 CC?=           cc
 .if ${MACHINE_ARCH} == "alpha" || \
@@ -31,22 +31,25 @@
     ${MACHINE_ARCH} == "powerpc" || \
     ${MACHINE_ARCH} == "sparc" || \
     ${MACHINE_ARCH} == "sparc64"
-DBG?=  -O2
+OPTIM?=        -O2
 .elif ${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb"
 # -O2 is too -falign-* zealous for low-memory sh3 machines
-DBG?=  -Os -freorder-blocks
+OPTIM?=        -Os -freorder-blocks
 .elif ${MACHINE_ARCH} == "vax"
-DBG?=  -O1 -fgcse -fstrength-reduce -fgcse-after-reload
+OPTIM?=   -O1 -fgcse -fstrength-reduce -fgcse-after-reload
 .elif ${MACHINE_ARCH} == "m68000"
 # see src/doc/HACKS for details
-DBG?=  -O1
+OPTIM?=        -O1
 .else
-DBG?=  -O
+OPTIM?=        -O
 .endif
-CFLAGS?=       ${DBG}
+DBG?=          # nothing -- just defined
+OPTIM?=                # nothing -- just defined
+
+CFLAGS?=       ${OPTIM} ${DBG}
 LDFLAGS?=
 COMPILE.c?=    ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?=       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.c?=       ${CC} ${CFLAGS} ${LDSTATIC} ${LDFLAGS}
 
 CXX?=          c++
 CXXFLAGS?=     
${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu99}
@@ -58,12 +61,12 @@
 _CXXSEED?=     
${BUILDSEED:D-frandom-seed=${BUILDSEED:Q}/${__ALLSRC3:O:Q}/${.TARGET:Q}}
 
 COMPILE.cc?=   ${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?=      ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.cc?=      ${CXX} ${CXXFLAGS} ${LDSTATIC} ${LDFLAGS}
 
 OBJC?=         ${CC}
 OBJCFLAGS?=    ${CFLAGS}
 COMPILE.m?=    ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?=       ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.m?=       ${OBJC} ${OBJCFLAGS} ${LDSTATIC} ${LDFLAGS}
 
 CPP?=          cpp
 CPPFLAGS?=
@@ -72,11 +75,11 @@
 FFLAGS?=       -O
 RFLAGS?=
 COMPILE.f?=    ${FC} ${FFLAGS} -c
-LINK.f?=       ${FC} ${FFLAGS} ${LDFLAGS}
+LINK.f?=       ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS}
 COMPILE.F?=    ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?=       ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.F?=       ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS}
 COMPILE.r?=    ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?=       ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+LINK.r?=       ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS}
 
 INSTALL?=      install
 
@@ -98,7 +101,7 @@
 PC?=           pc
 PFLAGS?=
 COMPILE.p?=    ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?=       ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.p?=       ${PC} ${PFLAGS} ${LDSTATIC} ${LDFLAGS}
 
 SHELL?=                sh
 


-- 
                                                Greg A. Woods
                                                Planix, Inc.

<woods%planix.com@localhost>       +1 250 762-7675        http://www.planix.com/

Attachment: pgp1qDr3lTfkv.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index