xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision 606d76de63f7f3335e75e7f3eb3fba75c8998690)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
25# Copyright 2014 Garrett D'Amore <garrett@damore.org>
26# Copyright 2018 Nexenta Systems, Inc.
27# Copyright 2019 Joyent, Inc.
28# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
29#
30
31LIBCBASE=	.
32LIBCDIR=	$(SRC)/lib/libc
33LIBRARY=	libc.a
34LIB_PIC=	libc_pic.a
35VERS=		.1
36TARGET_ARCH=	amd64
37
38# include comm page definitions
39include $(SRC)/lib/commpage/Makefile.shared.com
40include $(SRC)/lib/commpage/Makefile.shared.targ
41
42# objects are grouped by source directory
43
44# local objects
45STRETS=
46
47CRTOBJS=			\
48	cerror.o
49
50DYNOBJS=
51
52FPOBJS=				\
53	fpgetmask.o		\
54	fpgetround.o		\
55	fpsetmask.o		\
56	fpsetround.o		\
57	fpstart.o		\
58	ieee.o
59
60I386FPOBJS=			\
61	_D_cplx_div.o		\
62	_D_cplx_div_ix.o	\
63	_D_cplx_div_rx.o	\
64	_D_cplx_lr_div.o	\
65	_D_cplx_lr_div_ix.o	\
66	_D_cplx_lr_div_rx.o	\
67	_D_cplx_mul.o		\
68	_F_cplx_div.o		\
69	_F_cplx_div_ix.o	\
70	_F_cplx_div_rx.o	\
71	_F_cplx_lr_div.o	\
72	_F_cplx_lr_div_ix.o	\
73	_F_cplx_lr_div_rx.o	\
74	_F_cplx_mul.o		\
75	_X_cplx_div.o		\
76	_X_cplx_div_ix.o	\
77	_X_cplx_div_rx.o	\
78	_X_cplx_lr_div.o	\
79	_X_cplx_lr_div_ix.o	\
80	_X_cplx_lr_div_rx.o	\
81	_X_cplx_mul.o
82
83FPASMOBJS=			\
84	__xgetRD.o		\
85	_xtoll.o		\
86	_xtoull.o		\
87	_base_il.o		\
88	fpcw.o			\
89	fpgetsticky.o		\
90	fpsetsticky.o
91
92ATOMICOBJS=			\
93	atomic.o
94
95CHACHAOBJS=			\
96	chacha.o
97
98XATTROBJS=			\
99	xattr_common.o
100COMOBJS=			\
101	bcmp.o			\
102	bcopy.o			\
103	bsearch.o		\
104	bzero.o			\
105	explicit_bzero.o	\
106	memmem.o		\
107	qsort.o			\
108	strtol.o		\
109	strtoul.o		\
110	strtoll.o		\
111	strtoull.o
112
113GENOBJS=			\
114	$(COMMPAGE_OBJS)	\
115	_getsp.o		\
116	abs.o			\
117	alloca.o		\
118	arc4random.o		\
119	arc4random_uniform.o	\
120	attrat.o		\
121	byteorder.o		\
122	cuexit.o		\
123	ecvt.o			\
124	endian.o		\
125	errlst.o		\
126	amd64_data.o		\
127	ldivide.o		\
128	lock.o			\
129	makectxt.o		\
130	memccpy.o		\
131	memchr.o		\
132	memcmp.o		\
133	memcpy.o		\
134	memset.o		\
135	new_list.o		\
136	proc64_id.o		\
137	proc64_support.o	\
138	setjmp.o		\
139	siginfolst.o		\
140	siglongjmp.o		\
141	strcmp.o		\
142	strcpy.o		\
143	strlen.o		\
144	strncmp.o		\
145	strncpy.o		\
146	strnlen.o		\
147	sync_instruction_memory.o
148
149# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
150# This macro should ALWAYS be empty; native APIs are already 'large file'.
151COMSYSOBJS64=
152
153SYSOBJS64=
154
155COMSYSOBJS=			\
156	__clock_timer.o		\
157	__getloadavg.o		\
158	__rusagesys.o		\
159	__signotify.o		\
160	__sigrt.o		\
161	__time.o		\
162	_lgrp_home_fast.o	\
163	_lgrpsys.o		\
164	_nfssys.o		\
165	_portfs.o		\
166	_pset.o			\
167	_rpcsys.o		\
168	_sigaction.o		\
169	_so_accept.o		\
170	_so_bind.o		\
171	_so_connect.o		\
172	_so_getpeername.o	\
173	_so_getsockname.o	\
174	_so_getsockopt.o	\
175	_so_listen.o		\
176	_so_recv.o		\
177	_so_recvfrom.o		\
178	_so_recvmsg.o		\
179	_so_send.o		\
180	_so_sendmsg.o		\
181	_so_sendto.o		\
182	_so_setsockopt.o	\
183	_so_shutdown.o		\
184	_so_socket.o		\
185	_so_socketpair.o	\
186	_sockconfig.o		\
187	acct.o			\
188	acl.o			\
189	adjtime.o		\
190	alarm.o			\
191	brk.o			\
192	chdir.o			\
193	chroot.o		\
194	cladm.o			\
195	close.o			\
196	execvex.o		\
197	exit.o			\
198	facl.o			\
199	fchdir.o		\
200	fchroot.o		\
201	fdsync.o		\
202	fpathconf.o		\
203	fstatfs.o		\
204	fstatvfs.o		\
205	getcpuid.o		\
206	getdents.o		\
207	getegid.o		\
208	geteuid.o		\
209	getgid.o		\
210	getgroups.o		\
211	gethrtime.o		\
212	getitimer.o		\
213	getmsg.o		\
214	getpid.o		\
215	getpmsg.o		\
216	getppid.o		\
217	getrandom.o		\
218	getrlimit.o		\
219	getuid.o		\
220	gtty.o			\
221	install_utrap.o		\
222	ioctl.o			\
223	kaio.o			\
224	kill.o			\
225	llseek.o		\
226	lseek.o			\
227	mmapobjsys.o		\
228	memcntl.o		\
229	mincore.o		\
230	mmap.o			\
231	modctl.o		\
232	mount.o			\
233	mprotect.o		\
234	munmap.o		\
235	nice.o			\
236	ntp_adjtime.o		\
237	ntp_gettime.o		\
238	p_online.o		\
239	pathconf.o		\
240	pause.o			\
241	pcsample.o		\
242	pipe2.o			\
243	pollsys.o		\
244	pread.o			\
245	preadv.o		\
246	priocntlset.o		\
247	processor_bind.o	\
248	processor_info.o	\
249	profil.o		\
250	psecflagsset.o		\
251	putmsg.o		\
252	putpmsg.o		\
253	pwrite.o		\
254	pwritev.o		\
255	read.o			\
256	readv.o			\
257	resolvepath.o		\
258	seteguid.o		\
259	setgid.o		\
260	setgroups.o		\
261	setitimer.o		\
262	setreid.o		\
263	setrlimit.o		\
264	setuid.o		\
265	sigaltstk.o		\
266	sigprocmsk.o		\
267	sigsendset.o		\
268	sigsuspend.o		\
269	ssp.o			\
270	statfs.o		\
271	statvfs.o		\
272	stty.o			\
273	sync.o			\
274	sysconfig.o		\
275	sysfs.o			\
276	sysinfo.o		\
277	syslwp.o		\
278	times.o			\
279	ulimit.o		\
280	umask.o			\
281	umount2.o		\
282	upanic.o		\
283	utssys.o		\
284	uucopy.o		\
285	vhangup.o		\
286	waitid.o		\
287	write.o			\
288	writev.o		\
289	yield.o
290
291SYSOBJS=			\
292	__clock_gettime.o	\
293	__clock_gettime_sys.o	\
294	__getcontext.o		\
295	__uadmin.o		\
296	_lwp_mutex_unlock.o	\
297	_stack_grow.o		\
298	door.o			\
299	forkx.o			\
300	forkallx.o		\
301	getcontext.o		\
302	gettimeofday.o		\
303	lwp_private.o		\
304	nuname.o		\
305	syscall.o		\
306	sysi86.o		\
307	tls_get_addr.o		\
308	uadmin.o		\
309	umount.o		\
310	uname.o			\
311	vforkx.o
312
313# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
314# This macro should ALWAYS be empty; native APIs are already 'large file'.
315PORTGEN64=
316
317# objects from source under $(LIBCDIR)/port
318PORTFP=				\
319	__flt_decim.o		\
320	__flt_rounds.o		\
321	__tbl_10_b.o		\
322	__tbl_10_h.o		\
323	__tbl_10_s.o		\
324	__tbl_2_b.o		\
325	__tbl_2_h.o		\
326	__tbl_2_s.o		\
327	__tbl_fdq.o		\
328	__tbl_tens.o		\
329	__x_power.o		\
330	_base_sup.o		\
331	aconvert.o		\
332	decimal_bin.o		\
333	double_decim.o		\
334	econvert.o		\
335	fconvert.o		\
336	file_decim.o		\
337	finite.o		\
338	fp_data.o		\
339	func_decim.o		\
340	gconvert.o		\
341	hex_bin.o		\
342	ieee_globals.o		\
343	pack_float.o		\
344	sigfpe.o		\
345	string_decim.o
346
347PORTGEN=			\
348	_env_data.o		\
349	_xftw.o			\
350	a64l.o			\
351	abort.o			\
352	addsev.o		\
353	ascii_strcasecmp.o	\
354	ascii_strncasecmp.o	\
355	assert.o		\
356	atexit.o		\
357	atfork.o		\
358	atof.o			\
359	atoi.o			\
360	atol.o			\
361	atoll.o			\
362	attropen.o		\
363	basename.o		\
364	calloc.o		\
365	catgets.o		\
366	catopen.o		\
367	cfgetispeed.o		\
368	cfgetospeed.o		\
369	cfree.o			\
370	cfsetispeed.o		\
371	cfsetospeed.o		\
372	cftime.o		\
373	clock.o			\
374	closedir.o		\
375	closefrom.o		\
376	confstr.o		\
377	crypt.o			\
378	csetlen.o		\
379	ctime.o			\
380	ctime_r.o		\
381	daemon.o		\
382	deflt.o			\
383	directio.o		\
384	dirname.o		\
385	div.o			\
386	drand48.o		\
387	dup.o			\
388	env_data.o		\
389	err.o			\
390	errno.o			\
391	euclen.o		\
392	event_port.o		\
393	execvp.o		\
394	fattach.o		\
395	fdetach.o		\
396	fdopendir.o		\
397	ffs.o			\
398	flock.o			\
399	fls.o			\
400	fmtmsg.o		\
401	freezero.o		\
402	ftime.o			\
403	ftok.o			\
404	fts.o			\
405	ftw.o			\
406	gcvt.o			\
407	get_nprocs.o		\
408	getauxv.o		\
409	getcwd.o		\
410	getdate_err.o		\
411	getdtblsize.o		\
412	getentropy.o		\
413	getenv.o		\
414	getexecname.o		\
415	getgrnam.o		\
416	getgrnam_r.o		\
417	gethostid.o		\
418	gethostname.o		\
419	gethz.o			\
420	getisax.o		\
421	getloadavg.o		\
422	getlogin.o		\
423	getmntent.o		\
424	getnetgrent.o		\
425	getopt.o		\
426	getopt_long.o		\
427	getpagesize.o		\
428	getpw.o			\
429	getpwnam.o		\
430	getpwnam_r.o		\
431	getrusage.o		\
432	getspent.o		\
433	getspent_r.o		\
434	getsubopt.o		\
435	gettxt.o		\
436	getusershell.o		\
437	getut.o			\
438	getutx.o		\
439	getvfsent.o		\
440	getwd.o			\
441	getwidth.o		\
442	getxby_door.o		\
443	gtxt.o			\
444	hsearch.o		\
445	iconv.o			\
446	imaxabs.o		\
447	imaxdiv.o		\
448	index.o			\
449	initgroups.o		\
450	insque.o		\
451	isaexec.o		\
452	isastream.o		\
453	isatty.o		\
454	killpg.o		\
455	klpdlib.o		\
456	l64a.o			\
457	lckpwdf.o		\
458	lconstants.o		\
459	lexp10.o		\
460	lfind.o			\
461	lfmt.o			\
462	lfmt_log.o		\
463	lldiv.o			\
464	llog10.o		\
465	lltostr.o		\
466	lmath.o			\
467	localtime.o		\
468	lsearch.o		\
469	madvise.o		\
470	malloc.o		\
471	memalign.o		\
472	memrchr.o		\
473	memset_s.o		\
474	mkdev.o			\
475	mkdtemp.o		\
476	mkfifo.o		\
477	mkstemp.o		\
478	mktemp.o		\
479	mlock.o			\
480	mlockall.o		\
481	mon.o			\
482	msync.o			\
483	munlock.o		\
484	munlockall.o		\
485	ndbm.o			\
486	nftw.o			\
487	nlspath_checks.o	\
488	nsparse.o		\
489	nss_common.o		\
490	nss_dbdefs.o		\
491	nss_deffinder.o		\
492	opendir.o		\
493	opt_data.o		\
494	perror.o		\
495	pfmt.o			\
496	pfmt_data.o		\
497	pfmt_print.o		\
498	pipe.o			\
499	plock.o			\
500	poll.o			\
501	posix_fadvise.o		\
502	posix_fallocate.o	\
503	posix_madvise.o		\
504	posix_memalign.o	\
505	priocntl.o		\
506	priv_str_xlate.o	\
507	privlib.o		\
508	psecflags.o		\
509	psiginfo.o		\
510	psignal.o		\
511	pt.o			\
512	putpwent.o		\
513	putspent.o		\
514	raise.o			\
515	rand.o			\
516	random.o		\
517	rctlops.o		\
518	readdir.o		\
519	readdir_r.o		\
520	reallocarray.o		\
521	reallocf.o		\
522	recallocarray.o		\
523	realpath.o		\
524	reboot.o		\
525	regexpr.o		\
526	remove.o		\
527	rewinddir.o		\
528	rindex.o		\
529	scandir.o		\
530	seekdir.o		\
531	select.o		\
532	set_constraint_handler_s.o \
533	setlabel.o		\
534	setpriority.o		\
535	settimeofday.o		\
536	sh_locks.o		\
537	sigflag.o		\
538	siglist.o		\
539	sigsend.o		\
540	sigsetops.o		\
541	ssignal.o		\
542	stack.o			\
543	stpcpy.o		\
544	stpncpy.o		\
545	str2sig.o		\
546	strcase_charmap.o	\
547	strcat.o		\
548	strchr.o		\
549	strchrnul.o		\
550	strcspn.o		\
551	strdup.o		\
552	strerror.o		\
553	strlcat.o		\
554	strlcpy.o		\
555	strncat.o		\
556	strndup.o		\
557	strpbrk.o		\
558	strrchr.o		\
559	strsep.o		\
560	strsignal.o		\
561	strspn.o		\
562	strstr.o		\
563	strtod.o		\
564	strtoimax.o		\
565	strtok.o		\
566	strtok_r.o		\
567	strtonum.o		\
568	strtoumax.o		\
569	swab.o			\
570	swapctl.o		\
571	sysconf.o		\
572	syslog.o		\
573	tcdrain.o		\
574	tcflow.o		\
575	tcflush.o		\
576	tcgetattr.o		\
577	tcgetpgrp.o		\
578	tcgetsid.o		\
579	tcsendbreak.o		\
580	tcsetattr.o		\
581	tcsetpgrp.o		\
582	tell.o			\
583	telldir.o		\
584	tfind.o			\
585	time_data.o		\
586	time_gdata.o		\
587	timespec_get.o		\
588	tls_data.o		\
589	truncate.o		\
590	tsdalloc.o		\
591	tsearch.o		\
592	ttyname.o		\
593	ttyslot.o		\
594	ualarm.o		\
595	ucred.o			\
596	valloc.o		\
597	vlfmt.o			\
598	vpfmt.o			\
599	waitpid.o		\
600	walkstack.o		\
601	wdata.o			\
602	xgetwidth.o		\
603	xpg4.o			\
604	xpg6.o
605
606PORTINET=			\
607	inet_lnaof.o		\
608	inet_makeaddr.o		\
609	inet_network.o		\
610	inet_ntoa.o		\
611	inet_ntop.o		\
612	inet_pton.o
613
614PORTPRINT_W=			\
615	doprnt_w.o
616
617PORTPRINT=			\
618	asprintf.o		\
619	doprnt.o		\
620	fprintf.o		\
621	printf.o		\
622	snprintf.o		\
623	sprintf.o		\
624	vfprintf.o		\
625	vprintf.o		\
626	vsnprintf.o		\
627	vsprintf.o		\
628	vwprintf.o		\
629	wprintf.o
630
631# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
632# This macro should ALWAYS be empty; native APIs are already 'large file'.
633PORTSTDIO64=
634
635PORTSTDIO_W=			\
636	doscan_w.o
637
638PORTSTDIO=			\
639	__extensions.o		\
640	_endopen.o		\
641	_filbuf.o		\
642	_findbuf.o		\
643	_flsbuf.o		\
644	_stdio_flags.o		\
645	_wrtchk.o		\
646	clearerr.o		\
647	ctermid.o		\
648	ctermid_r.o		\
649	cuserid.o		\
650	data.o			\
651	doscan.o		\
652	fdopen.o		\
653	feof.o			\
654	ferror.o		\
655	fgetc.o			\
656	fgets.o			\
657	fileno.o		\
658	flockf.o		\
659	flush.o			\
660	fmemopen.o		\
661	fopen.o			\
662	fpos.o			\
663	fputc.o			\
664	fputs.o			\
665	fread.o			\
666	fseek.o			\
667	fseeko.o		\
668	ftell.o			\
669	ftello.o		\
670	fwrite.o		\
671	getc.o			\
672	getchar.o		\
673	getline.o		\
674	getpass.o		\
675	gets.o			\
676	getw.o			\
677	mse.o			\
678	open_memstream.o	\
679	open_wmemstream.o	\
680	popen.o			\
681	putc.o			\
682	putchar.o		\
683	puts.o			\
684	putw.o			\
685	rewind.o		\
686	scanf.o			\
687	setbuf.o		\
688	setbuffer.o		\
689	setvbuf.o		\
690	system.o		\
691	tempnam.o		\
692	tmpfile.o		\
693	tmpnam_r.o		\
694	ungetc.o		\
695	vscanf.o		\
696	vwscanf.o		\
697	wscanf.o
698
699PORTI18N=			\
700	getwchar.o		\
701	putwchar.o		\
702	putws.o			\
703	strtows.o		\
704	wcsnlen.o		\
705	wcsstr.o		\
706	wcstoimax.o		\
707	wcstol.o		\
708	wcstoul.o		\
709	wcswcs.o		\
710	wmemchr.o		\
711	wmemcmp.o		\
712	wmemcpy.o		\
713	wmemmove.o		\
714	wmemset.o		\
715	wscat.o			\
716	wschr.o			\
717	wscmp.o			\
718	wscpy.o			\
719	wscspn.o		\
720	wsdup.o			\
721	wslen.o			\
722	wsncat.o		\
723	wsncmp.o		\
724	wsncpy.o		\
725	wspbrk.o		\
726	wsprintf.o		\
727	wsrchr.o		\
728	wsscanf.o		\
729	wsspn.o			\
730	wstod.o			\
731	wstok.o			\
732	wstol.o			\
733	wstoll.o		\
734	wsxfrm.o		\
735	gettext.o		\
736	gettext_gnu.o		\
737	gettext_real.o		\
738	gettext_util.o		\
739	plural_parser.o		\
740	wdresolve.o		\
741	_ctype.o		\
742	isascii.o		\
743	toascii.o
744
745PORTI18N_COND=			\
746	wcstol_longlong.o	\
747	wcstoul_longlong.o
748
749PORTLOCALE=			\
750	big5.o			\
751	btowc.o			\
752	c16rtomb.o		\
753	c32rtomb.o		\
754	collate.o		\
755	collcmp.o		\
756	euc.o			\
757	fnmatch.o		\
758	fgetwc.o		\
759	fgetws.o		\
760	fix_grouping.o		\
761	fputwc.o		\
762	fputws.o		\
763	fwide.o			\
764	gb18030.o		\
765	gb2312.o		\
766	gbk.o			\
767	getdate.o		\
768	isdigit.o		\
769	iswctype.o		\
770	ldpart.o		\
771	lmessages.o		\
772	lnumeric.o		\
773	lmonetary.o		\
774	localeconv.o		\
775	localeimpl.o		\
776	mbftowc.o		\
777	mblen.o			\
778	mbrlen.o		\
779	mbrtoc16.o		\
780	mbrtoc32.o		\
781	mbrtowc.o		\
782	mbsinit.o		\
783	mbsnrtowcs.o		\
784	mbsrtowcs.o		\
785	mbstowcs.o		\
786	mbtowc.o		\
787	mskanji.o		\
788	nextwctype.o		\
789	nl_langinfo.o		\
790	none.o			\
791	rune.o			\
792	runetype.o		\
793	setlocale.o		\
794	setrunelocale.o		\
795	strcasecmp.o		\
796	strcasestr.o		\
797	strcoll.o		\
798	strfmon.o		\
799	strftime.o		\
800	strncasecmp.o		\
801	strptime.o		\
802	strxfrm.o		\
803	table.o			\
804	timelocal.o		\
805	tolower.o		\
806	towlower.o		\
807	ungetwc.o		\
808	utf8.o			\
809	wcrtomb.o		\
810	wcscasecmp.o		\
811	wcscoll.o		\
812	wcsftime.o		\
813	wcsnrtombs.o		\
814	wcsrtombs.o		\
815	wcswidth.o		\
816	wcstombs.o		\
817	wcsxfrm.o		\
818	wctob.o			\
819	wctomb.o		\
820	wctrans.o		\
821	wctype.o		\
822	wcwidth.o		\
823	wscol.o
824
825AIOOBJS=			\
826	aio.o			\
827	aio_alloc.o		\
828	posix_aio.o
829
830RTOBJS=				\
831	clock_timer.o		\
832	mqueue.o		\
833	pos4obj.o		\
834	sched.o			\
835	sem.o			\
836	shm.o			\
837	sigev_thread.o
838
839SECFLAGSOBJS=			\
840	secflags.o
841
842TPOOLOBJS=			\
843	thread_pool.o
844
845THREADSOBJS=			\
846	alloc.o			\
847	assfail.o		\
848	c11_thr.o		\
849	cancel.o		\
850	door_calls.o		\
851	tmem.o			\
852	pthr_attr.o		\
853	pthr_barrier.o		\
854	pthr_cond.o		\
855	pthr_mutex.o		\
856	pthr_rwlock.o		\
857	pthread.o		\
858	rwlock.o		\
859	scalls.o		\
860	sema.o			\
861	sigaction.o		\
862	spawn.o			\
863	synch.o			\
864	tdb_agent.o		\
865	thr.o			\
866	thread_interface.o	\
867	tls.o			\
868	tsd.o
869
870THREADSMACHOBJS=		\
871	machdep.o
872
873THREADSASMOBJS=			\
874	asm_subr.o
875
876UNICODEOBJS=			\
877	u8_textprep.o		\
878	uconv.o
879
880UNWINDMACHOBJS=			\
881	call_frame_inst.o	\
882	eh_frame.o		\
883	thrp_unwind.o		\
884	unwind.o
885
886pics/unwind.o:= COPTFLAG64 =
887
888UNWINDASMOBJS=			\
889	unwind_frame.o		\
890	unwind_wrap.o
891
892# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
893# This macro should ALWAYS be empty; native APIs are already 'large file'.
894PORTSYS64=
895
896PORTSYS=			\
897	_autofssys.o		\
898	access.o		\
899	acctctl.o		\
900	bsd_signal.o		\
901	chmod.o			\
902	chown.o			\
903	corectl.o		\
904	epoll.o			\
905	exacctsys.o		\
906	execl.o			\
907	execle.o		\
908	execv.o			\
909	execve.o		\
910	eventfd.o		\
911	fcntl.o			\
912	fexecve.o		\
913	getpagesizes.o		\
914	getpeerucred.o		\
915	inst_sync.o		\
916	issetugid.o		\
917	label.o			\
918	link.o			\
919	lockf.o			\
920	lwp.o			\
921	lwp_cond.o		\
922	lwp_rwlock.o		\
923	lwp_sigmask.o		\
924	meminfosys.o		\
925	mkdir.o			\
926	mknod.o			\
927	msgsys.o		\
928	nfssys.o		\
929	open.o			\
930	pgrpsys.o		\
931	posix_sigwait.o		\
932	ppriv.o			\
933	psetsys.o		\
934	rctlsys.o		\
935	readlink.o		\
936	rename.o		\
937	sbrk.o			\
938	semsys.o		\
939	set_errno.o		\
940	sharefs.o		\
941	shmsys.o		\
942	sidsys.o		\
943	siginterrupt.o		\
944	signal.o		\
945	signalfd.o		\
946	sigpending.o		\
947	sigstack.o		\
948	stat.o			\
949	symlink.o		\
950	tasksys.o		\
951	time.o			\
952	time_util.o		\
953	timerfd.o		\
954	ucontext.o		\
955	unlink.o		\
956	ustat.o			\
957	utimesys.o		\
958	zone.o
959
960PORTREGEX=			\
961	glob.o			\
962	regcmp.o		\
963	regcomp.o		\
964	regerror.o		\
965	regex.o			\
966	regexec.o		\
967	regfree.o		\
968	wordexp.o
969
970VALUES=				\
971	values-Xa.o
972
973MOSTOBJS=			\
974	$(STRETS)		\
975	$(CRTOBJS)		\
976	$(DYNOBJS)		\
977	$(FPOBJS)		\
978	$(I386FPOBJS)		\
979	$(FPASMOBJS)		\
980	$(ATOMICOBJS)		\
981	$(CHACHAOBJS)		\
982	$(XATTROBJS)		\
983	$(COMOBJS)		\
984	$(GENOBJS)		\
985	$(PORTFP)		\
986	$(PORTGEN)		\
987	$(PORTGEN64)		\
988	$(PORTI18N)		\
989	$(PORTI18N_COND)	\
990	$(PORTINET)		\
991	$(PORTLOCALE)		\
992	$(PORTPRINT)		\
993	$(PORTPRINT_W)		\
994	$(PORTREGEX)		\
995	$(PORTSTDIO)		\
996	$(PORTSTDIO64)		\
997	$(PORTSTDIO_W)		\
998	$(PORTSYS)		\
999	$(PORTSYS64)		\
1000	$(AIOOBJS)		\
1001	$(RTOBJS)		\
1002	$(SECFLAGSOBJS)		\
1003	$(TPOOLOBJS)		\
1004	$(THREADSOBJS)		\
1005	$(THREADSMACHOBJS)	\
1006	$(THREADSASMOBJS)	\
1007	$(UNICODEOBJS)		\
1008	$(UNWINDMACHOBJS)	\
1009	$(UNWINDASMOBJS)	\
1010	$(COMSYSOBJS)		\
1011	$(SYSOBJS)		\
1012	$(COMSYSOBJS64)		\
1013	$(SYSOBJS64)		\
1014	$(VALUES)
1015
1016TRACEOBJS=			\
1017	plockstat.o
1018
1019# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1020# modules whose source is provided in the $(SRC)/lib/crt directory.
1021# This must be done because otherwise the Sun C compiler would insert
1022# its own versions of these modules and those versions contain code
1023# to call out to C++ initialization functions.  Such C++ initialization
1024# functions can call back into libc before thread initialization is
1025# complete and this leads to segmentation violations and other problems.
1026# Since libc contains no C++ code, linking with the minimal crti.o and
1027# crtn.o modules is safe and avoids the problems described above.
1028OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1029CRTSRCS= ../../crt/amd64
1030
1031# include common library definitions
1032include ../../Makefile.lib
1033include ../../Makefile.lib.64
1034
1035CFLAGS64 += $(CTF_FLAGS)
1036
1037CERRWARN += -_gcc=-Wno-parentheses
1038CERRWARN += -_gcc=-Wno-switch
1039CERRWARN += $(CNOWARN_UNINIT)
1040CERRWARN += -_gcc=-Wno-unused-value
1041CERRWARN += -_gcc=-Wno-unused-label
1042CERRWARN += -_gcc=-Wno-unused-variable
1043CERRWARN += -_gcc=-Wno-type-limits
1044CERRWARN += -_gcc=-Wno-char-subscripts
1045CERRWARN += -_gcc=-Wno-clobbered
1046CERRWARN += -_gcc=-Wno-unused-function
1047CERRWARN += -_gcc=-Wno-address
1048
1049$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1050
1051# not linted
1052SMATCH=off
1053
1054# Setting THREAD_DEBUG = -DDEBUG (make THREAD_DEBUG=-DDEBUG ...)
1055# enables ASSERT() checking in the library.
1056# This is automatically enabled for DEBUG builds, not for non-debug builds.
1057THREAD_DEBUG =
1058$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DDEBUG
1059
1060ALTPICS= $(TRACEOBJS:%=pics/%)
1061
1062$(DYNLIB) := BUILD.SO = $(LD) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1063
1064MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1065
1066CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1067		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1068
1069# __XOPEN_OR_POSIX is necessary to avoid implicit _LARGEFILE_SOURCE which
1070# breaks the libc compilation environment.
1071ASFLAGS=	$(AS_PICFLAGS) -D_ASM \
1072		$(CPPFLAGS) $(amd64_XARCH) -D__XOPEN_OR_POSIX=1
1073ASFLAGS64=	$(AS_PICFLAGS) -D_ASM \
1074		$(CPPFLAGS) $(amd64_XARCH) -D__XOPEN_OR_POSIX=1
1075
1076# As a favor to the dtrace syscall provider, libc still calls the
1077# old syscall traps that have been obsoleted by the *at() interfaces.
1078# Delete this to compile libc using only the new *at() system call traps
1079CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1080
1081# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1082pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1083
1084# Inform the run-time linker about libc specialized initialization
1085RTLDINFO =	-z rtldinfo=tls_rtldinfo
1086DYNFLAGS +=	$(RTLDINFO)
1087
1088# Force libc's internal references to be resolved immediately upon loading
1089# in order to avoid critical region problems.  Since almost all libc symbols
1090# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1091DYNFLAGS +=	-znow
1092
1093BUILD.s=	$(AS) $(ASFLAGS) $< -c -o $@
1094
1095# Override this top level flag so the compiler builds in its native
1096# C99 mode.  This has been enabled to support the complex arithmetic
1097# added to libc.
1098CSTD=	$(CSTD_GNU99)
1099
1100# libc method of building an archive
1101# The "$(GREP) -v ' L '" part is necessary only until
1102# lorder is fixed to ignore thread-local variables.
1103BUILD.AR= $(RM) $@ ; \
1104	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1105
1106# extra files for the clean target
1107CLEANFILES +=			\
1108	$(LIBCDIR)/port/gen/errlst.c	\
1109	$(LIBCDIR)/port/gen/new_list.c	\
1110	assym.h			\
1111	genassym		\
1112	crt/_rtld.s		\
1113	pics/crti.o		\
1114	pics/crtn.o		\
1115	$(ALTPICS)
1116
1117CLOBBERFILES +=	$(LIB_PIC)
1118
1119# conditional assignments
1120# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1121$(DYNLIB) := CRTI = crti.o
1122$(DYNLIB) := CRTN = crtn.o
1123
1124# large-file-aware components that should be built large
1125
1126#$(COMSYSOBJS64:%=pics/%) := \
1127#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1128
1129#$(SYSOBJS64:%=pics/%) := \
1130#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1131
1132#$(PORTGEN64:%=pics/%) := \
1133#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1134
1135#$(PORTSTDIO64:%=pics/%) := \
1136#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1137
1138#$(PORTSYS64:%=pics/%) := \
1139#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1140
1141$(PORTSTDIO_W:%=pics/%) := \
1142	CPPFLAGS += -D_WIDE
1143
1144$(PORTPRINT_W:%=pics/%) := \
1145	CPPFLAGS += -D_WIDE
1146
1147$(PORTPRINT_C89:%=pics/%) := \
1148	CPPFLAGS += -D_C89_INTMAX32
1149
1150$(PORTSTDIO_C89:%=pics/%) := \
1151	CPPFLAGS += -D_C89_INTMAX32
1152
1153$(PORTI18N_COND:%=pics/%) := \
1154	CPPFLAGS += -D_WCS_LONGLONG
1155
1156pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1157
1158pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1159pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1160
1161#
1162# Disable the stack protector due to issues with bootstrapping rtld. See
1163# cmd/sgs/rtld/Makefile.com for more information.
1164#
1165STACKPROTECT = none
1166
1167.KEEP_STATE:
1168
1169all: $(LIBS) $(LIB_PIC)
1170
1171# include common libc targets
1172include ../Makefile.targ
1173
1174# We need to strip out all CTF data from the static library
1175$(LIB_PIC) := DIR = pics
1176$(LIB_PIC): pics $$(PICS)
1177	$(BUILD.AR)
1178	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1179	$(AR) -ts $@ > /dev/null
1180	$(POST_PROCESS_A)
1181
1182ASSYMDEP_OBJS=			\
1183	_lwp_mutex_unlock.o	\
1184	_stack_grow.o		\
1185	asm_subr.o		\
1186	getcontext.o		\
1187	setjmp.o		\
1188	tls_get_addr.o		\
1189	vforkx.o
1190
1191$(ASSYMDEP_OBJS:%=pics/%): assym.h
1192
1193# assym.h build rules
1194
1195GENASSYM_C = genassym.c
1196LDFLAGS.native = $(LDASSERTS) $(BDIRECT)
1197
1198genassym := NATIVE_LIBS += libc.so
1199
1200genassym: $(GENASSYM_C)
1201	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1202		$(LDFLAGS.native) -o $@ $(GENASSYM_C)
1203
1204OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1205
1206assym.h: $(OFFSETS) genassym
1207	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1208	./genassym >>$@
1209
1210# derived C source and related explicit dependencies
1211$(LIBCDIR)/port/gen/errlst.c + \
1212$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1213	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1214
1215pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1216
1217pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1218