10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
26 #
27
28 include $(SRC)/Makefile.master
29
30 FILES= \
31 $(MACH)_cc_map.noexeglobs \
32 $(MACH)_gcc_map.noexeglobs
33
34 $(BUILD64)FILES += \
35 $(MACH64)_cc_map.noexeglobs \
36 $(MACH64)_gcc_map.noexeglobs
37
38 SYMS1= syms.1
39 SYMS2= syms.2
40 MAIN1= main.1
41 MAIN2= main.2
42
43 TEMPLATE1= map.noexeglobs.1.template
44 TEMPLATE2= map.noexeglobs.2.template
45
46 all install: $(FILES)
47
48 lint:
49
50 clean:
51 $(RM) $(SYMS1) $(SYMS2) $(MAIN1) $(MAIN2)
52
53 clobber: clean
54 $(RM) $(FILES)
55
56 # A number of dynamic executables have their own definitions of interfaces that
57 # exist in system libraries. To prevent name-space pollution it is desirable
58 # to demote the interfaces within these executable to locals. However, various
59 # symbols defined by the compiler drivers crt/values files need to remain
60 # global in any dynamic object that includes these files. These symbols
61 # interpose on symbols in libc, or provide call backs for other system
62 # libraries. The various compiler drivers (cc and gcc), and the crt/values
63 # files that these drivers are configured to include, differ between the
64 # various compilations environments (platform, 32/64-bit). Therefore, the
65 # only means of creating a mapfile to demote symbols is to dynamically generate
66 # the mapfile for a specific compilation environment.
67 #
68 # Here, template mapfiles are used to generate a number of compilation specific
69 # mapfiles. These mapfiles are referenced by components of the build through
70 # the MAPFILE.NGB macro defined in Makefile.master. These dynamically created
71 # mapfiles are not delivered into the $ROOT area, and therefore are not
72 # delivered as packaged components of the OSNet.
73
74 $(MACH)_cc_map.noexeglobs := LINK = $(LINK.c)
75 $(MACH64)_cc_map.noexeglobs := LINK = $(LINK64.c)
76
77 $(MACH)_gcc_map.noexeglobs := CC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
78 $(MACH)_gcc_map.noexeglobs := LINK = $(LINK.c)
79 $(MACH64)_gcc_map.noexeglobs := CC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
80 $(MACH64)_gcc_map.noexeglobs := LINK = $(LINK64.c)
81
82 # This generic target creates two dynamic executables from an empty "main"
83 # program. These objects are not executed, but are analyzed to determine the
84 # global symbols each provides.
85 #
86 # The first executable demotes a family of known interfaces to local and allows
87 # all other symbol definitions to remain global. This executables provides the
88 # base for discovering all symbol definitions provided by the various
89 # compilation environments. The second executable demotes all symbols to
90 # locals. Within both executables, some symbols remain globals (_end, _etext,
91 # etc.) as the link-editor has special knowledge of these symbols and their
92 # expected visibility requirements. By inspecting the deferences between the
93 # global symbols within the two executables, a mapfile can be generated to
94 # ensure the symbols defined by the compilation environments files remain
95 # global.
96
97 %map.noexeglobs:main.c $(TEMPLATE1) $(TEMPLATE2)
98 $(LINK) -o $(MAIN1) -M$(TEMPLATE1) main.c
99 $(ELFDUMP) -s -N.dynsym $(MAIN1) | $(EGREP) "WEAK|GLOB" | \
|
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
26 #
27
28 include $(SRC)/Makefile.master
29
30
31 $(__GNUC)FILES= $(MACH)_gcc_map.noexeglobs
32 $(__SUNC)FILES= $(MACH)_cc_map.noexeglobs
33
34 $(__GNUC)$(BUILD64)FILES += $(MACH64)_gcc_map.noexeglobs
35 $(__SUNC)$(BUILD64)FILES += $(MACH64)_cc_map.noexeglobs
36
37 SYMS1= syms.1
38 SYMS2= syms.2
39 MAIN1= main.1
40 MAIN2= main.2
41
42 TEMPLATE1= map.noexeglobs.1.template
43 TEMPLATE2= map.noexeglobs.2.template
44
45 all install: $(FILES)
46
47 lint:
48
49 clean:
50 $(RM) $(SYMS1) $(SYMS2) $(MAIN1) $(MAIN2)
51
52 clobber: clean
53 $(RM) $(FILES)
54
55 # A number of dynamic executables have their own definitions of interfaces that
56 # exist in system libraries. To prevent name-space pollution it is desirable
57 # to demote the interfaces within these executable to locals. However, various
58 # symbols defined by the compiler drivers crt/values files need to remain
59 # global in any dynamic object that includes these files. These symbols
60 # interpose on symbols in libc, or provide call backs for other system
61 # libraries. The various compiler drivers (cc and gcc), and the crt/values
62 # files that these drivers are configured to include, differ between the
63 # various compilations environments (platform, 32/64-bit). Therefore, the
64 # only means of creating a mapfile to demote symbols is to dynamically generate
65 # the mapfile for a specific compilation environment.
66 #
67 # Here, template mapfiles are used to generate a number of compilation specific
68 # mapfiles. These mapfiles are referenced by components of the build through
69 # the MAPFILE.NGB macro defined in Makefile.master. These dynamically created
70 # mapfiles are not delivered into the $ROOT area, and therefore are not
71 # delivered as packaged components of the OSNet.
72
73 $(MACH)_cc_map.noexeglobs := LINK = $(LINK.c)
74 $(MACH64)_cc_map.noexeglobs := LINK = $(LINK64.c)
75 $(MACH)_gcc_map.noexeglobs := LINK = $(LINK.c)
76 $(MACH64)_gcc_map.noexeglobs := LINK = $(LINK64.c)
77
78 # This generic target creates two dynamic executables from an empty "main"
79 # program. These objects are not executed, but are analyzed to determine the
80 # global symbols each provides.
81 #
82 # The first executable demotes a family of known interfaces to local and allows
83 # all other symbol definitions to remain global. This executables provides the
84 # base for discovering all symbol definitions provided by the various
85 # compilation environments. The second executable demotes all symbols to
86 # locals. Within both executables, some symbols remain globals (_end, _etext,
87 # etc.) as the link-editor has special knowledge of these symbols and their
88 # expected visibility requirements. By inspecting the deferences between the
89 # global symbols within the two executables, a mapfile can be generated to
90 # ensure the symbols defined by the compilation environments files remain
91 # global.
92
93 %map.noexeglobs:main.c $(TEMPLATE1) $(TEMPLATE2)
94 $(LINK) -o $(MAIN1) -M$(TEMPLATE1) main.c
95 $(ELFDUMP) -s -N.dynsym $(MAIN1) | $(EGREP) "WEAK|GLOB" | \
|