Fix GCC image building
This commit is contained in:
parent
a97a80178e
commit
b956c8735e
42 changed files with 64 additions and 57 deletions
|
@ -1,7 +1,7 @@
|
|||
.if (${NBSD_LIBC} != "no")
|
||||
.if ${COMPILER_TYPE} == "gnu"
|
||||
CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE
|
||||
LDADD+= -lminlib -lcompat_minix
|
||||
DEPEND+= ${LIBMINLIB} ${LIBCOMPAT_MINIX}
|
||||
DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX}
|
||||
.else
|
||||
CPPFLAGS+= -D_MINIX -D_POSIX_SOURCE
|
||||
.endif
|
||||
|
|
|
@ -149,6 +149,6 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
||||
.endif
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -14,4 +14,4 @@ BINDIR?= /usr/sbin
|
|||
debug= 0
|
||||
CPPFLAGS+= -Ddebug=${debug} -w
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -14,4 +14,4 @@ BINDIR?= /usr/sbin
|
|||
debug= 0
|
||||
CPPFLAGS+= -Ddebug=$(debug)
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
|
|||
|
||||
CPPFLAGS+= -DDEBUG=1 -DDEBUG2=0
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
|
|||
|
||||
CPPFLAGS.orinoco.c+= -I${MINIXSRCDIR}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -159,4 +159,4 @@ elfstrip: $(PROGRAMS)
|
|||
strip $(PROGRAMS)
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -13,5 +13,5 @@ BINDIR?= /usr/sbin
|
|||
|
||||
CPPFLAGS.random.c+= -I${MINIXSRCDIR}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
||||
|
|
|
@ -11,4 +11,4 @@ BINDIR?= /sbin
|
|||
|
||||
CPPFLAGS+= -D_SYSTEM=1
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
|
|||
|
||||
CPPFLAGS+= -I${MINIXSRCDIR}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ BINDIR?= /usr/sbin
|
|||
|
||||
CPPFLAGS+= -I${MINIXSRCDIR}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -22,26 +22,17 @@ CFLAGS += -D__kernel__
|
|||
LDFLAGS+= -.o
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
CFLAGS+=-march=i386
|
||||
CPPFLAGS+= -ffreestanding -fno-stack-protector
|
||||
CPPFLAGS+= -ffreestanding -fno-stack-protector -D_NETBSD_SOURCE
|
||||
LDFLAGS+= -T ${.CURDIR}/arch/${ARCH}/kernel.lds
|
||||
LDFLAGS+= -nostdlib -L${LIBDIR}
|
||||
.endif
|
||||
|
||||
.if (${NBSD_LIBC} != "no")
|
||||
LDADD+= -lminlib
|
||||
DPADD+= ${LIBMINLIB}
|
||||
CPPFLAGS+= -D_NETBSD_SOURCE
|
||||
.else
|
||||
|
||||
.if ${CC} == "gcc"
|
||||
DPADD+= ${LIBC}
|
||||
LDADD+= -lgcc -lc -lgcc
|
||||
LDADD+= -lgcc -lsys -lgcc
|
||||
.elif ${CC} == "clang"
|
||||
LDADD+= -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic
|
||||
DPADD+= ${LIBC}
|
||||
LDADD+= -L/usr/pkg/lib
|
||||
LDADD+= -lCompilerRT-Generic -lc -lCompilerRT-Generic
|
||||
.endif
|
||||
|
||||
.endif
|
||||
|
||||
CPPFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${ARCH}/include -I${MINIXSRCDIR}
|
||||
|
|
|
@ -244,6 +244,8 @@ int posix_memalign(void **, size_t, size_t);
|
|||
void *alloca(int); /* built-in for gcc */
|
||||
#elif defined(__PCC__) && !defined(__GNUC__)
|
||||
#define alloca(size) __builtin_alloca(size)
|
||||
#elif (__GNUC__ >= 2)
|
||||
#define alloca(size) __builtin_alloca(size)
|
||||
#else
|
||||
void *alloca(size_t);
|
||||
#endif /* __GNUC__ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.if (${NBSD_LIBC} != "no")
|
||||
.if ${COMPILER_TYPE} == "gnu"
|
||||
CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE
|
||||
LDADD+= -lminlib -lcompat_minix
|
||||
DPADD+= ${LIBMINLIB} ${LIBCOMPAT_MINIX}
|
||||
|
|
|
@ -9,4 +9,4 @@ BINDIR?= /sbin
|
|||
INSTALLFLAGS+= -S 128k
|
||||
|
||||
MAN=
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -16,4 +16,4 @@ INSTALLFLAGS+= -S 128k
|
|||
DEFAULT_NR_BUFS= 1024
|
||||
CPPFLAGS+= -DDEFAULT_NR_BUFS=${DEFAULT_NR_BUFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ MAN=
|
|||
|
||||
BINDIR?= /sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -21,4 +21,4 @@ BINDIR?= /usr/sbin
|
|||
|
||||
CPPFLAGS+= -I${.CURDIR} -D_MINIX
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# Makefile for the init program (INIT)
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= init
|
||||
SRCS= init.c
|
||||
|
||||
|
@ -7,4 +9,8 @@ MAN=
|
|||
BINDIR?= /usr/sbin
|
||||
INSTALLFLAGS+= -S 64k
|
||||
|
||||
.include <minix.bootprog.mk>
|
||||
.if ${OBJECT_FMT} == "ELF"
|
||||
LDFLAGS+= -Wl,--section-start=.init=0x0
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
|
@ -9,4 +9,4 @@ MAN=
|
|||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -13,4 +13,4 @@ CPPFLAGS.dmp_kernel.c+= -I${MINIXSRCDIR}
|
|||
CPPFLAGS.dmp_rs.c+= -I${MINIXSRCDIR}
|
||||
CPPFLAGS.dmp_vm.c+= -I${MINIXSRCDIR}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -13,4 +13,4 @@ BINDIR?= /sbin
|
|||
NR_BUFS= 100
|
||||
CPPFLAGS+= -DNR_BUFS=${NR_BUFS}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -23,4 +23,4 @@ CPPFLAGS+= -I${.CURDIR}/../../lib/liblwip/include
|
|||
|
||||
CFLAGS += -Wextra -std=c99
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,4 +11,4 @@ MAN=
|
|||
|
||||
BINDIR?= /sbin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
|
@ -11,7 +11,7 @@ FILES= bsd.ack.mk bsd.dep.mk bsd.files.mk \
|
|||
pkgsrchooks.mk sys.mk
|
||||
|
||||
# MINIX-specific files
|
||||
FILES+= minix.bootprog.mk
|
||||
FILES+= minix.bootprog.mk minix.service.mk
|
||||
|
||||
FILESDIR=/usr/share/mk
|
||||
.endif
|
||||
|
|
|
@ -187,12 +187,6 @@ _LDADD.${_P}= ${LDADD} ${LDADD.${_P}}
|
|||
_LDFLAGS.${_P}= ${LDFLAGS} ${LDFLAGS.${_P}}
|
||||
_LDSTATIC.${_P}= ${LDSTATIC} ${LDSTATIC.${_P}}
|
||||
|
||||
.if defined(NBSD_LIBC) && (${NBSD_LIBC} == "yes") && \
|
||||
!empty(_LDADD.${_P}:M-lsys)
|
||||
# defined(USE_LIBSYS) && (${USE_LIBSYS} == "yes")
|
||||
_LDADD.${_P}+= -nodefaultlibs -lgcc -lsys -lgcc
|
||||
.endif
|
||||
|
||||
##### Build and install rules
|
||||
.if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
|
||||
SRCS+= ${SRCS.${_P}} # For bsd.dep.mk
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
LDFLAGS+= -Wl,--section-start=.init=0x0
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <minix.service.mk>
|
||||
|
|
14
share/mk/minix.service.mk
Normal file
14
share/mk/minix.service.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
# MINIX-specific servers/drivers options
|
||||
.include <bsd.own.mk>
|
||||
|
||||
.if ${COMPILER_TYPE} == "gnu"
|
||||
|
||||
.if ${CC} == "gcc"
|
||||
LDADD+= -nodefaultlibs -lgcc -lsys -lgcc
|
||||
.elif ${CC} == "clang"
|
||||
LDADD+= -nodefaultlibs -L/usr/pkg/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic
|
||||
.endif
|
||||
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
Loading…
Reference in a new issue