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