Undo previous; breaks macppc/m68k (at least)

This commit is contained in:
christos 2018-12-28 18:17:10 +00:00
parent 3cc63623bb
commit 12faa81882
8 changed files with 20 additions and 17 deletions

View File

@ -1,4 +1,5 @@
# $NetBSD: Makefile.inc,v 1.2 2018/12/27 18:57:14 christos Exp $
# $NetBSD: Makefile.inc,v 1.3 2018/12/28 18:17:10 christos Exp $
CPPFLAGS+= -I${ARCHDIR}
CPPFLAGS+= -DHAVE_INITFINI_ARRAY
#CPPFLAGS+= -DELF_NOTE_MARCH_DESC=\"${CSU_MACHINE_ARCH}\"

View File

@ -1,4 +1,7 @@
# $NetBSD: Makefile.inc,v 1.8 2018/12/27 18:57:15 christos Exp $
# $NetBSD: Makefile.inc,v 1.9 2018/12/28 18:17:10 christos Exp $
CPPFLAGS+= -I${ARCHDIR}
.if (!empty(CPUFLAGS) && ${CPUFLAGS:M-mabi=aapcs*} != "")
CPPFLAGS+= -DHAVE_INITFINI_ARRAY
.endif
CPPFLAGS+= -DELF_NOTE_MARCH_DESC=\"${CSU_MACHINE_ARCH}\"

View File

@ -1,4 +1,5 @@
# $NetBSD: Makefile.inc,v 1.4 2018/12/27 18:57:15 christos Exp $
# $NetBSD: Makefile.inc,v 1.5 2018/12/28 18:17:10 christos Exp $
CPPFLAGS+= -I${ARCHDIR}
CPPFLAGS+= -DHAVE_INITFINI_ARRAY
CPPFLAGS+= -DELF_NOTE_MARCH_DESC=\"${CSU_MACHINE_ARCH}\"

View File

@ -1,4 +1,5 @@
# $NetBSD: Makefile.inc,v 1.2 2018/12/27 18:57:15 christos Exp $
# $NetBSD: Makefile.inc,v 1.3 2018/12/28 18:17:11 christos Exp $
CPPFLAGS+= -I${ARCHDIR}
CPPFLAGS+= -DHAVE_INITFINI_ARRAY
#CPPFLAGS+= -DELF_NOTE_MARCH_DESC=\"${CSU_MACHINE_ARCH}\"

View File

@ -1,4 +1,5 @@
# $NetBSD: Makefile.inc,v 1.2 2018/12/27 18:57:15 christos Exp $
# $NetBSD: Makefile.inc,v 1.3 2018/12/28 18:17:11 christos Exp $
CPPFLAGS+= -I${ARCHDIR}
CPPFLAGS+= -DHAVE_INITFINI_ARRAY
#CPPFLAGS+= -DELF_NOTE_MARCH_DESC=\"${CSU_MACHINE_ARCH}\"

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.34 2018/12/27 18:57:15 christos Exp $
# $NetBSD: Makefile.inc,v 1.35 2018/12/28 18:17:11 christos Exp $
.include <bsd.own.mk>
@ -9,7 +9,6 @@ COMMON_DIR:= ${.CURDIR}/common
.PATH: ${COMMON_DIR}
CPPFLAGS+= -I${COMMON_DIR} -I.
CPPFLAGS+= -DHAVE_INITFINI_ARRAY
OBJS+= crt0.o gcrt0.o crti.o crtn.o
OBJS+= crtbegin.o crtend.o

View File

@ -1,4 +1,4 @@
/* $NetBSD: crt0-common.c,v 1.21 2018/12/27 19:32:32 christos Exp $ */
/* $NetBSD: crt0-common.c,v 1.22 2018/12/28 18:17:11 christos Exp $ */
/*
* Copyright (c) 1998 Christos Zoulas
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: crt0-common.c,v 1.21 2018/12/27 19:32:32 christos Exp $");
__RCSID("$NetBSD: crt0-common.c,v 1.22 2018/12/28 18:17:11 christos Exp $");
#include <sys/types.h>
#include <sys/exec.h>
@ -50,9 +50,10 @@ extern int main(int, char **, char **);
#ifdef HAVE_INITFINI_ARRAY
typedef void (*fptr_t)(void);
#endif
#else
extern void _init(void);
extern void _fini(void);
#endif
extern void _libc_init(void);
/*
@ -110,7 +111,7 @@ _preinit(void)
}
static inline void
_initarray(void)
_init(void)
{
for (const fptr_t *f = __init_array_start; f < __init_array_end; f++) {
(*f)();
@ -118,7 +119,7 @@ _initarray(void)
}
static void
_finiarray(void)
_fini(void)
{
for (const fptr_t *f = __fini_array_start; f < __fini_array_end; f++) {
(*f)();
@ -336,10 +337,6 @@ ___start(void (*cleanup)(void), /* from shared loader */
#endif
atexit(_fini);
#ifdef HAVE_INITFINI_ARRAY
atexit(_finiarray);
_initarray();
#endif
_init();
exit(main(ps_strings->ps_nargvstr, ps_strings->ps_argvstr, environ));

View File

@ -27,7 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: crtbegin.c,v 1.16 2018/12/28 13:53:17 christos Exp $");
__RCSID("$NetBSD: crtbegin.c,v 1.17 2018/12/28 18:17:11 christos Exp $");
#include "crtbegin.h"