summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/Makefile.lib4
-rw-r--r--usr/src/lib/Makefile.targ9
-rw-r--r--usr/src/lib/brand/shared/brand/Makefile.com4
-rw-r--r--usr/src/lib/commpage/Makefile.shared.targ4
-rw-r--r--usr/src/lib/libc/Makefile.targ40
-rw-r--r--usr/src/lib/libc/capabilities/Makefile.targ6
-rw-r--r--usr/src/lib/libc_db/Makefile.com4
-rw-r--r--usr/src/lib/libcpc/Makefile.com6
-rw-r--r--usr/src/lib/libctf/common/ctf_convert.c136
-rw-r--r--usr/src/lib/libctf/common/ctf_dwarf.c260
-rw-r--r--usr/src/lib/libctf/common/libctf.h18
-rw-r--r--usr/src/lib/libctf/common/libctf_impl.h10
-rw-r--r--usr/src/lib/libctf/common/mapfile-vers3
-rw-r--r--usr/src/lib/libfru/Makefile.targ10
-rw-r--r--usr/src/lib/libm/Makefile.targ4
-rw-r--r--usr/src/lib/libmvec/Makefile.com8
-rw-r--r--usr/src/lib/libnisdb/Makefile10
-rw-r--r--usr/src/lib/libsqlite/Makefile.com4
-rw-r--r--usr/src/lib/libtnfctl/Makefile.com4
-rw-r--r--usr/src/lib/libtnfprobe/Makefile.com4
-rw-r--r--usr/src/lib/libumem/Makefile.targ3
-rw-r--r--usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile11
-rw-r--r--usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile4
23 files changed, 321 insertions, 245 deletions
diff --git a/usr/src/lib/Makefile.lib b/usr/src/lib/Makefile.lib
index 03e35db0af..c6521af70e 100644
--- a/usr/src/lib/Makefile.lib
+++ b/usr/src/lib/Makefile.lib
@@ -22,7 +22,7 @@
# Copyright 2015 Gary Mills
# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2015, Joyent, Inc.
+# Copyright 2019, Joyent, Inc.
#
#
# Definitions common to libraries.
@@ -212,7 +212,7 @@ objs/%.o pics/%.o: %.c
objs/%.o pics/%.o: %.cc
$(COMPILE.cc) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_CC_O)
.PRECIOUS: $(LIBS)
diff --git a/usr/src/lib/Makefile.targ b/usr/src/lib/Makefile.targ
index 0744402619..78389d0668 100644
--- a/usr/src/lib/Makefile.targ
+++ b/usr/src/lib/Makefile.targ
@@ -20,6 +20,7 @@
#
#
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2019, Joyent, Inc.
#
#
@@ -47,11 +48,11 @@ $(ROOTHDRDIR)/%: $(HDRDIR)/%
$(ROOTLIBDIR)/%: %
$(INS.file)
$(ROOTLIBDIR64)/%: %
- $(INS.file)
+ $(INS.file)
$(ROOTFS_LIBDIR)/%: %
$(INS.file)
$(ROOTFS_LIBDIR64)/%: %
- $(INS.file)
+ $(INS.file)
$(ROOTLIBDIR)/$(LIBLINKS): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
$(INS.liblink)
@@ -79,7 +80,7 @@ objs/%.o pics/%.o: $(SRCDIR)/%.c
objs/%.o pics/%.o: $(SRCDIR)/%.cc
$(COMPILE.cc) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_CC_O)
objs pics:
-@mkdir -p $@
@@ -98,7 +99,7 @@ $(DYNLIBCCC): pics .WAIT $$(PICS) $$(ALTPICS) $$(EXTPICS)
$(BUILDCCC.SO)
$(POST_PROCESS_SO)
-$(LINTLIB): $$(SRCS)
+$(LINTLIB): $$(SRCS)
$(LINT.c) -o $(LIBNAME) $(SRCS) > $(LINTOUT) 2>&1
lintcheck: $$(SRCS)
diff --git a/usr/src/lib/brand/shared/brand/Makefile.com b/usr/src/lib/brand/shared/brand/Makefile.com
index 7d9a4ee554..8d58c993d8 100644
--- a/usr/src/lib/brand/shared/brand/Makefile.com
+++ b/usr/src/lib/brand/shared/brand/Makefile.com
@@ -23,6 +23,8 @@
#
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
#
+# Copyright (c) 2019, Joyent, Inc.
+#
COBJS = brand_util.o
ASOBJS = crt.o handler.o runexe.o
@@ -74,6 +76,6 @@ $(OFFSETS_H): $(OFFSETS_SRC)
pics/%.o: $(ISASRCDIR)/%.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/commpage/Makefile.shared.targ b/usr/src/lib/commpage/Makefile.shared.targ
index 85260e3c9e..31dd17ba13 100644
--- a/usr/src/lib/commpage/Makefile.shared.targ
+++ b/usr/src/lib/commpage/Makefile.shared.targ
@@ -10,7 +10,7 @@
#
#
-# Copyright 2016 Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
#
#
@@ -23,7 +23,7 @@ pics/%.o: $(SRC)/lib/commpage/common/%.c
pics/%.o: $(SRC)/lib/commpage/$(TARGET_ARCH)/%.s $(COMMPAGE_OFFSETS_H)
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
$(COMMPAGE_OFFSETS_H): $(COMMPAGE_OFFSETS_SRC)
$(OFFSETS_CREATE) <$(COMMPAGE_OFFSETS_SRC) >$@
diff --git a/usr/src/lib/libc/Makefile.targ b/usr/src/lib/libc/Makefile.targ
index 31992a9ee8..326cca9bf4 100644
--- a/usr/src/lib/libc/Makefile.targ
+++ b/usr/src/lib/libc/Makefile.targ
@@ -21,8 +21,8 @@
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
-# Copyright 2016 Joyent, Inc.
#
+# Copyright (c) 2019, Joyent, Inc.
#
# libc build rules
@@ -32,7 +32,7 @@
#
pics/%.o: $(OPTIMIZED_LIBCBASE)/gen/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/crt/%.c
$(COMPILE.c) -o $@ $<
@@ -40,7 +40,7 @@ pics/%.o: $(LIBCBASE)/crt/%.c
pics/%.o: $(LIBCBASE)/crt/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/gen/%.c
$(COMPILE.c) -o $@ $<
@@ -48,15 +48,15 @@ pics/%.o: $(LIBCBASE)/gen/%.c
pics/%.o: $(LIBCBASE)/gen/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/_stack_grow.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
$(BUILD.s) $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/fp/%.c
$(COMPILE.c) -o $@ $<
@@ -68,7 +68,7 @@ pics/%.o: $(LIBCBASE)/../$(MACH)/fp/%.c
pics/%.o: $(LIBCBASE)/fp/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c
$(COMPILE.c) -o $@ $<
@@ -76,7 +76,7 @@ pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/sys/%.c
$(COMPILE.c) -o $@ $<
@@ -84,15 +84,15 @@ pics/%.o: $(LIBCBASE)/sys/%.c
pics/%.o: $(LIBCBASE)/../common/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.c
$(COMPILE.c) -o $@ $<
@@ -104,17 +104,17 @@ pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.c
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
# rules to build large file aware objects (xxx64.o from xxx.s or xxx.c)
pics/%64.o: $(LIBCBASE)/../common/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%64.o: $(LIBCBASE)/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%64.o: $(LIBCBASE)/gen/%.c
$(COMPILE.c) -o $@ $<
@@ -245,7 +245,7 @@ pics/%.o: $(LIBCBASE)/threads/%.c
pics/%.o: $(LIBCBASE)/threads/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
$(COMPILE.c) -o $@ $<
@@ -253,7 +253,7 @@ pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
$(COMPILE.c) -o $@ $<
@@ -261,7 +261,7 @@ pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../port/unwind/%.c
$(COMPILE.c) -o $@ $<
@@ -269,7 +269,7 @@ pics/%.o: $(LIBCBASE)/../port/unwind/%.c
pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(LIBCBASE)/../port/sys/%.c
$(COMPILE.c) -o $@ $<
@@ -281,12 +281,12 @@ pics/%.o: $(LIBCBASE)/../../crt/common/%.c
pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
# $(SRC)/common rules
pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
$(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
$(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
diff --git a/usr/src/lib/libc/capabilities/Makefile.targ b/usr/src/lib/libc/capabilities/Makefile.targ
index c2c6951f0d..d9f7891f22 100644
--- a/usr/src/lib/libc/capabilities/Makefile.targ
+++ b/usr/src/lib/libc/capabilities/Makefile.targ
@@ -22,6 +22,8 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
+# Copyright (c) 2019, Joyent, Inc.
+#
$(SYMCAP): $(OBJCAP)
$(OBJCAP): $(PICS)
@@ -31,11 +33,11 @@ $(PICS): pics
pics/%.o: ../../$(TRG_PLATFORM)/common/%.s
$(COMPILE.s) $< -o $@
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: ../../$(ALT_PLATFORM)/common/%.s
$(COMPILE.s) $< -o $@
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
# Combine all pic objects into one relocatable object. Assign any capabilities
# to this object, and define the interface.
diff --git a/usr/src/lib/libc_db/Makefile.com b/usr/src/lib/libc_db/Makefile.com
index 36c954e36c..9fb18a576c 100644
--- a/usr/src/lib/libc_db/Makefile.com
+++ b/usr/src/lib/libc_db/Makefile.com
@@ -22,7 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
LIBRARY = libc_db.a
VERS = .1
@@ -63,4 +63,4 @@ include ../../Makefile.targ
pics/%.o: $(CRTSRCS)/%.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
diff --git a/usr/src/lib/libcpc/Makefile.com b/usr/src/lib/libcpc/Makefile.com
index 8e95766942..78ed2818ad 100644
--- a/usr/src/lib/libcpc/Makefile.com
+++ b/usr/src/lib/libcpc/Makefile.com
@@ -21,7 +21,7 @@
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
LIBRARY = libcpc.a
VERS = .1
@@ -31,7 +31,7 @@ OBJECTS = $(ASOBJS) $(MACHCOBJS) $(COBJS) $(V1_OBJS)
include ../../Makefile.lib
-SRCS = $(ASOBJS:%.o=../$(MACH)/%.s) \
+SRCS = $(ASOBJS:%.o=../$(MACH)/%.s) \
$(MACHCOBJS:%.o=../$(MACH)/%.c) \
$(V1_OBJS:%.o=../common/%.c) \
$(COBJS:%.o=../common/%.c)
@@ -66,4 +66,4 @@ pics/%.o: ../$(MACH)/%.c
pics/%.o: ../$(MACH)/%.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
diff --git a/usr/src/lib/libctf/common/ctf_convert.c b/usr/src/lib/libctf/common/ctf_convert.c
index 07396cb8c9..06f4135593 100644
--- a/usr/src/lib/libctf/common/ctf_convert.c
+++ b/usr/src/lib/libctf/common/ctf_convert.c
@@ -21,6 +21,7 @@
*/
#include <libctf_impl.h>
+#include <assert.h>
#include <gelf.h>
ctf_convert_f ctf_converters[] = {
@@ -29,76 +30,73 @@ ctf_convert_f ctf_converters[] = {
#define NCONVERTS (sizeof (ctf_converters) / sizeof (ctf_convert_f))
-typedef enum ctf_convert_source {
- CTFCONV_SOURCE_NONE = 0x0,
- CTFCONV_SOURCE_UNKNOWN = 0x01,
- CTFCONV_SOURCE_C = 0x02,
- CTFCONV_SOURCE_S = 0x04
-} ctf_convert_source_t;
-
-static void
-ctf_convert_ftypes(Elf *elf, ctf_convert_source_t *types)
+ctf_hsc_ret_t
+ctf_has_c_source(Elf *elf, char *errmsg, size_t errlen)
{
- int i;
- Elf_Scn *scn = NULL, *strscn;
- *types = CTFCONV_SOURCE_NONE;
- GElf_Shdr shdr;
+ ctf_hsc_ret_t ret = CHR_NO_C_SOURCE;
+ Elf_Scn *scn, *strscn;
Elf_Data *data, *strdata;
+ GElf_Shdr shdr;
+ ulong_t i;
+ scn = NULL;
while ((scn = elf_nextscn(elf, scn)) != NULL) {
-
- if (gelf_getshdr(scn, &shdr) == NULL)
- return;
+ if (gelf_getshdr(scn, &shdr) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to get section header: %s",
+ elf_errmsg(elf_errno()));
+ return (CHR_ERROR);
+ }
if (shdr.sh_type == SHT_SYMTAB)
break;
}
if (scn == NULL)
- return;
+ return (CHR_NO_C_SOURCE);
- if ((strscn = elf_getscn(elf, shdr.sh_link)) == NULL)
- return;
+ if ((strscn = elf_getscn(elf, shdr.sh_link)) == NULL) {
+ (void) snprintf(errmsg, errlen, "failed to get str section: %s",
+ elf_errmsg(elf_errno()));
+ return (CHR_ERROR);
+ }
- if ((data = elf_getdata(scn, NULL)) == NULL)
- return;
+ if ((data = elf_getdata(scn, NULL)) == NULL) {
+ (void) snprintf(errmsg, errlen, "failed to read section: %s",
+ elf_errmsg(elf_errno()));
+ return (CHR_ERROR);
+ }
- if ((strdata = elf_getdata(strscn, NULL)) == NULL)
- return;
+ if ((strdata = elf_getdata(strscn, NULL)) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to read string table: %s", elf_errmsg(elf_errno()));
+ return (CHR_ERROR);
+ }
for (i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) {
GElf_Sym sym;
const char *file;
size_t len;
- if (gelf_getsym(data, i, &sym) == NULL)
- return;
+ if (gelf_getsym(data, i, &sym) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to read sym %lu: %s",
+ i, elf_errmsg(elf_errno()));
+ return (CHR_ERROR);
+ }
if (GELF_ST_TYPE(sym.st_info) != STT_FILE)
continue;
file = (const char *)((uintptr_t)strdata->d_buf + sym.st_name);
len = strlen(file);
- if (len < 2 || file[len - 2] != '.') {
- *types |= CTFCONV_SOURCE_UNKNOWN;
- continue;
- }
-
- switch (file[len - 1]) {
- case 'c':
- *types |= CTFCONV_SOURCE_C;
- break;
- case 'h':
- /* We traditionally ignore header files... */
- break;
- case 's':
- *types |= CTFCONV_SOURCE_S;
- break;
- default:
- *types |= CTFCONV_SOURCE_UNKNOWN;
+ if (len >= 2 && strncmp(".c", &file[len - 2], 2) == 0) {
+ ret = CHR_HAS_C_SOURCE;
break;
}
}
+
+ return (ret);
}
static ctf_file_t *
@@ -107,8 +105,6 @@ ctf_elfconvert(int fd, Elf *elf, const char *label, uint_t nthrs, uint_t flags,
{
int err, i;
ctf_file_t *fp = NULL;
- boolean_t notsup = B_TRUE;
- ctf_convert_source_t type;
if (errp == NULL)
errp = &err;
@@ -118,7 +114,7 @@ ctf_elfconvert(int fd, Elf *elf, const char *label, uint_t nthrs, uint_t flags,
return (NULL);
}
- if (flags & ~CTF_CONVERT_F_IGNNONC) {
+ if (flags & ~CTF_ALLOW_MISSING_DEBUG) {
*errp = EINVAL;
return (NULL);
}
@@ -128,47 +124,35 @@ ctf_elfconvert(int fd, Elf *elf, const char *label, uint_t nthrs, uint_t flags,
return (NULL);
}
- ctf_convert_ftypes(elf, &type);
- ctf_dprintf("got types: %d\n", type);
- if (flags & CTF_CONVERT_F_IGNNONC) {
- if (type == CTFCONV_SOURCE_NONE ||
- (type & CTFCONV_SOURCE_UNKNOWN)) {
- *errp = ECTF_CONVNOCSRC;
- return (NULL);
- }
+ switch (ctf_has_c_source(elf, errbuf, errlen)) {
+ case CHR_ERROR:
+ *errp = ECTF_ELF;
+ return (NULL);
+
+ case CHR_NO_C_SOURCE:
+ *errp = ECTF_CONVNOCSRC;
+ return (NULL);
+
+ default:
+ break;
}
for (i = 0; i < NCONVERTS; i++) {
- ctf_conv_status_t cs;
-
fp = NULL;
- cs = ctf_converters[i](fd, elf, nthrs, errp, &fp, errbuf,
- errlen);
- if (cs == CTF_CONV_SUCCESS) {
- notsup = B_FALSE;
- break;
- }
- if (cs == CTF_CONV_ERROR) {
- fp = NULL;
- notsup = B_FALSE;
+ err = ctf_converters[i](fd, elf, nthrs, flags,
+ &fp, errbuf, errlen);
+
+ if (err != ECTF_CONVNODEBUG)
break;
- }
}
- if (notsup == B_TRUE) {
- if ((flags & CTF_CONVERT_F_IGNNONC) != 0 &&
- (type & CTFCONV_SOURCE_C) == 0) {
- *errp = ECTF_CONVNOCSRC;
- return (NULL);
- }
- *errp = ECTF_NOCONVBKEND;
+ if (err != 0) {
+ assert(fp == NULL);
+ *errp = err;
return (NULL);
}
- /*
- * Succsesful conversion.
- */
- if (fp != NULL && label != NULL) {
+ if (label != NULL) {
if (ctf_add_label(fp, label, fp->ctf_typemax, 0) == CTF_ERR) {
*errp = ctf_errno(fp);
ctf_close(fp);
diff --git a/usr/src/lib/libctf/common/ctf_dwarf.c b/usr/src/lib/libctf/common/ctf_dwarf.c
index 7cd02db43c..aa55127d26 100644
--- a/usr/src/lib/libctf/common/ctf_dwarf.c
+++ b/usr/src/lib/libctf/common/ctf_dwarf.c
@@ -883,7 +883,7 @@ ctf_dwarf_dwarf_base(ctf_cu_t *cup, Dwarf_Die die, int *kindp,
break;
default:
(void) snprintf(cup->cu_errbuf, cup->cu_errlen,
- "encountered unkown DWARF encoding: %d", type);
+ "encountered unknown DWARF encoding: %d", type);
return (ECTF_CONVBKERR);
}
@@ -1778,6 +1778,7 @@ ctf_dwarf_convert_type(ctf_cu_t *cup, Dwarf_Die die, ctf_id_t *idp,
break;
default:
ctf_dprintf("ignoring tag type %x\n", tag);
+ *idp = CTF_ERR;
ret = 0;
break;
}
@@ -2677,7 +2678,8 @@ ctf_dwarf_free_die(ctf_cu_t *cup)
}
ctf_dprintf("Trying to clean up dwarf_t: %p\n", cup->cu_dwarf);
- (void) dwarf_finish(cup->cu_dwarf, &derr);
+ if (cup->cu_dwarf != NULL)
+ (void) dwarf_finish(cup->cu_dwarf, &derr);
cup->cu_dwarf = NULL;
ctf_close(cup->cu_ctfp);
@@ -2727,13 +2729,6 @@ ctf_dwarf_count_dies(Dwarf_Debug dw, Dwarf_Error *derr, int *ndies,
*ndies = *ndies + 1;
}
- if (*ndies == 0) {
- (void) snprintf(errbuf, errlen,
- "file does not contain valid DWARF data: %s\n",
- dwarf_errmsg(*derr));
- return (ECTF_CONVBKERR);
- }
-
return (0);
}
@@ -2769,10 +2764,9 @@ ctf_dwarf_init_die(int fd, Elf *elf, ctf_cu_t *cup, int ndie, char *errbuf,
cup->cu_elf = elf;
cup->cu_maxoff = nexthdr - 1;
cup->cu_ctfp = ctf_fdcreate(fd, &ret);
- if (cup->cu_ctfp == NULL) {
- ctf_free(cup, sizeof (ctf_cu_t));
+ if (cup->cu_ctfp == NULL)
return (ret);
- }
+
avl_create(&cup->cu_map, ctf_dwmap_comp, sizeof (ctf_dwmap_t),
offsetof(ctf_dwmap_t, cdm_avl));
cup->cu_errbuf = errbuf;
@@ -2782,46 +2776,32 @@ ctf_dwarf_init_die(int fd, Elf *elf, ctf_cu_t *cup, int ndie, char *errbuf,
bzero(&cup->cu_bitfields, sizeof (ctf_list_t));
if ((ret = ctf_dwarf_die_elfenc(elf, cup, errbuf,
- errlen)) != 0) {
- avl_destroy(&cup->cu_map);
- ctf_free(cup, sizeof (ctf_cu_t));
+ errlen)) != 0)
return (ret);
- }
- if ((ret = ctf_dwarf_sib(cup, NULL, &cu)) != 0) {
- avl_destroy(&cup->cu_map);
- ctf_free(cup, sizeof (ctf_cu_t));
+ if ((ret = ctf_dwarf_sib(cup, NULL, &cu)) != 0)
return (ret);
- }
+
if (cu == NULL) {
(void) snprintf(errbuf, errlen,
- "file does not contain DWARF data\n");
- avl_destroy(&cup->cu_map);
- ctf_free(cup, sizeof (ctf_cu_t));
- return (ECTF_CONVBKERR);
+ "file does not contain DWARF data");
+ return (ECTF_CONVNODEBUG);
}
- if ((ret = ctf_dwarf_child(cup, cu, &child)) != 0) {
- avl_destroy(&cup->cu_map);
- ctf_free(cup, sizeof (ctf_cu_t));
+ if ((ret = ctf_dwarf_child(cup, cu, &child)) != 0)
return (ret);
- }
+
if (child == NULL) {
(void) snprintf(errbuf, errlen,
- "file does not contain DWARF data\n");
- avl_destroy(&cup->cu_map);
- ctf_free(cup, sizeof (ctf_cu_t));
- return (ECTF_CONVBKERR);
+ "file does not contain DWARF data");
+ return (ECTF_CONVNODEBUG);
}
cup->cu_cuoff = offset;
cup->cu_cu = child;
- if ((cup->cu_cmh = ctf_merge_init(fd, &ret)) == NULL) {
- avl_destroy(&cup->cu_map);
- ctf_free(cup, sizeof (ctf_cu_t));
+ if ((cup->cu_cmh = ctf_merge_init(fd, &ret)) == NULL)
return (ret);
- }
if (ctf_dwarf_string(cup, cu, DW_AT_name, &name) == 0) {
size_t len = strlen(name) + 1;
@@ -2835,41 +2815,143 @@ ctf_dwarf_init_die(int fd, Elf *elf, ctf_cu_t *cup, int ndie, char *errbuf,
return (0);
}
+/*
+ * This is our only recourse to identify a C source file that is missing debug
+ * info: it will be mentioned as an STT_FILE, but not have a compile unit entry.
+ * (A traditional ctfmerge works on individual files, so can identify missing
+ * DWARF more directly, via ctf_has_c_source() on the .o file.)
+ *
+ * As we operate on basenames, this can of course miss some cases, but it's
+ * better than not checking at all.
+ *
+ * We explicitly whitelist some CRT components. Failing that, there's always
+ * the -m option.
+ */
+static boolean_t
+c_source_has_debug(const char *file, ctf_cu_t *cus, size_t nr_cus)
+{
+ const char *basename = strrchr(file, '/');
+
+ if (basename == NULL)
+ basename = file;
+ else
+ basename++;
+
+ if (strcmp(basename, "common-crt.c") == 0 ||
+ strcmp(basename, "gmon.c") == 0 ||
+ strcmp(basename, "dlink_init.c") == 0 ||
+ strcmp(basename, "dlink_common.c") == 0 ||
+ strncmp(basename, "crt", strlen("crt")) == 0 ||
+ strncmp(basename, "values-", strlen("values-")) == 0)
+ return (B_TRUE);
-ctf_conv_status_t
-ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp,
+ for (size_t i = 0; i < nr_cus; i++) {
+ if (strcmp(basename, cus[i].cu_name) == 0)
+ return (B_TRUE);
+ }
+
+ return (B_FALSE);
+}
+
+static int
+ctf_dwarf_check_missing(ctf_cu_t *cus, size_t nr_cus, Elf *elf,
char *errmsg, size_t errlen)
{
+ Elf_Scn *scn, *strscn;
+ Elf_Data *data, *strdata;
+ GElf_Shdr shdr;
+ ulong_t i;
+
+ scn = NULL;
+ while ((scn = elf_nextscn(elf, scn)) != NULL) {
+ if (gelf_getshdr(scn, &shdr) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to get section header: %s\n",
+ elf_errmsg(elf_errno()));
+ return (EINVAL);
+ }
+
+ if (shdr.sh_type == SHT_SYMTAB)
+ break;
+ }
+
+ if (scn == NULL)
+ return (0);
+
+ if ((strscn = elf_getscn(elf, shdr.sh_link)) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to get str section: %s\n",
+ elf_errmsg(elf_errno()));
+ return (EINVAL);
+ }
+
+ if ((data = elf_getdata(scn, NULL)) == NULL) {
+ (void) snprintf(errmsg, errlen, "failed to read section: %s\n",
+ elf_errmsg(elf_errno()));
+ return (EINVAL);
+ }
+
+ if ((strdata = elf_getdata(strscn, NULL)) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to read string table: %s\n",
+ elf_errmsg(elf_errno()));
+ return (EINVAL);
+ }
+
+ for (i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) {
+ GElf_Sym sym;
+ const char *file;
+ size_t len;
+
+ if (gelf_getsym(data, i, &sym) == NULL) {
+ (void) snprintf(errmsg, errlen,
+ "failed to read sym %lu: %s\n",
+ i, elf_errmsg(elf_errno()));
+ return (EINVAL);
+ }
+
+ if (GELF_ST_TYPE(sym.st_info) != STT_FILE)
+ continue;
+
+ file = (const char *)((uintptr_t)strdata->d_buf + sym.st_name);
+ len = strlen(file);
+ if (len < 2 || strncmp(".c", &file[len - 2], 2) != 0)
+ continue;
+
+ if (!c_source_has_debug(file, cus, nr_cus)) {
+ (void) snprintf(errmsg, errlen,
+ "file %s is missing debug info\n", file);
+ return (ECTF_CONVNODEBUG);
+ }
+ }
+
+ return (0);
+}
+
+int
+ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, uint_t flags,
+ ctf_file_t **fpp, char *errbuf, size_t errlen)
+{
int err, ret, ndies, i;
Dwarf_Debug dw;
Dwarf_Error derr;
ctf_cu_t *cdies = NULL, *cup;
workq_t *wqp = NULL;
- if (errp == NULL)
- errp = &err;
- *errp = 0;
*fpp = NULL;
ret = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL, &dw, &derr);
if (ret != DW_DLV_OK) {
- /*
- * We may want to expect DWARF data here and fail conversion if
- * it's missing. In this case, if we actually have some amount
- * of DWARF, but no section, for now, just go ahead and create
- * an empty CTF file.
- */
if (ret == DW_DLV_NO_ENTRY ||
dwarf_errno(derr) == DW_DLE_DEBUG_INFO_NULL) {
- *fpp = ctf_create(errp);
- return (*fpp != NULL ? CTF_CONV_SUCCESS :
- CTF_CONV_ERROR);
+ (void) snprintf(errbuf, errlen,
+ "file does not contain DWARF data\n");
+ return (ECTF_CONVNODEBUG);
}
- (void) snprintf(errmsg, errlen,
- "failed to initialize DWARF: %s\n",
- dwarf_errmsg(derr));
- *errp = ECTF_CONVBKERR;
- return (CTF_CONV_ERROR);
+
+ (void) snprintf(errbuf, errlen,
+ "dwarf_elf_init() failed: %s\n", dwarf_errmsg(derr));
+ return (ECTF_CONVBKERR);
}
/*
@@ -2880,42 +2962,47 @@ ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp,
* only a single Dwarf_Debug as well.
*/
ndies = 0;
- ret = ctf_dwarf_count_dies(dw, &derr, &ndies, errmsg, errlen);
- if (ret != 0) {
- *errp = ret;
- goto out;
+ err = ctf_dwarf_count_dies(dw, &derr, &ndies, errbuf, errlen);
+
+ ctf_dprintf("found %d DWARF CUs\n", ndies);
+
+ if (ndies == 0) {
+ (void) snprintf(errbuf, errlen,
+ "file does not contain DWARF data\n");
+ return (ECTF_CONVNODEBUG);
}
(void) dwarf_finish(dw, &derr);
cdies = ctf_alloc(sizeof (ctf_cu_t) * ndies);
if (cdies == NULL) {
- *errp = ENOMEM;
- return (CTF_CONV_ERROR);
+ return (ENOMEM);
}
+ bzero(cdies, sizeof (ctf_cu_t) * ndies);
+
for (i = 0; i < ndies; i++) {
cup = &cdies[i];
ret = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL,
&cup->cu_dwarf, &derr);
if (ret != 0) {
ctf_free(cdies, sizeof (ctf_cu_t) * ndies);
- (void) snprintf(errmsg, errlen,
+ (void) snprintf(errbuf, errlen,
"failed to initialize DWARF: %s\n",
dwarf_errmsg(derr));
- *errp = ECTF_CONVBKERR;
- return (CTF_CONV_ERROR);
+ return (ECTF_CONVBKERR);
}
- ret = ctf_dwarf_init_die(fd, elf, &cdies[i], i, errmsg, errlen);
- if (ret != 0) {
- *errp = ret;
+ err = ctf_dwarf_init_die(fd, elf, cup, i, errbuf, errlen);
+ if (err != 0)
goto out;
- }
cup->cu_doweaks = ndies > 1 ? B_FALSE : B_TRUE;
}
- ctf_dprintf("found %d DWARF CUs\n", ndies);
+ if (!(flags & CTF_ALLOW_MISSING_DEBUG) &&
+ (err = ctf_dwarf_check_missing(cdies, ndies,
+ elf, errbuf, errlen)) != 0)
+ goto out;
/*
* If we only have one compilation unit, there's no reason to use
@@ -2926,7 +3013,7 @@ ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp,
nthrs = 1;
if (workq_init(&wqp, nthrs) == -1) {
- *errp = errno;
+ err = errno;
goto out;
}
@@ -2935,18 +3022,18 @@ ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp,
ctf_dprintf("adding cu %s: %p, %x %x\n", cup->cu_name,
cup->cu_cu, cup->cu_cuoff, cup->cu_maxoff);
if (workq_add(wqp, cup) == -1) {
- *errp = errno;
+ err = errno;
goto out;
}
}
- ret = workq_work(wqp, ctf_dwarf_convert_one, NULL, errp);
+ ret = workq_work(wqp, ctf_dwarf_convert_one, NULL, &err);
if (ret == WORKQ_ERROR) {
- *errp = errno;
+ err = errno;
goto out;
} else if (ret == WORKQ_UERROR) {
ctf_dprintf("internal convert failed: %s\n",
- ctf_errmsg(*errp));
+ ctf_errmsg(err));
goto out;
}
@@ -2954,44 +3041,37 @@ ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp,
if (ndies != 1) {
ctf_merge_t *cmp;
- cmp = ctf_merge_init(fd, &ret);
- if (cmp == NULL) {
- *errp = ret;
+ cmp = ctf_merge_init(fd, &err);
+ if (cmp == NULL)
goto out;
- }
ctf_dprintf("setting threads\n");
- if ((ret = ctf_merge_set_nthreads(cmp, nthrs)) != 0) {
+ if ((err = ctf_merge_set_nthreads(cmp, nthrs)) != 0) {
ctf_merge_fini(cmp);
- *errp = ret;
goto out;
}
for (i = 0; i < ndies; i++) {
cup = &cdies[i];
- ctf_dprintf("adding cu %s (%p)\n", cup->cu_name,
- cup->cu_ctfp);
- if ((ret = ctf_merge_add(cmp, cup->cu_ctfp)) != 0) {
+ if ((err = ctf_merge_add(cmp, cup->cu_ctfp)) != 0) {
ctf_merge_fini(cmp);
- *errp = ret;
goto out;
}
}
ctf_dprintf("performing merge\n");
- ret = ctf_merge_merge(cmp, fpp);
- if (ret != 0) {
+ err = ctf_merge_merge(cmp, fpp);
+ if (err != 0) {
ctf_dprintf("failed merge!\n");
*fpp = NULL;
ctf_merge_fini(cmp);
- *errp = ret;
goto out;
}
ctf_merge_fini(cmp);
- *errp = 0;
+ err = 0;
ctf_dprintf("successfully converted!\n");
} else {
- *errp = 0;
+ err = 0;
*fpp = cdies->cu_ctfp;
cdies->cu_ctfp = NULL;
ctf_dprintf("successfully converted!\n");
@@ -3000,5 +3080,5 @@ ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp,
out:
workq_fini(wqp);
ctf_dwarf_free_dies(cdies, ndies);
- return (*fpp != NULL ? CTF_CONV_SUCCESS : CTF_CONV_ERROR);
+ return (err);
}
diff --git a/usr/src/lib/libctf/common/libctf.h b/usr/src/lib/libctf/common/libctf.h
index 0951ae0606..57b8376eed 100644
--- a/usr/src/lib/libctf/common/libctf.h
+++ b/usr/src/lib/libctf/common/libctf.h
@@ -24,7 +24,7 @@
* Use is subject to license terms.
*/
/*
- * Copyright (c) 2015, Joyent, Inc.
+ * Copyright (c) 2019, Joyent, Inc.
*/
/*
@@ -44,6 +44,7 @@
#define _LIBCTF_H
#include <sys/ctf_api.h>
+#include <libelf.h>
#ifdef __cplusplus
extern "C" {
@@ -74,10 +75,23 @@ extern int ctf_diff_functions(ctf_diff_t *, ctf_diff_func_f, void *);
extern int ctf_diff_objects(ctf_diff_t *, ctf_diff_obj_f, void *);
extern void ctf_diff_fini(ctf_diff_t *);
-#define CTF_CONVERT_F_IGNNONC 0x01
+/*
+ * Normally, we return a failure if we find a C-derived compilation unit that
+ * lacks DWARF or CTF (as required). This flag over-rides this check.
+ */
+#define CTF_ALLOW_MISSING_DEBUG 0x01
+
extern ctf_file_t *ctf_fdconvert(int, const char *, uint_t, uint_t, int *,
char *, size_t);
+typedef enum ctf_hsc_ret {
+ CHR_ERROR = -1,
+ CHR_NO_C_SOURCE = 0,
+ CHR_HAS_C_SOURCE = 1
+} ctf_hsc_ret_t;
+
+extern ctf_hsc_ret_t ctf_has_c_source(Elf *, char *, size_t);
+
typedef struct ctf_merge_handle ctf_merge_t;
extern ctf_merge_t *ctf_merge_init(int, int *);
extern int ctf_merge_add(ctf_merge_t *, ctf_file_t *);
diff --git a/usr/src/lib/libctf/common/libctf_impl.h b/usr/src/lib/libctf/common/libctf_impl.h
index be091ef199..5c88b9454d 100644
--- a/usr/src/lib/libctf/common/libctf_impl.h
+++ b/usr/src/lib/libctf/common/libctf_impl.h
@@ -29,15 +29,9 @@
extern "C" {
#endif
-typedef enum ctf_conv_status {
- CTF_CONV_SUCCESS = 0,
- CTF_CONV_ERROR = 1,
- CTF_CONV_NOTSUP = 2
-} ctf_conv_status_t;
-
-typedef ctf_conv_status_t (*ctf_convert_f)(int, Elf *, uint_t, int *,
+typedef int (*ctf_convert_f)(int, Elf *, uint_t, uint_t,
ctf_file_t **, char *, size_t);
-extern ctf_conv_status_t ctf_dwarf_convert(int, Elf *, uint_t, int *,
+extern int ctf_dwarf_convert(int, Elf *, uint_t, uint_t,
ctf_file_t **, char *, size_t);
/*
diff --git a/usr/src/lib/libctf/common/mapfile-vers b/usr/src/lib/libctf/common/mapfile-vers
index b26ee8ceb4..37ef440ab3 100644
--- a/usr/src/lib/libctf/common/mapfile-vers
+++ b/usr/src/lib/libctf/common/mapfile-vers
@@ -23,7 +23,7 @@
#
#
-# Copyright 2018 Joyent, Inc.
+# Copyright 2019 Joyent, Inc.
#
#
@@ -86,6 +86,7 @@ SYMBOL_VERSION SUNWprivate_1.2 {
ctf_func_args_by_id;
ctf_func_info_by_id;
ctf_function_iter;
+ ctf_has_c_source;
ctf_kind_name;
ctf_label_info;
ctf_label_iter;
diff --git a/usr/src/lib/libfru/Makefile.targ b/usr/src/lib/libfru/Makefile.targ
index 709e1a8159..cec17959b0 100644
--- a/usr/src/lib/libfru/Makefile.targ
+++ b/usr/src/lib/libfru/Makefile.targ
@@ -23,9 +23,7 @@
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-#
-# lib/libfru/Makefile.targ
+# Copyright (c) 2019, Joyent, Inc.
#
include ../../Makefile.targ
@@ -33,15 +31,15 @@ include ../../Makefile.targ
# build rules for pics. (access sub directories)
pics/%.o objs/%.o: ../libfru/%.cc
$(COMPILE.cc) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_CC_O)
pics/%.o objs/%.o: ../libfrureg/%.cc
$(COMPILE.cc) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_CC_O)
pics/%.o objs/%.o: ../libgenutil/%.cc
$(COMPILE.cc) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_CC_O)
# some special rules for the yacc and lex parser. (with sub directories)
pics/y.tab.cc pics/y.tab.h: ../libfru/nameSyntaxYacc.y
diff --git a/usr/src/lib/libm/Makefile.targ b/usr/src/lib/libm/Makefile.targ
index 8d8588ad1b..e2d96834f8 100644
--- a/usr/src/lib/libm/Makefile.targ
+++ b/usr/src/lib/libm/Makefile.targ
@@ -12,10 +12,12 @@
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
#
+# Copyright (c) 2019, Joyent, Inc.
+#
pics/%.o: $(LIBMDIR)/$(TARGETMACH)/src/%.$(ASSUFFIX)
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(SRCDIR)/C/%.c $(LM_IL)
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/lib/libmvec/Makefile.com b/usr/src/lib/libmvec/Makefile.com
index e574b0df22..6498f511e4 100644
--- a/usr/src/lib/libmvec/Makefile.com
+++ b/usr/src/lib/libmvec/Makefile.com
@@ -12,6 +12,8 @@
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
#
+# Copyright (c) 2019, Joyent, Inc.
+#
LIBMDIR = $(SRC)/lib/libm
@@ -159,7 +161,7 @@ LIBS = $(DYNLIB)
SRCDIR = ../common/
DYNFLAGS += $(ZIGNORE)
-LINTERROFF = -erroff=E_FP_DIVISION_BY_ZERO
+LINTERROFF = -erroff=E_FP_DIVISION_BY_ZERO
LINTERROFF += -erroff=E_FP_INVALID
LINTERROFF += -erroff=E_BAD_PTR_CAST_ALIGN
LINTERROFF += -erroff=E_ASSIGMENT_CAUSE_LOSS_PREC
@@ -274,8 +276,8 @@ lint: lintcheck
pics/%.o: ../$(TARGET_ARCH)/src/%.S
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: ../common/$$(CHIP)/%.S
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
diff --git a/usr/src/lib/libnisdb/Makefile b/usr/src/lib/libnisdb/Makefile
index 762f725643..66fbf91865 100644
--- a/usr/src/lib/libnisdb/Makefile
+++ b/usr/src/lib/libnisdb/Makefile
@@ -23,7 +23,7 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
LIBRARY= libnisdb.a
VERS= .2
@@ -204,14 +204,6 @@ install: all $(ROOTLIBS) $(ROOTLINKS)
lint: $(DERIVED_FILES) .WAIT lintcheck
-pics/%.o: %.c
- $(COMPILE.c) -o $@ $<
- $(POST_PROCESS_O)
-
-pics/%.o: %.cc
- $(COMPILE.cc) -o $@ $<
- $(POST_PROCESS_O)
-
objs/%.o pics/%.o profs/%.o: $(YPTOL_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
diff --git a/usr/src/lib/libsqlite/Makefile.com b/usr/src/lib/libsqlite/Makefile.com
index 6ab092d4d1..5e1f3d8072 100644
--- a/usr/src/lib/libsqlite/Makefile.com
+++ b/usr/src/lib/libsqlite/Makefile.com
@@ -3,7 +3,7 @@
# Use is subject to license terms.
# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
# Copyright 2016 Nexenta Systems, Inc. All rights reserved.
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
@@ -158,6 +158,8 @@ $(NATIVETARGETS) := LDLIBS = -lc
$(OBJS) := CFLAGS += $(CTF_FLAGS)
$(OBJS) := CTFCONVERT_POST = $(CTFCONVERT_O)
+$(NATIVEOBJS) := CFLAGS += $(CTF_FLAGS)
+$(NATIVEOBJS) := CTFCONVERT_POST = $(CTFCONVERT_O)
TCLBASE = /usr/sfw
TCLVERS = tcl8.3
diff --git a/usr/src/lib/libtnfctl/Makefile.com b/usr/src/lib/libtnfctl/Makefile.com
index bbc56e5257..b9392268ce 100644
--- a/usr/src/lib/libtnfctl/Makefile.com
+++ b/usr/src/lib/libtnfctl/Makefile.com
@@ -22,7 +22,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
LIBRARY= libtnfctl.a
VERS= .1
@@ -107,7 +107,7 @@ BUILD.s= $(AS) $< -o $@
objs/%.o pics/%.o: ../%.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
objs/%.o pics/%.o: ../%.c
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/lib/libtnfprobe/Makefile.com b/usr/src/lib/libtnfprobe/Makefile.com
index f4df1679f3..bfdceac994 100644
--- a/usr/src/lib/libtnfprobe/Makefile.com
+++ b/usr/src/lib/libtnfprobe/Makefile.com
@@ -21,7 +21,7 @@
#
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
LIBRARY= libtnfprobe.a
VERS= .1
@@ -97,7 +97,7 @@ BUILD.s= $(AS) $(ASFLAGS) $< -o $@
objs/%.o pics/%.o: ../%.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o objs/%.o: ../%.c
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/lib/libumem/Makefile.targ b/usr/src/lib/libumem/Makefile.targ
index c56b5fd9f5..621b935002 100644
--- a/usr/src/lib/libumem/Makefile.targ
+++ b/usr/src/lib/libumem/Makefile.targ
@@ -22,6 +22,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
+# Copyright (c) 2019, Joyent, Inc.
#
#
@@ -74,7 +75,7 @@ objs/%.o pics/%.o: $(ISASRCDIR)/%.c
objs/%.o pics/%.o: $(ISASRCDIR)/%.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
objs/%.o pics/%.o: ../common/%.c
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile
index 1d184f528a..5fdac2dd0c 100644
--- a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile
+++ b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile
@@ -22,9 +22,8 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2017 Jason King
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright (c) 2019, Joyent, Inc.
#
-# Copyright (c) 2018, Joyent, Inc.
LIBRARY = libsoftcrypto.a
VERS = .1
@@ -87,7 +86,7 @@ pics/%.o: $(AES_DIR)/$(MACH64)/%.c
pics/%.o: $(AES_DIR)/$(MACH64)/%.s
$(COMPILE.s) $(AES_FLAGS) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.c
$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $<
@@ -95,11 +94,11 @@ pics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.c
pics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.s
$(COMPILE64.s) $(BIGNUM_FLAGS) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(MODES_DIR)/$(MACH64)/%.s
$(COMPILE64.s) $(MODES_FLAGS) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
include ../Makefile.targ
@@ -108,4 +107,4 @@ arcfour-x86_64.s: $(ARCFOUR_DIR)/amd64/arcfour-x86_64.pl
pics/%.o: arcfour-x86_64.s
$(COMPILE64.s) $(ARCFOUR_FLAGS) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile
index 87f618b38a..dda85c9669 100644
--- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile
@@ -22,6 +22,8 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
+# Copyright (c) 2019, Joyent, Inc.
+#
BIGNUM_PSM_OBJS = bignum_i386.o bignum_i386_asm.o
@@ -53,4 +55,4 @@ pics/bignum_i386.o: $(BIGNUM_DIR)/i386/bignum_i386.c
pics/bignum_i386_asm.o: $(BIGNUM_DIR)/i386/bignum_i386_asm.s
$(COMPILE.s) -o $@ $(BIGNUM_DIR)/i386/bignum_i386_asm.s
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)