[BACK]Return to Makefile.rump CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / rump

Annotation of src/sys/rump/Makefile.rump, Revision 1.52.2.3

1.52.2.2  rmind       1: #      $NetBSD$
1.1       pooka       2: #
                      3:
1.33      lukem       4: WARNS?=                3       # XXX: src/sys won't compile with -Wsign-compare yet
1.10      pooka       5: NOLINT=                # kernel code
1.1       pooka       6:
1.20      pooka       7: .include <bsd.own.mk>
                      8:
1.51      pooka       9: # If RUMPKMOD is _not_ set (only on capable archs, from bsd.own.mk),
                     10: # use rump ABI instead of the NetBSD kernel ABI.
1.31      he         11: .ifndef RUMPKMOD
1.18      pooka      12: CPPFLAGS:=     -I${RUMPTOP}/include ${CPPFLAGS}
1.52.2.1  rmind      13: CPPFLAGS+=     -D_RUMPKERNEL
                     14: .else
                     15: CPPFLAGS+=     -D_RUMP_NATIVE_ABI
1.18      pooka      16: .endif
                     17:
1.22      pooka      18: CFLAGS+=       -ffreestanding -fno-strict-aliasing
1.52.2.3! rmind      19: .if defined(HAVE_GCC) && ${HAVE_GCC} >= 3
        !            20: CFLAGS+=       -Wsign-compare
        !            21: CFLAGS+=       -Wno-pointer-sign -Wno-attributes
        !            22: CFLAGS+=       -std=gnu99
        !            23: .endif
1.50      pooka      24: CWARNFLAGS+=   -Wno-format-zero-length -Wno-pointer-sign
1.23      pooka      25: CPPFLAGS+=     -D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR
1.21      pooka      26: CPPFLAGS+=     -DMAXUSERS=32
1.17      pooka      27: CPPFLAGS+=     -DDIAGNOSTIC
1.52.2.2  rmind      28: CPPFLAGS+=     -DCOMPAT_50=1
1.38      pooka      29: CPPFLAGS+=     -DDEBUGPRINT
1.15      pooka      30: CPPFLAGS+=     -I${.CURDIR} -I.
1.52.2.2  rmind      31: CPPFLAGS+=     -I${RUMPTOP}/../../common/include -isystem ${RUMPTOP}/../arch
1.18      pooka      32: CPPFLAGS+=     -I${RUMPTOP}/include
1.21      pooka      33: CPPFLAGS+=     -I${RUMPTOP}/librump/rumpkern/opt
1.52.2.2  rmind      34: CPPFLAGS+=     -nostdinc -isystem ${RUMPTOP}/..
1.45      pooka      35: LDFLAGS+=      -T ${RUMPTOP}/ldscript.rump
1.10      pooka      36: #CPPFLAGS+=    -DDEBUG
1.1       pooka      37:
1.52.2.2  rmind      38: .ifdef RUMP_LOCKDEBUG
                     39: CPPFLAGS+=     -DLOCKDEBUG
                     40: .endif
                     41:
1.42      pooka      42: # kernel libs should not get linked against libc
1.43      pooka      43: # XXX: actually, we would like to enable this but cannot, since it
                     44: # also leaves out libgcc, it causes problems on some platforms.
                     45: # revisit some day.
                     46: #LDFLAGS+=     -nodefaultlibs
1.42      pooka      47:
1.39      pooka      48: # make sure __NetBSD__ gets defined (for builds on non-NetBSD)
                     49: CPPFLAGS+=     -D__NetBSD__
                     50:
1.11      pooka      51: RUMPKERNEL=    This is NetBSD and I am the rump.  Good evening.
                     52:
1.13      pooka      53: # workaround: evbppc is not a well-defined arch
                     54: .if (${MACHINE} == "evbppc")
1.16      pooka      55: CPPFLAGS+=     -DPPC_OEA
1.13      pooka      56: .endif
                     57:
1.25      pooka      58: # If this file changes, we need a full rebuild
                     59: DPSRCS+=       ${RUMPTOP}/Makefile.rump
