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