Skip to content

Commit

Permalink
Update additional files
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Nov 1, 2024
1 parent e5002cc commit 05d422c
Show file tree
Hide file tree
Showing 438 changed files with 3,380 additions and 2,474 deletions.
1 change: 0 additions & 1 deletion gnu/lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# $FreeBSD$

.include <src.opts.mk>

Expand Down
8 changes: 1 addition & 7 deletions lib/csu/common/ignore_init.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
* SPDX-License-Identifier: BSD-1-Clause
*
* Copyright 2012 Konstantin Belousov <[email protected]>
* Copyright (c) 2018 The FreeBSD Foundation
Expand All @@ -12,9 +12,6 @@
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
Expand All @@ -29,13 +26,10 @@
*/

#include <sys/cdefs.h>

#include <sys/param.h>
#include <sys/elf.h>
#include <sys/elf_common.h>

#include "notes.h"

extern int main(int, char **, char **);

extern void (*__preinit_array_start[])(int, char **, char **) __hidden;
Expand Down
52 changes: 2 additions & 50 deletions lib/csu/i386/Makefile
Original file line number Diff line number Diff line change
@@ -1,57 +1,9 @@

.PATH: ${.CURDIR:H}/common

SRCS= crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= gcrt1.o crt1.o Scrt1.o
CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \
-I${SRCTOP}/lib/libc/include
CFLAGS+= -I${.CURDIR}
CFLAGS+= -DCRT_IRELOC_REL

FILES= ${OBJS}
FILESMODE= ${LIBMODE}
FILESOWN= ${LIBOWN}
FILESGRP= ${LIBGRP}
FILESDIR= ${LIBDIR}
# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
.undef LIBRARIES_ONLY

CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s

# See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not
# directly compiled to .o files.

