NetBSD resynchronization fixes
Change-Id: I99b109890de1d555e2ff023c62a38f78e4cfc6b3
This commit is contained in:
parent
57ca7ad105
commit
df29ad7c0e
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
.include <bsd.init.mk>
|
.include <bsd.init.mk>
|
||||||
|
|
||||||
|
.if defined(__MINIX)
|
||||||
|
.PATH: ${SRCDIR}
|
||||||
|
.endif # defined(__MINIX)
|
||||||
|
|
||||||
.if ${MKSHARE} != "no"
|
.if ${MKSHARE} != "no"
|
||||||
FILESDIR= /usr/share/doc/reference/ref1/kyua/kyua-atf-compat
|
FILESDIR= /usr/share/doc/reference/ref1/kyua/kyua-atf-compat
|
||||||
FILESMODE= 444
|
FILESMODE= 444
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
.include <bsd.init.mk>
|
.include <bsd.init.mk>
|
||||||
|
|
||||||
|
.if defined(__MINIX)
|
||||||
|
.PATH: ${SRCDIR}
|
||||||
|
.endif # defined(__MINIX)
|
||||||
|
|
||||||
FILES= lib.subr tests_lib.subr
|
FILES= lib.subr tests_lib.subr
|
||||||
FILESDIR= /usr/share/kyua-atf-compat
|
FILESDIR= /usr/share/kyua-atf-compat
|
||||||
FILESMODE= 444
|
FILESMODE= 444
|
||||||
|
|
|
||||||
2
external/bsd/llvm/Makefile.inc
vendored
2
external/bsd/llvm/Makefile.inc
vendored
|
|
@ -75,7 +75,7 @@ CPPFLAGS+= -D_NLS_PRIVATE=1
|
||||||
.endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
.endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
|
||||||
.endif # !defined(__MINIX)
|
.endif # !defined(__MINIX)
|
||||||
|
|
||||||
LLVM_CONFIGURE_ARGS= \
|
LLVM_CONFIGURE_ARGS+= \
|
||||||
--enable-targets=x86,powerpc,sparc,aarch64,arm,mips \
|
--enable-targets=x86,powerpc,sparc,aarch64,arm,mips \
|
||||||
--with-c-include-dirs=/usr/include/clang-${CLANG_VERSION:R}:/usr/include \
|
--with-c-include-dirs=/usr/include/clang-${CLANG_VERSION:R}:/usr/include \
|
||||||
--disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
|
--disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ __RCSID("$NetBSD: abort.c,v 1.15 2012/06/08 11:15:26 abs Exp $");
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#if !defined(__minix) || !defined(_LIBMINC)
|
||||||
extern void (*__cleanup)(void);
|
extern void (*__cleanup)(void);
|
||||||
static int aborting = 0;
|
static int aborting = 0;
|
||||||
|
|
||||||
|
|
@ -82,3 +83,13 @@ abort(void)
|
||||||
(void)raise(SIGABRT);
|
(void)raise(SIGABRT);
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* defined(__minix) && defined(_LIBMINC) */
|
||||||
|
void
|
||||||
|
abort(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* We cannot use signals from system services. */
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
#endif /* defined(__minix) && defined(_LIBMINC) */
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,13 @@ extracted-mtype.h: extract-mtype.sh ../include/minix/com.h
|
||||||
cd ${.CURDIR} ; ${HOST_SH} extract-mtype.sh > ${.OBJDIR}/extracted-mtype.h
|
cd ${.CURDIR} ; ${HOST_SH} extract-mtype.sh > ${.OBJDIR}/extracted-mtype.h
|
||||||
|
|
||||||
.if ${USE_BITCODE:Uno} == "yes"
|
.if ${USE_BITCODE:Uno} == "yes"
|
||||||
|
# dcvmoole: this is a copy of the "${_P}: ${_P}.bcl.o" block from bsd.prog.mk,
|
||||||
|
# with two changes: 1) ${OBJS} is added so as to link in objects that have not
|
||||||
|
# been compiled with bitcode, and 2) we are directly loading the gold plugin
|
||||||
|
# rather than through ${BITCODE_LD_FLAGS_2ND.kernel}, because LLVMgold will
|
||||||
|
# not load libLTO when no LTO can be performed (due to the non- bitcode
|
||||||
|
# objects), causing it to fail on unrecognized -disable-opt/-disable-inlining
|
||||||
|
# options. At least I think that's what's going on? I'm no expert here..
|
||||||
kernel: kernel.bcl.o
|
kernel: kernel.bcl.o
|
||||||
${_MKTARGET_LINK}
|
${_MKTARGET_LINK}
|
||||||
${_CCLINK.kernel} \
|
${_CCLINK.kernel} \
|
||||||
|
|
@ -89,7 +96,7 @@ kernel: kernel.bcl.o
|
||||||
-L${DESTDIR}/usr/lib \
|
-L${DESTDIR}/usr/lib \
|
||||||
${_LDSTATIC.kernel} -o ${.TARGET} \
|
${_LDSTATIC.kernel} -o ${.TARGET} \
|
||||||
${.TARGET}.bcl.o ${OBJS} ${_PROGLDOPTS} ${_LDADD.kernel} \
|
${.TARGET}.bcl.o ${OBJS} ${_PROGLDOPTS} ${_LDADD.kernel} \
|
||||||
${BITCODE_LD_FLAGS_2ND.kernel} \
|
-Wl,-plugin=${GOLD_PLUGIN} \
|
||||||
-Wl,--allow-multiple-definition
|
-Wl,--allow-multiple-definition
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ if [ "${GENERATE_MAP}" != "" ] && [[ ${GENERATE_MAP} =~ [yY][eE][sS] ]]; then
|
||||||
generate_modules_map
|
generate_modules_map
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${OPTFLAGS="-disable-opt -disable-internalize -disable-inlining -load ${MINIX_LLVM_DIR}/bin/weak-alias-module-override.so -weak-alias-module-override"}
|
: ${OPTFLAGS="-disable-opt -disable-inlining -load ${MINIX_LLVM_DIR}/bin/weak-alias-module-override.so -weak-alias-module-override"}
|
||||||
|
|
||||||
# If we are really instrumenting with some pass...
|
# If we are really instrumenting with some pass...
|
||||||
if [ "${LLVMPASS_PATHS}" != "" ]; then
|
if [ "${LLVMPASS_PATHS}" != "" ]; then
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ cd ${OBJ_LLVM}
|
||||||
|
|
||||||
${LLVMSRCDIR}/llvm/configure \
|
${LLVMSRCDIR}/llvm/configure \
|
||||||
--enable-targets=x86 \
|
--enable-targets=x86 \
|
||||||
--with-c-include-dirs=/usr/include/clang-3.4:/usr/include \
|
--with-c-include-dirs=/usr/include/clang-3.6:/usr/include \
|
||||||
--disable-timestamps \
|
--disable-timestamps \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--sysconfdir=/etc/llvm \
|
--sysconfdir=/etc/llvm \
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@
|
||||||
(T)->contained_types = NULL; \
|
(T)->contained_types = NULL; \
|
||||||
(T)->bit_width = (S)*8; \
|
(T)->bit_width = (S)*8; \
|
||||||
(T)->name = N; \
|
(T)->name = N; \
|
||||||
sprintf(B, "i%d", (T)->bit_width); \
|
snprintf(B, sizeof(B), "i%d", (T)->bit_width); \
|
||||||
(T)->type_str = B; \
|
(T)->type_str = B; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,9 +106,9 @@
|
||||||
&& "Sentry key length too long!"); \
|
&& "Sentry key length too long!"); \
|
||||||
\
|
\
|
||||||
sentry_hash->key[0] = 0; \
|
sentry_hash->key[0] = 0; \
|
||||||
sprintf(sentry_hash->key, "%s%s%s" MAGIC_ID_FORMAT, \
|
snprintf(sentry_hash->key, sizeof(sentry_hash->key), \
|
||||||
MAGIC_DSENTRY_ABS_NAME_SEP, sentry->name, \
|
"%s%s%s" MAGIC_ID_FORMAT, MAGIC_DSENTRY_ABS_NAME_SEP, \
|
||||||
MAGIC_DSENTRY_ABS_NAME_SEP, \
|
sentry->name, MAGIC_DSENTRY_ABS_NAME_SEP, \
|
||||||
(_magic_id_t) MAGIC_DSENTRY_SITE_ID_NULL); \
|
(_magic_id_t) MAGIC_DSENTRY_SITE_ID_NULL); \
|
||||||
sentry_list->sentry = sentry; \
|
sentry_list->sentry = sentry; \
|
||||||
sentry_hash->sentry_list = sentry_list; \
|
sentry_hash->sentry_list = sentry_list; \
|
||||||
|
|
@ -123,8 +123,9 @@
|
||||||
&& "Dsentry key length too long!"); \
|
&& "Dsentry key length too long!"); \
|
||||||
\
|
\
|
||||||
sentry_hash->key[0] = 0; \
|
sentry_hash->key[0] = 0; \
|
||||||
sprintf(sentry_hash->key, "%s%s%s%s" MAGIC_ID_FORMAT, \
|
snprintf(sentry_hash->key, sizeof(sentry_hash->key), \
|
||||||
dsentry->parent_name, MAGIC_DSENTRY_ABS_NAME_SEP, sentry->name, \
|
"%s%s%s%s" MAGIC_ID_FORMAT, dsentry->parent_name, \
|
||||||
|
MAGIC_DSENTRY_ABS_NAME_SEP, sentry->name, \
|
||||||
MAGIC_DSENTRY_ABS_NAME_SEP, dsentry->site_id); \
|
MAGIC_DSENTRY_ABS_NAME_SEP, dsentry->site_id); \
|
||||||
sentry_list->sentry = sentry; \
|
sentry_list->sentry = sentry; \
|
||||||
sentry_hash->sentry_list = sentry_list; \
|
sentry_hash->sentry_list = sentry_list; \
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ LLVMGOLD_RANLIB=$(LLVMGOLD_AR) -s
|
||||||
LLVMGOLD_AR_FLAGS=--plugin $(LLVMGOLD_PLUGIN) -cru
|
LLVMGOLD_AR_FLAGS=--plugin $(LLVMGOLD_PLUGIN) -cru
|
||||||
LLVMGOLD_CFLAGS=-fasynchronous-unwind-tables -g -D_MINIX -D_POSIX_SOURCE -D_SYSTEM -Wno-long-long --sysroot=$(_MINIX_SYSROOT) -I$(LLVMINC) -I$(_MINIX_OBJ_LLVM_DIR)/include/llvm -I$(_MINIX_ROOT)/external/bsd/llvm/dist/llvm/include -I$(_MINIX_OBJ_LLVM_DIR)/include -I$(_MINIX_SYSROOT)/usr/include
|
LLVMGOLD_CFLAGS=-fasynchronous-unwind-tables -g -D_MINIX -D_POSIX_SOURCE -D_SYSTEM -Wno-long-long --sysroot=$(_MINIX_SYSROOT) -I$(LLVMINC) -I$(_MINIX_OBJ_LLVM_DIR)/include/llvm -I$(_MINIX_ROOT)/external/bsd/llvm/dist/llvm/include -I$(_MINIX_OBJ_LLVM_DIR)/include -I$(_MINIX_SYSROOT)/usr/include
|
||||||
LLVMGOLD_LINK=-Wl,--plugin -Wl,$(LLVMGOLD_PLUGIN)
|
LLVMGOLD_LINK=-Wl,--plugin -Wl,$(LLVMGOLD_PLUGIN)
|
||||||
LLVMGOLD_LINKFLAGS=-Wl,-plugin-opt=-disable-fp-elim -Wl,-plugin-opt=-disable-inlining -Wl,-plugin-opt=also-emit-llvm
|
LLVMGOLD_LINKFLAGS=-Wl,-plugin-opt=-disable-fp-elim -Wl,-plugin-opt=save-temps
|
||||||
LLVMGOLD_LINKCOMMONFLAGS=-L$(_MINIX_OBJ_DIR)/destdir.$(_MINIX_ARCH)/usr/lib -rdynamic
|
LLVMGOLD_LINKCOMMONFLAGS=-L$(_MINIX_OBJ_DIR)/destdir.$(_MINIX_ARCH)/usr/lib -rdynamic
|
||||||
LLVMGOLD_LIBS=
|
LLVMGOLD_LIBS=
|
||||||
LLVMGOLD_LDFLAGS=$(LLVMGOLD_LINK) $(LLVMGOLD_LINKFLAGS) $(LLVMGOLD_LINKCOMMONFLAGS) $(LLVMGOLD_LIBS)
|
LLVMGOLD_LDFLAGS=$(LLVMGOLD_LINK) $(LLVMGOLD_LINKFLAGS) $(LLVMGOLD_LINKCOMMONFLAGS) $(LLVMGOLD_LIBS)
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,7 @@ PUBLIC void magic_init(void)
|
||||||
|
|
||||||
/* Initialize memory pool descriptors. */
|
/* Initialize memory pool descriptors. */
|
||||||
for (i = 0; i < MAGIC_MAX_MEMPOOLS; i++) {
|
for (i = 0; i < MAGIC_MAX_MEMPOOLS; i++) {
|
||||||
sprintf(_magic_mpdescs[i].name, "%s%d%s", MAGIC_MEMPOOL_NAME_PREFIX, i, MAGIC_ALLOC_NAME_SUFFIX);
|
snprintf(_magic_mpdescs[i].name, sizeof(_magic_mpdescs[i].name), "%s%d%s", MAGIC_MEMPOOL_NAME_PREFIX, i, MAGIC_ALLOC_NAME_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize special types. */
|
/* Initialize special types. */
|
||||||
|
|
|
||||||
|
|
@ -33,16 +33,16 @@ PUBLIC int magic_selement_lookup_by_name(char *name,
|
||||||
/*
|
/*
|
||||||
* Dsentry. Will contain: sentry_id<DELIM>parent_name<DELIM>name<DELIM>site_id.
|
* Dsentry. Will contain: sentry_id<DELIM>parent_name<DELIM>name<DELIM>site_id.
|
||||||
*/
|
*/
|
||||||
delim = '\0';
|
*delim = '\0';
|
||||||
/* Skip sentry_id */
|
/* Skip sentry_id */
|
||||||
sentry_parent_name = delim + 1;
|
sentry_parent_name = delim + 1;
|
||||||
delim = strchr(delim + 1, MAGIC_DSENTRY_ABS_NAME_SEP[0]);
|
delim = strchr(delim + 1, MAGIC_DSENTRY_ABS_NAME_SEP[0]);
|
||||||
assert(!delim && "No dsentry name found in selement name!");
|
assert(!delim && "No dsentry name found in selement name!");
|
||||||
delim = '\0';
|
*delim = '\0';
|
||||||
sentry_name = delim + 1;
|
sentry_name = delim + 1;
|
||||||
delim = strchr(delim + 1, MAGIC_DSENTRY_ABS_NAME_SEP[0]);
|
delim = strchr(delim + 1, MAGIC_DSENTRY_ABS_NAME_SEP[0]);
|
||||||
assert(!delim && "No dsentry site id found in selement name!");
|
assert(!delim && "No dsentry site id found in selement name!");
|
||||||
delim = '\0';
|
*delim = '\0';
|
||||||
dsentry_site_id = strtoul((const char*)delim+1, NULL, 10);
|
dsentry_site_id = strtoul((const char*)delim+1, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -882,7 +882,7 @@ PUBLIC struct _magic_sentry *magic_sentry_lookup_by_name_hash(
|
||||||
char key[MAGIC_SENTRY_NAME_MAX_KEY_LEN];
|
char key[MAGIC_SENTRY_NAME_MAX_KEY_LEN];
|
||||||
struct _magic_sentry_hash *res, *head;
|
struct _magic_sentry_hash *res, *head;
|
||||||
key[0] = 0;
|
key[0] = 0;
|
||||||
sprintf(key, "%s%s%s%s" MAGIC_ID_FORMAT, parent_name,
|
snprintf(key, sizeof(key), "%s%s%s%s" MAGIC_ID_FORMAT, parent_name,
|
||||||
MAGIC_DSENTRY_ABS_NAME_SEP, name, MAGIC_DSENTRY_ABS_NAME_SEP, site_id);
|
MAGIC_DSENTRY_ABS_NAME_SEP, name, MAGIC_DSENTRY_ABS_NAME_SEP, site_id);
|
||||||
head = (struct _magic_sentry_hash *) magic_sentry_hash_head;
|
head = (struct _magic_sentry_hash *) magic_sentry_hash_head;
|
||||||
|
|
||||||
|
|
@ -906,7 +906,7 @@ PUBLIC struct _magic_sentry_list *magic_sentry_list_lookup_by_name_hash(
|
||||||
char key[MAGIC_SENTRY_NAME_MAX_KEY_LEN];
|
char key[MAGIC_SENTRY_NAME_MAX_KEY_LEN];
|
||||||
struct _magic_sentry_hash *res, *head;
|
struct _magic_sentry_hash *res, *head;
|
||||||
key[0] = 0;
|
key[0] = 0;
|
||||||
sprintf(key, "%s%s%s%s" MAGIC_ID_FORMAT, parent_name,
|
snprintf(key, sizeof(key), "%s%s%s%s" MAGIC_ID_FORMAT, parent_name,
|
||||||
MAGIC_DSENTRY_ABS_NAME_SEP, name, MAGIC_DSENTRY_ABS_NAME_SEP, site_id);
|
MAGIC_DSENTRY_ABS_NAME_SEP, name, MAGIC_DSENTRY_ABS_NAME_SEP, site_id);
|
||||||
head = (struct _magic_sentry_hash *) magic_sentry_hash_head;
|
head = (struct _magic_sentry_hash *) magic_sentry_hash_head;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,8 @@ PUBLIC int st_add_special_mmapped_region(void *address, size_t size,
|
||||||
if (!_magic_enabled) return OK;
|
if (!_magic_enabled) return OK;
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
sprintf(addr_name, "%%MMAP_0x%08x", (unsigned int) address);
|
snprintf(addr_name, sizeof(addr_name), "%%MMAP_0x%08x",
|
||||||
|
(unsigned int) address);
|
||||||
name = addr_name;
|
name = addr_name;
|
||||||
}
|
}
|
||||||
obdsentry = magic_create_obdsentry(address, MAGIC_VOID_TYPE,
|
obdsentry = magic_create_obdsentry(address, MAGIC_VOID_TYPE,
|
||||||
|
|
|
||||||
|
|
@ -493,6 +493,8 @@ main(void)
|
||||||
|
|
||||||
start(85);
|
start(85);
|
||||||
|
|
||||||
|
setuid(geteuid());
|
||||||
|
|
||||||
signal(SIGINT, got_signal);
|
signal(SIGINT, got_signal);
|
||||||
signal(SIGABRT, got_signal);
|
signal(SIGABRT, got_signal);
|
||||||
signal(SIGSEGV, got_signal);
|
signal(SIGSEGV, got_signal);
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ GOLD_PLUGIN?=${NETBSDSRCDIR}/minix/llvm/bin/LLVMgold.so
|
||||||
# - run the passe which allows assembly weak symbols to be
|
# - run the passe which allows assembly weak symbols to be
|
||||||
# overriden by bitcode functions
|
# overriden by bitcode functions
|
||||||
OPTFLAGS?= -disable-opt \
|
OPTFLAGS?= -disable-opt \
|
||||||
-disable-internalize -disable-inlining \
|
-disable-inlining \
|
||||||
-load ${WEAKALIASOVERRIDEPASS} -weak-alias-module-override
|
-load ${WEAKALIASOVERRIDEPASS} -weak-alias-module-override
|
||||||
|
|
||||||
BITCODE_LD_FLAGS_1ST?= \
|
BITCODE_LD_FLAGS_1ST?= \
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ CFLAGS+= -Wa,--fatal-warnings
|
||||||
.if (!defined(MKPIC) || ${MKPIC} != "no") && \
|
.if (!defined(MKPIC) || ${MKPIC} != "no") && \
|
||||||
(!defined(LDSTATIC) || ${LDSTATIC} != "-static")
|
(!defined(LDSTATIC) || ${LDSTATIC} != "-static")
|
||||||
# XXX there are some strange problems not yet resolved
|
# XXX there are some strange problems not yet resolved
|
||||||
. if !defined(HAVE_GCC) || (defined(HAVE_LLVM) && !defined(USE_BITCODE))
|
. if defined(HAVE_LLVM) && !defined(USE_BITCODE)
|
||||||
LDFLAGS+= -Wl,--fatal-warnings
|
LDFLAGS+= -Wl,--fatal-warnings
|
||||||
. endif
|
. endif
|
||||||
.endif
|
.endif
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ AFLAGS.cdboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
|
||||||
.if defined(__MINIX)
|
.if defined(__MINIX)
|
||||||
# LSC: Still required by our old binutils
|
# LSC: Still required by our old binutils
|
||||||
AFLAGS.cdboot.S+= -Wa,--divide
|
AFLAGS.cdboot.S+= -Wa,--divide
|
||||||
|
|
||||||
|
USE_BITCODE=no
|
||||||
.endif # defined(__MINIX)
|
.endif # defined(__MINIX)
|
||||||
|
|
||||||
PIE_CFLAGS=
|
PIE_CFLAGS=
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@ PIE_CFLAGS=
|
||||||
PIE_LDFLAGS=
|
PIE_LDFLAGS=
|
||||||
PIE_AFLAGS=
|
PIE_AFLAGS=
|
||||||
|
|
||||||
|
.if defined(__MINIX)
|
||||||
|
USE_BITCODE=no
|
||||||
|
.endif # defined(__MINIX)
|
||||||
|
|
||||||
.include <bsd.own.mk>
|
.include <bsd.own.mk>
|
||||||
|
|
||||||
STRIPFLAG= # override
|
STRIPFLAG= # override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user