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 <> 
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 <>:

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

Index: share/mk/
RCS file: /cvs/master/m-NetBSD/main/src/share/mk/,v
retrieving revision 1.99
diff -u -r1.99
--- share/mk/     7 Sep 2008 15:54:52 -0000       1.99
+++ share/mk/     12 Apr 2010 22:34:58 -0000
@@ -14,9 +14,9 @@
 AS?=           as
 COMPILE.s?=    ${CC} ${AFLAGS} -c
-LINK.s?=       ${CC} ${AFLAGS} ${LDFLAGS}
+LINK.s?=       ${CC} ${AFLAGS} ${LDSTATIC} ${LDFLAGS}
 COMPILE.S?=    ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
 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
-DBG?=  -O
+OPTIM?=        -O
-CFLAGS?=       ${DBG}
+DBG?=          # nothing -- just defined
+OPTIM?=                # nothing -- just defined
+CFLAGS?=       ${OPTIM} ${DBG}
 COMPILE.c?=    ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?=       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.c?=       ${CC} ${CFLAGS} ${LDSTATIC} ${LDFLAGS}
 CXX?=          c++
@@ -58,12 +61,12 @@
 OBJC?=         ${CC}
 CPP?=          cpp
@@ -72,11 +75,11 @@
 FFLAGS?=       -O
 COMPILE.f?=    ${FC} ${FFLAGS} -c
-LINK.f?=       ${FC} ${FFLAGS} ${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
 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.

<>       +1 250 762-7675

Attachment: pgp1qDr3lTfkv.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index