gcrt1_c.s: crt1_c.c
${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
sed ${SED_FIX_NOTE} ${.TARGET}

gcrt1_c.o: gcrt1_c.s
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s

gcrt1.o: gcrt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o

crt1_c.s: crt1_c.c
${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
sed ${SED_FIX_NOTE} ${.TARGET}

crt1_c.o: crt1_c.s
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s

crt1.o: crt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
${OBJCOPY} --localize-symbol _start1 crt1.o

Scrt1_c.s: crt1_c.c
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
sed ${SED_FIX_NOTE} ${.TARGET}

Scrt1_c.o: Scrt1_c.s
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s

Scrt1.o: Scrt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
${OBJCOPY} --localize-symbol _start1 Scrt1.o
CRT1OBJS+= crt1_s.o

.include <bsd.lib.mk>
10 changes: 2 additions & 8 deletions lib/csu/i386/crt1_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: stable/10/lib/csu/i386-elf/crt1_c.c 300323 2016-05-20 19:14:15Z emaste $
*/

#include <sys/cdefs.h>

#include <stdlib.h>

#include "libc_private.h"
#include "crtbrand.c"
#include "ignore_init.c"

typedef void (*fptr)(void);

extern void _start(char *, ...);

#ifdef GCRT
Expand All @@ -45,11 +39,11 @@ extern int eprol;
extern int etext;
#endif

void _start1(fptr, int, char *[]) __dead2;
void _start1(void (*)(void), int, char *[]) __dead2;

/* The entry function, C part. */
void
_start1(fptr cleanup, int argc, char *argv[])
_start1(void (*cleanup)(void), int argc, char *argv[])
{
char **env;

Expand Down
7 changes: 1 addition & 6 deletions lib/csu/i386/crt1_s.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
Expand All @@ -21,10 +18,9 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/


#include <machine/asm.h>
.text
.align 4
.globl _start
Expand All @@ -49,4 +45,3 @@ _start:
.size _start, . - _start

.section .note.GNU-stack,"",%progbits

1 change: 0 additions & 1 deletion lib/csu/i386/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

#include <machine/asm.h>

.section .init,"ax",@progbits
.align 4
.globl _init
Expand Down
2 changes: 1 addition & 1 deletion lib/csu/i386/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
.section .init,"ax",@progbits
add $12,%esp
ret
Expand All @@ -32,4 +33,3 @@
ret

.section .note.GNU-stack,"",%progbits

2 changes: 0 additions & 2 deletions lib/libc/aarch64/SYS.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2015 The FreeBSD Foundation
* All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
Expand All @@ -26,7 +25,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/

#include <sys/syscall.h>
Expand Down
1 change: 1 addition & 0 deletions lib/libc/aarch64/Symbol.map
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FBSD_1.0 {
/* PSEUDO syscalls */
_exit;

.mcount;
_setjmp;
_longjmp;
fabs;
Expand Down
1 change: 1 addition & 0 deletions lib/libc/aarch64/gen/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SRCS+= _ctx_start.S \
flt_rounds.c \
fpgetmask.c \
fpsetmask.c \
_get_tp.c \
infinity.c \
ldexp.c \
makecontext.c \
Expand Down
1 change: 1 addition & 0 deletions lib/libc/amd64/string/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ MDSRCS+= \
memset.S \
strcat.S \
strcmp.S \
strlen.S \
stpcpy.S
63 changes: 48 additions & 15 deletions lib/libc/gen/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# @(#)Makefile.inc 8.6 (Berkeley) 5/4/95

# machine-independent gen sources
.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen ${SRCTOP}/etc

CONFS= shells
CONFS+= group master.passwd shells
CONFSMODE_master.passwd= 600
CONFSPACKAGE= runtime

SRCS+= __getosreldate.c \
__pthread_mutex_init_calloc_cb_stub.c \
Expand All @@ -27,10 +29,13 @@ SRCS+= __getosreldate.c \
clock_getcpuclockid.c \
closedir.c \
confstr.c \
cpuset_alloc.c \
cpuset_free.c \
crypt.c \
ctermid.c \
daemon.c \
devname.c \
devname-compat11.c \
dirfd.c \
dirname.c \
dirname_compat.c \
Expand All @@ -43,6 +48,7 @@ SRCS+= __getosreldate.c \
err.c \
errlst.c \
errno.c \
eventfd.c \
exec.c \
exect.c \
fdevname.c \
Expand All @@ -55,7 +61,10 @@ SRCS+= __getosreldate.c \
fstab.c \
ftok.c \
fts.c \
fts-compat.c \
fts-compat11.c \
ftw.c \
ftw-compat11.c \
getbootfile.c \
getbsize.c \
getcap.c \
Expand All @@ -68,6 +77,7 @@ SRCS+= __getosreldate.c \
getloadavg.c \
getlogin.c \
getmntinfo.c \
getmntinfo-compat11.c \
getnetgrent.c \
getosreldate.c \
getpagesize.c \
Expand All @@ -80,18 +90,21 @@ SRCS+= __getosreldate.c \
getutxent.c \
getvfsbyname.c \
glob.c \
glob-compat11.c \
initgroups.c \
isatty.c \
isinf.c \
isnan.c \
jrand48.c \
kqueue1.c \
lcong48.c \
libc_dlopen.c \
lockf.c \
lrand48.c \
memalign.c \
mrand48.c \
nftw.c \
nftw-compat11.c \
nice.c \
nlist.c \
nrand48.c \
Expand All @@ -105,11 +118,15 @@ SRCS+= __getosreldate.c \
pw_scan.c \
raise.c \
readdir.c \
readdir-compat11.c \
readpassphrase.c \
recvmmsg.c \
rewinddir.c \
scandir.c \
scandir_b.c \
scandir-compat11.c \
sched_getaffinity.c \
sched_setaffinity.c \
seed48.c \
seekdir.c \
semctl.c \
Expand Down Expand Up @@ -146,6 +163,7 @@ SRCS+= __getosreldate.c \
ualarm.c \
ulimit.c \
uname.c \
unvis-compat.c \
usleep.c \
utime.c \
utxdb.c \
Expand All @@ -155,21 +173,14 @@ SRCS+= __getosreldate.c \
waitpid.c \
waitid.c \
wordexp.c
.if ${MK_SYMVER} == yes
SRCS+= devname-compat11.c \
fts-compat.c \
fts-compat11.c \
ftw-compat11.c \
getmntinfo-compat11.c \
glob-compat11.c \
nftw-compat11.c \
readdir-compat11.c \
scandir-compat11.c \
unvis-compat.c
.endif

CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20

CFLAGS.sysconf.c= -I${SRCTOP}/contrib/tzcode

CFLAGS.dlfcn.c= ${RTLD_HDRS}
CFLAGS.tls.c= ${RTLD_HDRS}

.PATH: ${SRCTOP}/contrib/libc-pwcache
SRCS+= pwcache.c pwcache.h

Expand Down Expand Up @@ -456,7 +467,10 @@ MLINKS+=modf.3 modff.3 \
MLINKS+=popen.3 pclose.3
MLINKS+=posix_spawn.3 posix_spawnp.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclosefrom_np.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_adddup2.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addchdir_np.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addfchdir_np.3 \
posix_spawn_file_actions_init.3 posix_spawn_file_actions_destroy.3 \
posix_spawnattr_getflags.3 posix_spawnattr_setflags.3 \
posix_spawnattr_getpgroup.3 posix_spawnattr_setpgroup.3 \
Expand All @@ -481,7 +495,10 @@ MLINKS+=rand48.3 _rand48.3 \
rand48.3 seed48.3 \
rand48.3 srand48.3
MLINKS+=recv.2 recvmmsg.2
MLINKS+=scandir.3 alphasort.3
MLINKS+=scandir.3 alphasort.3 \
scandir.3 scandirat.3 \
scandir.3 scandir_b.3 \
scandir.3 versionsort.3
MLINKS+=sem_open.3 sem_close.3 \
sem_open.3 sem_unlink.3
MLINKS+=sem_wait.3 sem_trywait.3
Expand Down Expand Up @@ -550,3 +567,19 @@ MLINKS+=vis.3 nvis.3 \
vis.3 svis.3

MLINKS+=wordexp.3 wordfree.3

.include <src.tools.mk>

afterinstallconfig: install-passwd
install-passwd: .PHONY
.if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
.endif
${PWD_MKDB_CMD} -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
.if defined(NO_ROOT) && defined(METALOG)
( \
echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
) | cat -l >> ${METALOG}
.endif
Loading

0 comments on commit 05d422c

Please sign in to comment.