1.24      pooka      60:
                     61: #
                     62: # Rename library symbols before use.  If a symbol does not already belong
                     63: # to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns".  This
                     64: # avoids accidentally linking any kernel symbol against host platform
                     65: # libraries.  The only non-renamed symbols are linkset delimiters and
                     66: # the GOT, which are more a property of the compiler than the kernel.
                     67: #
1.29      pooka      68: # Some toolchains generate unresolved symbols which are supposed to be
                     69: # satisfied by the toolchain itself when the program is linked.
                     70: # Unfortunately, we do not know which of the symbols are generated by
                     71: # the toolchain.  Worse, they vary from platform to platform and
                     72: # toolchain to toolchain.  The good news, however, is that this will
                     73: # be detected by a compile-time failure, so we can fairly easily manage
                     74: # a quirktable here.
1.46      pooka      75: #
                     76: # We also allow calling ourselves externally with e.g.:
                     77: # make -f /sys/rump/Makefile.rump RUMP_SYMREN=ffs.kobj
                     78: #
1.29      pooka      79: .if ${MACHINE_CPU} == "mips"
                     80: _SYMQUIRK='|_gp_disp'
                     81: .elif ${MACHINE_CPU} == "hppa"
                     82: _SYMQUIRK='|\$$\$$'
1.52.2.1  rmind      83: .elif ${MACHINE_ARCH} == "powerpc64"
                     84: _SYMQUIRK="|PF_funcs"
                     85: .endif
                     86:
                     87: #
                     88: # Prefix quirks.  At least one toolchain generates global
                     89: # symbols with prefixes which really need to remain as prefixes
                     90: # (i.e. the '.' on the front of some ppc64 globals).  The
                     91: # way to know if you have the problem is if you get later
                     92: # complaints about symbols like 'rumpns_XrumpBLAH' or 'XrumpBLAH';
                     93: # the 'X' part was added by the toolchain and will need to
                     94: # be mentioned here.
                     95: #
                     96: .if ${MACHINE_ARCH} == "powerpc64"
                     97: _PQ="\.?"
                     98: .else
                     99: _PQ=
1.29      pooka     100: .endif
1.46      pooka     101:
                    102: rump_symren: __archivebuild
                    103: .if !defined(RUMP_SYMREN)
                    104:        @echo "Must supply RUMP_SYMREN for target rump_symren"
                    105:        @false
                    106: .endif
                    107:
                    108: # if we are called from lib build (RUMP_SYMREN is not specified),
                    109: # build the arrrrchive.  otherwise just rename symbols.
1.24      pooka     110: __archivebuild: .USE
1.46      pooka     111: .if defined(RUMP_SYMREN) && defined(RUMPTOP)
                    112:        @echo "ERROR: RUMP_SYMREN can only be used standalone"
                    113:        @false
                    114: .endif
                    115: .if defined(RUMP_SYMREN)
                    116:        ${_MKMSG} " symbol rename " ${RUMP_SYMREN}
                    117: .else
1.24      pooka     118:        ${_MKTARGET_BUILD}
                    119:        rm -f ${.TARGET}
1.34      pooka     120:        ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.46      pooka     121: .endif
                    122:        ${NM} -go ${RUMP_SYMREN:U${.TARGET}} | ${TOOL_AWK} '    \
1.52.2.1  rmind     123:            $$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \
                    124:              {s = $$NF; sub(/^'${_PQ}'/, "&rumpns_", s); print $$NF, s}' \
1.24      pooka     125:            | sort | uniq  > renametab.${.TARGET}
1.37      pooka     126:        ${OBJCOPY} --preserve-dates --redefine-syms \
1.46      pooka     127:            renametab.${.TARGET} ${RUMP_SYMREN:U${.TARGET}}
1.24      pooka     128:        rm -f renametab.${.TARGET}
1.46      pooka     129: .if !defined(RUMP_SYMREN)
1.36      perry     130:        ${AR} ${_ARRANFL} ${.TARGET}
1.46      pooka     131: .endif
1.47      pooka     132:
1.52.2.1  rmind     133: _BSD_IOCONF_MK_USER_=1
                    134: .include <bsd.ioconf.mk>
1.47      pooka     135:
1.44      pooka     136: .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc"
                    137: .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc"

CVSweb <webmaster@jp.NetBSD.org>