19 # CDDL HEADER END
20 #
21 #
22 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright 2016 Joyent, Inc.
24 #
25 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
26 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
27 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
28 # Use is subject to license terms.
29 #
30
31 LIBCBASE= .
32 LIBCDIR= $(SRC)/lib/libc
33 LIBRARY= libc.a
34 LIB_PIC= libc_pic.a
35 VERS= .1
36 CPP= /usr/lib/cpp
37 TARGET_ARCH= amd64
38
39 # objects are grouped by source directory
40
41 # local objects
42 STRETS=
43
44 CRTOBJS= \
45 cerror.o
46
47 DYNOBJS=
48
49 FPOBJS= \
50 fpgetmask.o \
51 fpgetround.o \
52 fpsetmask.o \
53 fpsetround.o \
54 fpstart.o \
55 ieee.o
56
57 I386FPOBJS= \
58 _D_cplx_div.o \
89 ATOMICOBJS= \
90 atomic.o
91
92 CHACHAOBJS= \
93 chacha.o
94
95 XATTROBJS= \
96 xattr_common.o
97 COMOBJS= \
98 bcmp.o \
99 bcopy.o \
100 bsearch.o \
101 bzero.o \
102 qsort.o \
103 strtol.o \
104 strtoul.o \
105 strtoll.o \
106 strtoull.o
107
108 GENOBJS= \
109 _getsp.o \
110 abs.o \
111 alloca.o \
112 arc4random.o \
113 arc4random_uniform.o \
114 attrat.o \
115 byteorder.o \
116 cuexit.o \
117 ecvt.o \
118 endian.o \
119 errlst.o \
120 amd64_data.o \
121 ldivide.o \
122 lock.o \
123 makectxt.o \
124 memccpy.o \
125 memchr.o \
126 memcmp.o \
127 memcpy.o \
128 memset.o \
264 stty.o \
265 sync.o \
266 sysconfig.o \
267 sysfs.o \
268 sysinfo.o \
269 syslwp.o \
270 times.o \
271 ulimit.o \
272 umask.o \
273 umount2.o \
274 utssys.o \
275 uucopy.o \
276 vhangup.o \
277 waitid.o \
278 write.o \
279 writev.o \
280 yield.o
281
282 SYSOBJS= \
283 __clock_gettime.o \
284 __getcontext.o \
285 __uadmin.o \
286 _lwp_mutex_unlock.o \
287 _stack_grow.o \
288 door.o \
289 forkx.o \
290 forkallx.o \
291 getcontext.o \
292 gettimeofday.o \
293 lwp_private.o \
294 nuname.o \
295 syscall.o \
296 sysi86.o \
297 tls_get_addr.o \
298 uadmin.o \
299 umount.o \
300 uname.o \
301 vforkx.o
302
303 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
859 # This macro should ALWAYS be empty; native APIs are already 'large file'.
860 PORTSYS64=
861
862 PORTSYS= \
863 _autofssys.o \
864 access.o \
865 acctctl.o \
866 bsd_signal.o \
867 chmod.o \
868 chown.o \
869 corectl.o \
870 epoll.o \
871 exacctsys.o \
872 execl.o \
873 execle.o \
874 execv.o \
875 eventfd.o \
876 fcntl.o \
877 getpagesizes.o \
878 getpeerucred.o \
879 inst_sync.o \
880 issetugid.o \
881 label.o \
882 link.o \
883 lockf.o \
884 lwp.o \
885 lwp_cond.o \
886 lwp_rwlock.o \
887 lwp_sigmask.o \
888 meminfosys.o \
889 mkdir.o \
890 mknod.o \
891 msgsys.o \
892 nfssys.o \
893 open.o \
894 pgrpsys.o \
895 posix_sigwait.o \
896 ppriv.o \
897 psetsys.o \
898 rctlsys.o \
1042
1043 # Force libc's internal references to be resolved immediately upon loading
1044 # in order to avoid critical region problems. Since almost all libc symbols
1045 # are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1046 DYNFLAGS += -znow
1047
1048 BUILD.s= $(AS) $(ASFLAGS) $< -o $@
1049
1050 # Override this top level flag so the compiler builds in its native
1051 # C99 mode. This has been enabled to support the complex arithmetic
1052 # added to libc.
1053 C99MODE= $(C99_ENABLE)
1054
1055 # libc method of building an archive
1056 # The "$(GREP) -v ' L '" part is necessary only until
1057 # lorder is fixed to ignore thread-local variables.
1058 BUILD.AR= $(RM) $@ ; \
1059 $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1060
1061 # extra files for the clean target
1062 CLEANFILES= \
1063 $(LIBCDIR)/port/gen/errlst.c \
1064 $(LIBCDIR)/port/gen/new_list.c \
1065 assym.h \
1066 genassym \
1067 crt/_rtld.s \
1068 pics/crti.o \
1069 pics/crtn.o \
1070 $(ALTPICS)
1071
1072 CLOBBERFILES += $(LIB_PIC)
1073
1074 # list of C source for lint
1075 SRCS= \
1076 $(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c) \
1077 $(XATTROBJS:%.o=$(SRC)/common/xattr/%.c) \
1078 $(COMOBJS:%.o=$(SRC)/common/util/%.c) \
1079 $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \
1080 $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \
1081 $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \
1082 $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \
1166 #$(PORTSYS64:%=pics/%) := \
1167 # CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1168
1169 $(PORTSTDIO_W:%=pics/%) := \
1170 CPPFLAGS += -D_WIDE
1171
1172 $(PORTPRINT_W:%=pics/%) := \
1173 CPPFLAGS += -D_WIDE
1174
1175 $(PORTPRINT_C89:%=pics/%) := \
1176 CPPFLAGS += -D_C89_INTMAX32
1177
1178 $(PORTSTDIO_C89:%=pics/%) := \
1179 CPPFLAGS += -D_C89_INTMAX32
1180
1181 $(PORTI18N_COND:%=pics/%) := \
1182 CPPFLAGS += -D_WCS_LONGLONG
1183
1184 pics/arc4random.o := CPPFLAGS += -I$(SRC)/common/crypto/chacha
1185
1186 .KEEP_STATE:
1187
1188 all: $(LIBS) $(LIB_PIC)
1189
1190 lint := CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1191 lint := CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1192 lint := LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1193
1194 lint:
1195 @echo $(LINT.c) ... $(LDLIBS)
1196 @$(LINT.c) $(SRCS) $(LDLIBS)
1197
1198 $(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1199 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1200 $(LINTLIB):= LINTFLAGS64=-nvx -m64
1201
1202 # object files that depend on inline template
1203 $(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1204 # pics/mul64.o: crt/mul64.il
1205
|
19 # CDDL HEADER END
20 #
21 #
22 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright 2016 Joyent, Inc.
24 #
25 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
26 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
27 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
28 # Use is subject to license terms.
29 #
30
31 LIBCBASE= .
32 LIBCDIR= $(SRC)/lib/libc
33 LIBRARY= libc.a
34 LIB_PIC= libc_pic.a
35 VERS= .1
36 CPP= /usr/lib/cpp
37 TARGET_ARCH= amd64
38
39 # include comm page definitions
40 include $(SRC)/lib/commpage/Makefile.shared.com
41 include $(SRC)/lib/commpage/Makefile.shared.targ
42
43 # objects are grouped by source directory
44
45 # local objects
46 STRETS=
47
48 CRTOBJS= \
49 cerror.o
50
51 DYNOBJS=
52
53 FPOBJS= \
54 fpgetmask.o \
55 fpgetround.o \
56 fpsetmask.o \
57 fpsetround.o \
58 fpstart.o \
59 ieee.o
60
61 I386FPOBJS= \
62 _D_cplx_div.o \
93 ATOMICOBJS= \
94 atomic.o
95
96 CHACHAOBJS= \
97 chacha.o
98
99 XATTROBJS= \
100 xattr_common.o
101 COMOBJS= \
102 bcmp.o \
103 bcopy.o \
104 bsearch.o \
105 bzero.o \
106 qsort.o \
107 strtol.o \
108 strtoul.o \
109 strtoll.o \
110 strtoull.o
111
112 GENOBJS= \
113 $(COMMPAGE_OBJS) \
114 _getsp.o \
115 abs.o \
116 alloca.o \
117 arc4random.o \
118 arc4random_uniform.o \
119 attrat.o \
120 byteorder.o \
121 cuexit.o \
122 ecvt.o \
123 endian.o \
124 errlst.o \
125 amd64_data.o \
126 ldivide.o \
127 lock.o \
128 makectxt.o \
129 memccpy.o \
130 memchr.o \
131 memcmp.o \
132 memcpy.o \
133 memset.o \
269 stty.o \
270 sync.o \
271 sysconfig.o \
272 sysfs.o \
273 sysinfo.o \
274 syslwp.o \
275 times.o \
276 ulimit.o \
277 umask.o \
278 umount2.o \
279 utssys.o \
280 uucopy.o \
281 vhangup.o \
282 waitid.o \
283 write.o \
284 writev.o \
285 yield.o
286
287 SYSOBJS= \
288 __clock_gettime.o \
289 __clock_gettime_sys.o \
290 __getcontext.o \
291 __uadmin.o \
292 _lwp_mutex_unlock.o \
293 _stack_grow.o \
294 door.o \
295 forkx.o \
296 forkallx.o \
297 getcontext.o \
298 gettimeofday.o \
299 lwp_private.o \
300 nuname.o \
301 syscall.o \
302 sysi86.o \
303 tls_get_addr.o \
304 uadmin.o \
305 umount.o \
306 uname.o \
307 vforkx.o
308
309 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
865 # This macro should ALWAYS be empty; native APIs are already 'large file'.
866 PORTSYS64=
867
868 PORTSYS= \
869 _autofssys.o \
870 access.o \
871 acctctl.o \
872 bsd_signal.o \
873 chmod.o \
874 chown.o \
875 corectl.o \
876 epoll.o \
877 exacctsys.o \
878 execl.o \
879 execle.o \
880 execv.o \
881 eventfd.o \
882 fcntl.o \
883 getpagesizes.o \
884 getpeerucred.o \
885 inotify.o \
886 inst_sync.o \
887 issetugid.o \
888 label.o \
889 link.o \
890 lockf.o \
891 lwp.o \
892 lwp_cond.o \
893 lwp_rwlock.o \
894 lwp_sigmask.o \
895 meminfosys.o \
896 mkdir.o \
897 mknod.o \
898 msgsys.o \
899 nfssys.o \
900 open.o \
901 pgrpsys.o \
902 posix_sigwait.o \
903 ppriv.o \
904 psetsys.o \
905 rctlsys.o \
1049
1050 # Force libc's internal references to be resolved immediately upon loading
1051 # in order to avoid critical region problems. Since almost all libc symbols
1052 # are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1053 DYNFLAGS += -znow
1054
1055 BUILD.s= $(AS) $(ASFLAGS) $< -o $@
1056
1057 # Override this top level flag so the compiler builds in its native
1058 # C99 mode. This has been enabled to support the complex arithmetic
1059 # added to libc.
1060 C99MODE= $(C99_ENABLE)
1061
1062 # libc method of building an archive
1063 # The "$(GREP) -v ' L '" part is necessary only until
1064 # lorder is fixed to ignore thread-local variables.
1065 BUILD.AR= $(RM) $@ ; \
1066 $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1067
1068 # extra files for the clean target
1069 CLEANFILES+= \
1070 $(LIBCDIR)/port/gen/errlst.c \
1071 $(LIBCDIR)/port/gen/new_list.c \
1072 assym.h \
1073 genassym \
1074 crt/_rtld.s \
1075 pics/crti.o \
1076 pics/crtn.o \
1077 $(ALTPICS)
1078
1079 CLOBBERFILES += $(LIB_PIC)
1080
1081 # list of C source for lint
1082 SRCS= \
1083 $(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c) \
1084 $(XATTROBJS:%.o=$(SRC)/common/xattr/%.c) \
1085 $(COMOBJS:%.o=$(SRC)/common/util/%.c) \
1086 $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \
1087 $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \
1088 $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \
1089 $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \
1173 #$(PORTSYS64:%=pics/%) := \
1174 # CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1175
1176 $(PORTSTDIO_W:%=pics/%) := \
1177 CPPFLAGS += -D_WIDE
1178
1179 $(PORTPRINT_W:%=pics/%) := \
1180 CPPFLAGS += -D_WIDE
1181
1182 $(PORTPRINT_C89:%=pics/%) := \
1183 CPPFLAGS += -D_C89_INTMAX32
1184
1185 $(PORTSTDIO_C89:%=pics/%) := \
1186 CPPFLAGS += -D_C89_INTMAX32
1187
1188 $(PORTI18N_COND:%=pics/%) := \
1189 CPPFLAGS += -D_WCS_LONGLONG
1190
1191 pics/arc4random.o := CPPFLAGS += -I$(SRC)/common/crypto/chacha
1192
1193 pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1194
1195 .KEEP_STATE:
1196
1197 all: $(LIBS) $(LIB_PIC)
1198
1199 lint := CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1200 lint := CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1201 lint := LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1202
1203 lint:
1204 @echo $(LINT.c) ... $(LDLIBS)
1205 @$(LINT.c) $(SRCS) $(LDLIBS)
1206
1207 $(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1208 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1209 $(LINTLIB):= LINTFLAGS64=-nvx -m64
1210
1211 # object files that depend on inline template
1212 $(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1213 # pics/mul64.o: crt/mul64.il
1214
|