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