diff options
author | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2019-09-24 13:12:56 +0000 |
---|---|---|
committer | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2019-09-25 15:01:47 +0000 |
commit | 3105c6ff4e5cab926dc4802a7e10eee1f4abbec4 (patch) | |
tree | 76433a4127af3c3b916167d617ef66c3013cd662 | |
parent | abc694265cf5a5c05213271af9cdc13a4b22bdee (diff) | |
download | illumos-joyent-3105c6ff4e5cab926dc4802a7e10eee1f4abbec4.tar.gz |
OS-7992 use native linker sets for bhyve buildrelease-20190926
Reviewed by: John Levon <john.levon@joyent.com>
Reviewed by: Michael Zeller <mike.zeller@joyent.com>
Approved by: John Levon <john.levon@joyent.com>
-rw-r--r-- | usr/contrib/freebsd/sys/linker_set.h | 119 | ||||
-rw-r--r-- | usr/src/Makefile.master | 1 | ||||
-rw-r--r-- | usr/src/cmd/bhyve/Makefile | 2 | ||||
-rw-r--r-- | usr/src/compat/freebsd/sys/cdefs.h | 24 | ||||
-rw-r--r-- | usr/src/pkg/manifests/developer-build-onbld.mf | 1 | ||||
-rw-r--r-- | usr/src/tools/scripts/Makefile | 3 | ||||
-rw-r--r-- | usr/src/tools/scripts/gensetdefs.pl | 31 | ||||
-rw-r--r-- | usr/src/uts/i86pc/vmm/Makefile | 5 |
8 files changed, 2 insertions, 184 deletions
diff --git a/usr/contrib/freebsd/sys/linker_set.h b/usr/contrib/freebsd/sys/linker_set.h deleted file mode 100644 index d766c5e2db..0000000000 --- a/usr/contrib/freebsd/sys/linker_set.h +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * Copyright (c) 1999 John D. Polstra - * Copyright (c) 1999,2001 Peter Wemm <peter@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * 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 AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY 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: head/sys/sys/linker_set.h 215701 2010-11-22 19:32:54Z dim $ - */ - -#ifndef _SYS_LINKER_SET_H_ -#define _SYS_LINKER_SET_H_ - -#ifdef __FreeBSD__ -#ifndef _SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite -#endif -#else -#ifndef _COMPAT_FREEBSD_SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite -#endif -#endif - -/* - * The following macros are used to declare global sets of objects, which - * are collected by the linker into a `linker_set' as defined below. - * For ELF, this is done by constructing a separate segment for each set. - */ - -/* - * Private macros, not to be used outside this header file. - */ -#ifdef __GNUCLIKE___SECTION -#ifdef __FreeBSD__ -#define __MAKE_SET(set, sym) \ - __GLOBL(__CONCAT(__start_set_,set)); \ - __GLOBL(__CONCAT(__stop_set_,set)); \ - static void const * const __set_##set##_sym_##sym \ - __section("set_" #set) __used = &sym -#else -#define __MAKE_SET(set, sym) \ - static void const * const __set_##set##_sym_##sym \ - __section("set_" #set) __used = &sym -#endif -#else /* !__GNUCLIKE___SECTION */ -#ifndef lint -#error this file needs to be ported to your compiler -#endif /* lint */ -#define __MAKE_SET(set, sym) extern void const * const (__set_##set##_sym_##sym) -#endif /* __GNUCLIKE___SECTION */ - -/* - * Public macros. - */ -#define TEXT_SET(set, sym) __MAKE_SET(set, sym) -#define DATA_SET(set, sym) __MAKE_SET(set, sym) -#define BSS_SET(set, sym) __MAKE_SET(set, sym) -#define ABS_SET(set, sym) __MAKE_SET(set, sym) -#define SET_ENTRY(set, sym) __MAKE_SET(set, sym) - -/* - * Initialize before referring to a given linker set. - */ -#if defined(__FreeBSD__) || defined(_KERNEL) -#define SET_DECLARE(set, ptype) \ - extern ptype *__CONCAT(__start_set_,set); \ - extern ptype *__CONCAT(__stop_set_,set) -#else -#define SET_DECLARE(set, ptype) \ - _Pragma(__XSTRING(weak __CONCAT(__start_set_,set))) \ - _Pragma(__XSTRING(weak __CONCAT(__stop_set_,set))) \ - extern ptype *__CONCAT(__start_set_,set); \ - extern ptype *__CONCAT(__stop_set_,set) -#endif - -#define SET_BEGIN(set) \ - (&__CONCAT(__start_set_,set)) -#define SET_LIMIT(set) \ - (&__CONCAT(__stop_set_,set)) - -/* - * Iterate over all the elements of a set. - * - * Sets always contain addresses of things, and "pvar" points to words - * containing those addresses. Thus is must be declared as "type **pvar", - * and the address of each set item is obtained inside the loop by "*pvar". - */ -#define SET_FOREACH(pvar, set) \ - for (pvar = SET_BEGIN(set); pvar < SET_LIMIT(set); pvar++) - -#define SET_ITEM(set, i) \ - ((SET_BEGIN(set))[i]) - -/* - * Provide a count of the items in a set. - */ -#define SET_COUNT(set) \ - (SET_LIMIT(set) - SET_BEGIN(set)) - -#endif /* _SYS_LINKER_SET_H_ */ diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master index 53f1e8c7d2..8994d7a77e 100644 --- a/usr/src/Makefile.master +++ b/usr/src/Makefile.master @@ -195,7 +195,6 @@ CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets -GENSETDEFS= $(ONBLD_TOOLS)/bin/gensetdefs XREF= $(ONBLD_TOOLS)/bin/xref FIND= /usr/bin/find PERL= /usr/bin/perl diff --git a/usr/src/cmd/bhyve/Makefile b/usr/src/cmd/bhyve/Makefile index f8c5ffba8d..2257487c0d 100644 --- a/usr/src/cmd/bhyve/Makefile +++ b/usr/src/cmd/bhyve/Makefile @@ -131,8 +131,6 @@ $(PROG) := LDLIBS += -lsocket -lnsl -ldlpi -ldladm -lmd -luuid -lvmmapi -lz $(ZHYVE_PROG) := LDLIBS += -lnvpair $(MEVENT_TEST_PROG) := LDLIBS += -lsocket -POST_PROCESS += ; $(GENSETDEFS) $@ - .KEEP_STATE: all: $(PROG) $(MEVENT_TEST_PROG) $(ZHYVE_PROG) $(SUBDIRS) diff --git a/usr/src/compat/freebsd/sys/cdefs.h b/usr/src/compat/freebsd/sys/cdefs.h index 1713b05630..0b857437e3 100644 --- a/usr/src/compat/freebsd/sys/cdefs.h +++ b/usr/src/compat/freebsd/sys/cdefs.h @@ -53,30 +53,6 @@ #define __weak_symbol __attribute__((__weak__)) #endif -/* - * The __CONCAT macro is used to concatenate parts of symbol names, e.g. - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. - * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI - * mode -- there must be no spaces between its arguments, and for nested - * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also - * concatenate double-quoted strings produced by the __STRING macro, but - * this only works with ANSI C. - * - * __XSTRING is like __STRING, but it expands any macros in its argument - * first. It is only available with ANSI C. - */ -#if defined(__STDC__) || defined(__cplusplus) -#define __P(protos) protos /* full-blown ANSI C */ -#define __CONCAT1(x,y) x ## y -#define __CONCAT(x,y) __CONCAT1(x,y) -#define __STRING(x) #x /* stringify without expanding x */ -#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ -#else /* !(__STDC__ || __cplusplus) */ -#define __P(protos) () /* traditional C preprocessor */ -#define __CONCAT(x,y) x/**/y -#define __STRING(x) "x" -#endif /* !(__STDC__ || __cplusplus) */ - #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint) #if !__has_extension(c_static_assert) diff --git a/usr/src/pkg/manifests/developer-build-onbld.mf b/usr/src/pkg/manifests/developer-build-onbld.mf index 79d605d741..309ee71d4c 100644 --- a/usr/src/pkg/manifests/developer-build-onbld.mf +++ b/usr/src/pkg/manifests/developer-build-onbld.mf @@ -115,7 +115,6 @@ file path=opt/onbld/bin/find_elf mode=0555 file path=opt/onbld/bin/findcrypto mode=0555 file path=opt/onbld/bin/flg.flp mode=0555 file path=opt/onbld/bin/genoffsets mode=0555 -file path=opt/onbld/bin/gensetdefs mode=0555 file path=opt/onbld/bin/git-pbchk mode=0555 file path=opt/onbld/bin/hdrchk mode=0555 file path=opt/onbld/bin/interface_check mode=0555 diff --git a/usr/src/tools/scripts/Makefile b/usr/src/tools/scripts/Makefile index e98068051d..56029785d9 100644 --- a/usr/src/tools/scripts/Makefile +++ b/usr/src/tools/scripts/Makefile @@ -23,7 +23,7 @@ # # Copyright 2010, Richard Lowe # -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. SHELL=/usr/bin/ksh93 @@ -49,7 +49,6 @@ SHFILES= \ PERLFILES= \ check_rtime \ find_elf \ - gensetdefs \ interface_check \ interface_cmp \ jstyle \ diff --git a/usr/src/tools/scripts/gensetdefs.pl b/usr/src/tools/scripts/gensetdefs.pl deleted file mode 100644 index 8ca5782feb..0000000000 --- a/usr/src/tools/scripts/gensetdefs.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl -w -# -# COPYRIGHT 2013 Pluribus Networks Inc. -# -# All rights reserved. This copyright notice is Copyright Management -# Information under 17 USC 1202 and is included to protect this work and -# deter copyright infringement. Removal or alteration of this Copyright -# Management Information without the express written permission from -# Pluribus Networks Inc is prohibited, and any such unauthorized removal -# or alteration will be a violation of federal law. - -use strict; - -my @Sections = split(/\n/, `elfedit -r -e \'shdr:sh_name -osimple\' $ARGV[0] 2>&1`); - -foreach my $Section (@Sections) { - if ($Section =~ "^set_") { - print "\tfixing $Section\n"; - - chomp(my $SectionAddr = `elfedit -r -e \'shdr:sh_addr -onum $Section\' $ARGV[0] 2>&1`); - chomp(my $SectionSize = `elfedit -r -e \'shdr:sh_size -onum $Section\' $ARGV[0] 2>&1`); - my $SectionEnd = hex($SectionAddr) + hex($SectionSize); - - `elfedit -e \'sym:st_bind __start_$Section global\' $ARGV[0] 2>&1`; - `elfedit -e \'sym:st_value __start_$Section $SectionAddr\' $ARGV[0] 2>&1`; - `elfedit -e \'sym:st_shndx __start_$Section $Section\' $ARGV[0] 2>&1`; - `elfedit -e \'sym:st_bind __stop_$Section global\' $ARGV[0] 2>&1`; - `elfedit -e \'sym:st_value __stop_$Section $SectionEnd\' $ARGV[0] 2>&1`; - `elfedit -e \'sym:st_shndx __stop_$Section $Section\' $ARGV[0] 2>&1`; - } -} diff --git a/usr/src/uts/i86pc/vmm/Makefile b/usr/src/uts/i86pc/vmm/Makefile index fd14c0e95c..018a05ab92 100644 --- a/usr/src/uts/i86pc/vmm/Makefile +++ b/usr/src/uts/i86pc/vmm/Makefile @@ -109,7 +109,7 @@ $(OBJS_DIR)/svm.o := CERRWARN += -_gcc=-Wno-pointer-sign -_gcc=-Wno-type-limits $(OBJS_DIR)/vmx.o := CERRWARN += -_gcc=-Wno-unused-variable $(OBJS_DIR)/iommu.o := CERRWARN += -_gcc=-Wno-unused-variable -LDFLAGS += -dy -N misc/acpica -N misc/pcie -N fs/dev +LDFLAGS += -N misc/acpica -N misc/pcie -N fs/dev -z type=kmod LDFLAGS += -M $(MAPFILE) OFFSETS_VMX = $(CONF_SRCDIR)/intel/offsets.in @@ -120,9 +120,6 @@ ASSYM_H = $(ASSYM_VMX) $(ASSYM_SVM) CLEANFILES += $(ASSYM_H) -# create linker set start/stop symbols, needed by VMM stats -POST_PROCESS += ; $(GENSETDEFS) $@ - # # Default build targets. # |