diff options
author | Roger A. Faulkner <Roger.Faulkner@Sun.COM> | 2008-12-15 20:19:14 -0800 |
---|---|---|
committer | Roger A. Faulkner <Roger.Faulkner@Sun.COM> | 2008-12-15 20:19:14 -0800 |
commit | 7b1b42816975f5b0069dff7932115ba672ad125c (patch) | |
tree | a5ebe62183ca00bf3812a0844ab9d92cc65bcf4f /usr/src | |
parent | bff3dadc2c9a6711b6e359fc39d0170de218be50 (diff) | |
download | illumos-gate-7b1b42816975f5b0069dff7932115ba672ad125c.tar.gz |
6540117 libc should be compiled with -xstrconst
6556156 libnsl+libsocket should be compiled with -xstrconst
Contributed by Roland Mainz <roland.mainz@nrubsig.org>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libc/amd64/Makefile | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/i386/Makefile.com | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/sparc/Makefile | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/sparcv9/Makefile | 4 | ||||
-rw-r--r-- | usr/src/lib/libnsl/Makefile.com | 10 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nis/cache/cache.cc | 7 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nis/cache/cache.h | 7 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nis/cache/cold_start.cc | 13 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nis/cache/cold_start.h | 20 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nis/cache/mapped_cache.cc | 11 | ||||
-rw-r--r-- | usr/src/lib/libsocket/Makefile.com | 9 |
11 files changed, 55 insertions, 38 deletions
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index b85a986f30..559d932357 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -18,6 +18,7 @@ # # CDDL HEADER END # + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -920,6 +921,9 @@ CFLAGS64 += -xinline= THREAD_DEBUG = $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG +# Make string literals read-only to save memory +CFLAGS64 += $(XSTRCONST) + ALTPICS= $(TRACEOBJS:%=pics/%) $(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index b575da22b0..bab903b886 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -18,6 +18,7 @@ # # CDDL HEADER END # + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -966,6 +967,9 @@ CFLAGS += $(XINLINE) THREAD_DEBUG = $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG +# Make string literals read-only to save memory. +CFLAGS += $(XSTRCONST) + ALTPICS= $(TRACEOBJS:%=pics/%) $(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a diff --git a/usr/src/lib/libc/sparc/Makefile b/usr/src/lib/libc/sparc/Makefile index 75cc4c7e13..36f5ac4d42 100644 --- a/usr/src/lib/libc/sparc/Makefile +++ b/usr/src/lib/libc/sparc/Makefile @@ -18,6 +18,7 @@ # # CDDL HEADER END # + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -986,6 +987,9 @@ CFLAGS += -xinline= THREAD_DEBUG = $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG +# Make string literals read-only to save memory. +CFLAGS += $(XSTRCONST) + ALTPICS= $(TRACEOBJS:%=pics/%) $(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a diff --git a/usr/src/lib/libc/sparcv9/Makefile b/usr/src/lib/libc/sparcv9/Makefile index dfa820097d..58e4629401 100644 --- a/usr/src/lib/libc/sparcv9/Makefile +++ b/usr/src/lib/libc/sparcv9/Makefile @@ -18,6 +18,7 @@ # # CDDL HEADER END # + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -929,6 +930,9 @@ CFLAGS64 += -xinline= THREAD_DEBUG = $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG +# Make string literals read-only to save memory. +CFLAGS64 += $(XSTRCONST) + ALTPICS= $(TRACEOBJS:%=pics/%) $(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a diff --git a/usr/src/lib/libnsl/Makefile.com b/usr/src/lib/libnsl/Makefile.com index 213ef8cfb3..53fb3c22cd 100644 --- a/usr/src/lib/libnsl/Makefile.com +++ b/usr/src/lib/libnsl/Makefile.com @@ -18,12 +18,11 @@ # # CDDL HEADER END # + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libnsl.a VERS= .1 @@ -204,6 +203,13 @@ CPPFLAGS += -I$(SRC)/lib/common/inc -I$(SRC)/lib/libnsl/include -D_REENTRANT CPPFLAGS += -I$(SRC)/lib/libnsl/dial CFLAGS += $(CCVERBOSE) + +# Make string literals read-only to save memory. +CFLAGS += $(XSTRCONST) +CFLAGS64 += $(XSTRCONST) +CCFLAGS += -_CC=-features=conststrings +CCFLAGS64 += -_CC=-features=conststrings + LIBMP = -lmp lint := LIBMP = LDLIBS += $(LIBMP) -lmd -lscf -lc diff --git a/usr/src/lib/libnsl/nis/cache/cache.cc b/usr/src/lib/libnsl/nis/cache/cache.cc index 52112ddf6f..7f4d1d78d5 100644 --- a/usr/src/lib/libnsl/nis/cache/cache.cc +++ b/usr/src/lib/libnsl/nis/cache/cache.cc @@ -18,13 +18,12 @@ * * CDDL HEADER END */ + /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mt.h" #include <stdio.h> #include <ctype.h> @@ -1030,7 +1029,7 @@ NisCache::writePreference(FILE *fp) void -NisCache::mergeOption(char *value) +NisCache::mergeOption(const char *value) { if (value && *value) { if (strcasecmp(value, PREF_ALL) == 0) { diff --git a/usr/src/lib/libnsl/nis/cache/cache.h b/usr/src/lib/libnsl/nis/cache/cache.h index 5664a8cd29..f45b167c01 100644 --- a/usr/src/lib/libnsl/nis/cache/cache.h +++ b/usr/src/lib/libnsl/nis/cache/cache.h @@ -18,16 +18,15 @@ * * CDDL HEADER END */ + /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _CACHE_H #define _CACHE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { @@ -164,7 +163,7 @@ class NisCache { void rerankServers(); void writePreference(FILE *fp); void mergePreference(char *value); - void mergeOption(char *value); + void mergeOption(const char *value); void resetPreference(); void backupPreference(); void delBackupPref(); diff --git a/usr/src/lib/libnsl/nis/cache/cold_start.cc b/usr/src/lib/libnsl/nis/cache/cold_start.cc index 91ae40b620..f8f9c4494e 100644 --- a/usr/src/lib/libnsl/nis/cache/cold_start.cc +++ b/usr/src/lib/libnsl/nis/cache/cold_start.cc @@ -18,13 +18,12 @@ * * CDDL HEADER END */ + /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Ported from SCCS version : * "@(#)cold_start.cc 1.16 91/03/14 Copyr 1988 Sun Micro"; @@ -76,7 +75,7 @@ extern "C" void prime_pkey_cache(directory_obj *); static bool_t -readColdStartFile(char *fileName, directory_obj *dobj, int prime) +readColdStartFile(const char *fileName, directory_obj *dobj, int prime) { FILE *fp; XDR xdrs; @@ -110,7 +109,7 @@ readColdStartFile(char *fileName, directory_obj *dobj, int prime) * Read coldstart file and prime public key cache. */ bool_t -readColdStartFile(char *fileName, directory_obj *dobj) +readColdStartFile(const char *fileName, directory_obj *dobj) { return (readColdStartFile(fileName, dobj, 1)); } @@ -121,7 +120,7 @@ readColdStartFile(char *fileName, directory_obj *dobj) */ static bool_t -loadColdStartFile(char *fileName, directory_obj *dobj) +loadColdStartFile(const char *fileName, directory_obj *dobj) { return (readColdStartFile(fileName, dobj, 0)); } @@ -135,7 +134,7 @@ loadColdStartFile(char *fileName, directory_obj *dobj) */ bool_t -__nis_writeColdStartFile(char *fileName, directory_obj *dobj) +__nis_writeColdStartFile(const char *fileName, directory_obj *dobj) { FILE *fp; int fd; diff --git a/usr/src/lib/libnsl/nis/cache/cold_start.h b/usr/src/lib/libnsl/nis/cache/cold_start.h index 358a29ba6b..9e823aa9c1 100644 --- a/usr/src/lib/libnsl/nis/cache/cold_start.h +++ b/usr/src/lib/libnsl/nis/cache/cold_start.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,20 +18,19 @@ * * CDDL HEADER END */ + /* - * Copyright (c) 1996, by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #ifndef __COLD_START_H #define __COLD_START_H -#pragma ident "%Z%%M% %I% %E% SMI" - -extern bool_t readColdStartFile(char *fileName, directory_obj *dobj); -extern bool_t __nis_writeColdStartFile(char *fileName, directory_obj *dobj); +extern bool_t readColdStartFile(const char *, directory_obj *); +extern bool_t __nis_writeColdStartFile(const char *, directory_obj *); -extern "C" bool_t writeColdStartFile_unsafe(directory_obj *dobj); -extern "C" bool_t writeColdStartFile(directory_obj *dobj); +extern "C" bool_t writeColdStartFile_unsafe(directory_obj *); +extern "C" bool_t writeColdStartFile(directory_obj *); #endif /* __COLD_START_H */ diff --git a/usr/src/lib/libnsl/nis/cache/mapped_cache.cc b/usr/src/lib/libnsl/nis/cache/mapped_cache.cc index f110143426..5738b31c1b 100644 --- a/usr/src/lib/libnsl/nis/cache/mapped_cache.cc +++ b/usr/src/lib/libnsl/nis/cache/mapped_cache.cc @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -21,12 +20,10 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mt.h" #include <sys/types.h> #include <unistd.h> @@ -175,7 +172,7 @@ NisMappedCache::getSemaphores() int NisMappedCache::mapCache() { - char *name; + const char *name; int open_mode; int map_mode; int status = 0; diff --git a/usr/src/lib/libsocket/Makefile.com b/usr/src/lib/libsocket/Makefile.com index 3e4c403fe3..cdb99117c5 100644 --- a/usr/src/lib/libsocket/Makefile.com +++ b/usr/src/lib/libsocket/Makefile.com @@ -18,12 +18,11 @@ # # CDDL HEADER END # + # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libsocket.a VERS = .1 @@ -52,6 +51,10 @@ $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) MAPFILES += mapfile-vers +# Make string literals read-only to save memory. +CFLAGS += $(XSTRCONST) +CFLAGS64 += $(XSTRCONST) + CPPFLAGS += -DSYSV -D_REENTRANT -I../../common/inc %/rcmd.o := CPPFLAGS += -DNIS |