Print this page
crt: Need a position-independent CRT for PIE
- Implement the greatest possible part of the crt1 in C
- Implement SPARC versions of the ASM sections of crt1
- Build crt1 position-independently, minor ASM updates to be position
independent
- Implement crt1 with the hook expected by modern GCC to support
profiling, make gcrt1 a symlink for source compatibility (older GCC
initializes profiling at firsnt use of _mcount if necessary, so
doesn't need the gcrt)
- Split the CRT out of developer/library/lint into a separate c-runtime package
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/getconf/Makefile
+++ new/usr/src/cmd/getconf/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License, Version 1.0 only
6 6 # (the "License"). You may not use this file except in compliance
7 7 # with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22 #
23 23 # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26
27 27 PROG= getconf
28 28 XPG4PROG= getconf
29 29 XPG6PROG= getconf
30 30 X4= objs.xpg4
31 31 X6= objs.xpg6
32 32 OBJS= getconf.o
33 33 XPG4EXOBJS= $(X4)/getconf.o
34 34 XPG6EXOBJS= $(X6)/getconf.o
35 35
36 36 include ../Makefile.cmd
37 37
38 38 XPG4EXOBJS += values-xpg4.o
39 39 CFLAGS += $(CCVERBOSE)
40 40 # XPG4
41 41 $(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc
42 42
43 43 # XPG6MODE: Depending on the version of the compiler, the value of
44 44 # __STDC_VERSION__ may differ even in the presence of the same compilation
45 45 # options. The default compilation mode for Sun compilers that support the
46 46 # C99 standard is -xc99=all,no_lib. C99MODE= is equivalent to -xc99=all,no_lib.
47 47 # This translates to C99 semantics without the C99 library specific behaviors
48 48 # and dependencies.
49 49 #
50 50 # For pre-5.7 compilers (unless patched with 117551-04 or 117552-05), in the
51 51 # default compilation mode, __STDC_VERSION__ was defined to be 199901L. For
52 52 # 5.7 and on compilers, __STDC_VERSION__ defaults to 199409L in order to
53 53 # maintain source compatibility. Neither of these cases results in the
54 54 # importing of /usr/lib/values-xpg6.o, so we need to either manually import
55 55 # it via linking with a local version of the object, or set -xc99=%all which
56 56 # by default imports /usr/lib/values-xpg6.o. C99MODE=C99_ENABLE is equivalent
57 57 # to -xc99=all. If C99_ENABLE is defined and we also attempt to link with a
58 58 # local version of values-xpg6.o, an error will occur due to multiple
59 59 # definitions for __xpg4 and __xpg6. Because /usr/lib/values-xpg6.o was
60 60 # delivered in Solaris 10 and is a stable interface, there is no need to
61 61 # build and link with a local version of the object.
62 62 #
63 63 # The gcc compiler behaves differently and requires -std=gnu99.
64 64 #
65 65 # For XPG4, we need to link with a local version of values-xpg4.o because
66 66 # the compiler only imports this by default (from /usr/lib/values-xpg4.o)
67 67 # if we use the c89 utility as opposed to cc.
68 68
69 69 XPG6MODE = $(C99_ENABLE)
70 70 $(XPG6) := C99MODE = $(XPG6MODE)
71 71 $(XPG6) := CFLAGS += -D_XOPEN_SOURCE=600 -I$(SRC)/lib/libc/inc
72 72
73 73 .KEEP_STATE:
74 74
75 75 all: $(PROG) $(XPG4) $(XPG6)
76 76
77 77 $(PROG): $(OBJS)
78 78 $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
79 79 $(POST_PROCESS)
80 80
81 81 $(XPG4): $(X4) $(XPG4EXOBJS)
82 82 $(LINK.c) -o $@ $(XPG4EXOBJS) $(LDLIBS)
83 83 $(POST_PROCESS)
84 84
85 85 $(XPG6): $(X6) $(XPG6EXOBJS)
86 86 $(LINK.c) -o $@ $(XPG6EXOBJS) $(LDLIBS)
87 87 $(POST_PROCESS)
88 88
89 89
90 90 $(XPG4EXOBJS): $(X4)
91 91
92 92
93 93 $(X4)/%.o: %.c
94 94 $(COMPILE.c) -o $@ $<
95 95
96 96
97 97 $(X4):
98 98 -@mkdir -p $@
99 99
100 100
101 101 $(XPG6EXOBJS): $(X6)
102 102
103 103
↓ open down ↓ |
103 lines elided |
↑ open up ↑ |
104 104 $(X6)/%.o: %.c
105 105 $(COMPILE.c) -o $@ $<
106 106
107 107
108 108 $(X6):
109 109 -@mkdir -p $@
110 110
111 111
112 112 install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
113 113
114 -values-xpg4.o: ../../lib/common/common/values-xpg4.c
115 - $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
114 +values-xpg4.o: ../../lib/crt/common/values-xpg4.c
115 + $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
116 116
117 117 clean:
118 118 -@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \
119 119 $(PROG) $(XPG4) $(XPG6)
120 120
121 121 lint: lint_PROG
122 122
123 123 include ../Makefile.targ
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX