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