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