Compensate for src/common/lib/libc/atomic/atomic_init_cas.c losing

the extern declaration of __libc_atomic_init() and instead using a
new one added to src/lib/libc/include/extern.h

That file is outside src/common and src/sys so is unavailable to
kernel builds, so instead make a new include file in src/common
which the kernel can read which contains the needed extern decl
for __libc_atomic_init()

This seems to fix the evbarm builds (maybe others) - but it is
all MUCH TOO UGLY to keep.   Someone please make a better fix,
even if that just means reverting rev 1.5 of
	src/common/lib/libc/atomic/atomic_init_cas.c
and all of the changes here (the addition to libc/include/extern.h
should be harmless to keep).
This commit is contained in:
kre 2024-01-20 11:04:53 +00:00
parent 7c3b3207ed
commit 3f351f34c6
3 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,3 @@
void __section(".text.startup") __attribute__((__visibility__("hidden")))
__libc_atomic_init(void);

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.libkern,v 1.54 2024/01/01 20:33:34 rhialto Exp $
# $NetBSD: Makefile.libkern,v 1.55 2024/01/20 11:04:53 kre Exp $
#
# Variable definitions for libkern.
@ -35,6 +35,7 @@ CPPFLAGS+= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
.include "${.PARSEDIR}/../../../common/lib/libppath/Makefile.inc"
CPPFLAGS+= -I${KERNDIR}/../../../common/include
CPPFLAGS+= -I${KERNDIR}/../../../common/include/libc
CPPFLAGS+= -I${KERNDIR}/../../../common/libc/hash/sha3
.PATH.c: ${KERNDIR}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.efiboot,v 1.29 2023/06/15 03:20:58 rin Exp $
# $NetBSD: Makefile.efiboot,v 1.30 2024/01/20 11:04:53 kre Exp $
S= ${.CURDIR}/../../..
@ -127,6 +127,7 @@ KERN_AS= library
LIBKERN_ARCH?= ${MACHINE_ARCH}
KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}"
.include "${S}/lib/libkern/Makefile.inc"
CPPFLAGS+= -I${S}/../common/include/libc
LIBKERN= ${KERNLIB}
### find out what to use for libz