diff options
Diffstat (limited to 'usr/src/lib/ssp_ns')
-rw-r--r-- | usr/src/lib/ssp_ns/Makefile | 37 | ||||
-rw-r--r-- | usr/src/lib/ssp_ns/Makefile.com | 46 | ||||
-rw-r--r-- | usr/src/lib/ssp_ns/amd64/Makefile | 19 | ||||
-rw-r--r-- | usr/src/lib/ssp_ns/common/ssp_ns.c | 37 | ||||
-rw-r--r-- | usr/src/lib/ssp_ns/i386/Makefile | 18 | ||||
-rw-r--r-- | usr/src/lib/ssp_ns/sparc/Makefile | 18 | ||||
-rw-r--r-- | usr/src/lib/ssp_ns/sparcv9/Makefile | 19 |
7 files changed, 194 insertions, 0 deletions
diff --git a/usr/src/lib/ssp_ns/Makefile b/usr/src/lib/ssp_ns/Makefile new file mode 100644 index 0000000000..e04e271f66 --- /dev/null +++ b/usr/src/lib/ssp_ns/Makefile @@ -0,0 +1,37 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2020 Oxide Computer Company +# + +include ../Makefile.lib + +SUBDIRS = $(MACH) +$(BUILD64)SUBDIRS += $(MACH64) + +all := TARGET = all +clean := TARGET = clean +clobber := TARGET = clobber +install := TARGET = install + +.KEEP_STATE: + +all clean clobber: $(SUBDIRS) + +install: $(SUBDIRS) + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: + +include ../Makefile.targ diff --git a/usr/src/lib/ssp_ns/Makefile.com b/usr/src/lib/ssp_ns/Makefile.com new file mode 100644 index 0000000000..aaa9aa52a9 --- /dev/null +++ b/usr/src/lib/ssp_ns/Makefile.com @@ -0,0 +1,46 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2020 Oxide Computer Company +# + +LIBRARY = libssp_ns.a +VERS = .1 +OBJECTS = ssp_ns.o + +include ../../Makefile.lib + +# +# We need to build an archive file; however, this is going to show up +# and be used in libraries and otherwise. So we need to still build it +# as position independent code. The Makefile system doesn't want to +# build a PIC file that's going into a .a file by default, so we have to +# do a little bit here. +# +LIBS = $(LIBRARY) +SRCDIR = ../common +CFLAGS += $($(MACH)_C_PICFLAGS) + +# +# Disable stack protection for the things providing the stack +# protection. +# +STACKPROTECT = none + +CLOBBERFILES += $(LIBRARY) + +.KEEP_STATE: + +all: $(LIBS) + + +include ../../Makefile.targ diff --git a/usr/src/lib/ssp_ns/amd64/Makefile b/usr/src/lib/ssp_ns/amd64/Makefile new file mode 100644 index 0000000000..59bd9673ce --- /dev/null +++ b/usr/src/lib/ssp_ns/amd64/Makefile @@ -0,0 +1,19 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2020 Oxide Computer Company +# + +include ../Makefile.com +include ../../Makefile.lib.64 + +install: all $(ROOTLIBS64) diff --git a/usr/src/lib/ssp_ns/common/ssp_ns.c b/usr/src/lib/ssp_ns/common/ssp_ns.c new file mode 100644 index 0000000000..bf7c45cd90 --- /dev/null +++ b/usr/src/lib/ssp_ns/common/ssp_ns.c @@ -0,0 +1,37 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Oxide Computer Company + */ + +#include <sys/ccompile.h> + +/* + * To impement gcc's stack protector library, the compiler emits a function call + * to a symbol which can be called absolutely. As a result, to make that happen, + * we mimic what gcc does with libssp and create an archive file that can be + * used in the specs file to pull this in directly. This is a bit of a pain, but + * that's the best we can do given the architecture that we have. + * + * Warning: This is a static archive. Nothing beyond the call for + * __stack_chk_fail_local and calls to committed interfaces should be here. As + * this implementation will be linked into programs, one should exercise care to + * make sure we don't expose anything else here. + */ + +extern void __stack_chk_fail(void); + +void __HIDDEN +__stack_chk_fail_local(void) +{ + __stack_chk_fail(); +} diff --git a/usr/src/lib/ssp_ns/i386/Makefile b/usr/src/lib/ssp_ns/i386/Makefile new file mode 100644 index 0000000000..c5a17a19d7 --- /dev/null +++ b/usr/src/lib/ssp_ns/i386/Makefile @@ -0,0 +1,18 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2020 Oxide Computer Company +# + +include ../Makefile.com + +install: all $(ROOTLIBS) diff --git a/usr/src/lib/ssp_ns/sparc/Makefile b/usr/src/lib/ssp_ns/sparc/Makefile new file mode 100644 index 0000000000..c5a17a19d7 --- /dev/null +++ b/usr/src/lib/ssp_ns/sparc/Makefile @@ -0,0 +1,18 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2020 Oxide Computer Company +# + +include ../Makefile.com + +install: all $(ROOTLIBS) diff --git a/usr/src/lib/ssp_ns/sparcv9/Makefile b/usr/src/lib/ssp_ns/sparcv9/Makefile new file mode 100644 index 0000000000..59bd9673ce --- /dev/null +++ b/usr/src/lib/ssp_ns/sparcv9/Makefile @@ -0,0 +1,19 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2020 Oxide Computer Company +# + +include ../Makefile.com +include ../../Makefile.lib.64 + +install: all $(ROOTLIBS64) |