xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision dd4eeefdb8e4583c47e28a7f315db6087931ef06)
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
765UNICODEOBJS=			\
766	u8_textprep.o		\
767	uconv.o
768
769UNWINDMACHOBJS=			\
770	call_frame_inst.o	\
771	eh_frame.o		\
772	thrp_unwind.o		\
773	unwind.o
774
775pics/unwind.o:= COPTFLAG64 =
776
777UNWINDASMOBJS=			\
778	unwind_frame.o
779
780# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
781# This macro should ALWAYS be empty; native APIs are already 'large file'.
782PORTSYS64=
783
784PORTSYS=			\
785	_autofssys.o		\
786	acctctl.o		\
787	bsd_signal.o		\
788	corectl.o		\
789	exacctsys.o		\
790	execl.o			\
791	execle.o		\
792	execv.o			\
793	faccessat.o		\
794	fcntl.o			\
795	fsmisc.o		\
796	fstatat.o		\
797	fsync.o			\
798	getpeerucred.o		\
799	inst_sync.o		\
800	issetugid.o		\
801	label.o			\
802	libc_link.o		\
803	libc_open.o		\
804	lockf.o			\
805	lwp.o			\
806	lwp_cond.o		\
807	lwp_rwlock.o		\
808	lwp_sigmask.o		\
809	meminfosys.o		\
810	msgsys.o		\
811	nfssys.o		\
812	openat.o		\
813	pgrpsys.o		\
814	posix_sigwait.o		\
815	ppriv.o			\
816	psetsys.o		\
817	rctlsys.o		\
818	sbrk.o			\
819	semsys.o		\
820	set_errno.o		\
821	sharefs.o		\
822	shmsys.o		\
823	sidsys.o		\
824	siginterrupt.o		\
825	signal.o		\
826	sigpending.o		\
827	sigstack.o		\
828	tasksys.o		\
829	time.o			\
830	time_util.o		\
831	ucontext.o		\
832	ustat.o			\
833	zone.o
834
835PORTREGEX=			\
836	glob.o			\
837	regcmp.o		\
838	regex.o			\
839	wordexp.o
840
841VALUES=				\
842	values-Xa.o
843
844MOSTOBJS=			\
845	$(STRETS)		\
846	$(CRTOBJS)		\
847	$(DYNOBJS)		\
848	$(FPOBJS)		\
849	$(I386FPOBJS)		\
850	$(FPASMOBJS)		\
851	$(ATOMICOBJS)		\
852	$(COMOBJS)		\
853	$(GENOBJS)		\
854	$(PORTFP)		\
855	$(PORTGEN)		\
856	$(PORTGEN64)		\
857	$(PORTI18N)		\
858	$(PORTI18N_COND)	\
859	$(PORTPRINT)		\
860	$(PORTPRINT_W)		\
861	$(PORTREGEX)		\
862	$(PORTSTDIO)		\
863	$(PORTSTDIO64)		\
864	$(PORTSTDIO_W)		\
865	$(PORTSYS)		\
866	$(PORTSYS64)		\
867	$(AIOOBJS)		\
868	$(RTOBJS)		\
869	$(TPOOLOBJS)		\
870	$(THREADSOBJS)		\
871	$(THREADSMACHOBJS)	\
872	$(THREADSASMOBJS)	\
873	$(UNICODEOBJS)		\
874	$(UNWINDMACHOBJS)	\
875	$(UNWINDASMOBJS)	\
876	$(COMSYSOBJS)		\
877	$(SYSOBJS)		\
878	$(COMSYSOBJS64)		\
879	$(SYSOBJS64)		\
880	$(VALUES)
881
882TRACEOBJS=			\
883	plockstat.o
884
885# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
886# modules whose source is provided in the $(SRC)/lib/common directory.
887# This must be done because otherwise the Sun C compiler would insert
888# its own versions of these modules and those versions contain code
889# to call out to C++ initialization functions.  Such C++ initialization
890# functions can call back into libc before thread initialization is
891# complete and this leads to segmentation violations and other problems.
892# Since libc contains no C++ code, linking with the minimal crti.o and
893# crtn.o modules is safe and avoids the problems described above.
894OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
895CRTSRCS= ../../common/amd64
896
897# include common library definitions
898include ../../Makefile.lib
899include ../../Makefile.lib.64
900
901# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
902# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
903# need to be compatible with the ones for the libc stuff.  Whenever the changes
904# that affect the compilation conditions of libc happened, those for libc_i18n
905# also need to be updated.
906
907CFLAGS64 += $(CTF_FLAGS)
908
909# This is necessary to avoid problems with calling _ex_unwind().
910# We probably don't want any inlining anyway.
911CFLAGS64 += -xinline=
912
913# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
914# enables ASSERT() checking in the threads portion of the library.
915# This is automatically enabled for DEBUG builds, not for non-debug builds.
916THREAD_DEBUG =
917$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
918
919CFLAGS64 += $(THREAD_DEBUG)
920
921ALTPICS= $(TRACEOBJS:%=pics/%)
922
923$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
924$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
925
926MAPFILES =	../port/mapfile-vers mapfile-vers
927
928CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) \
929		-I. -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) -I/usr/include
930ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
931		$(amd64_AS_XARCH)
932
933# Conditionally add support for making |wordexp()| check whether
934# /usr/bin/ksh is ksh93 or not
935include ../../../Makefile.ksh93switch
936CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
937
938# Inform the run-time linker about libc specialized initialization
939RTLDINFO =	-z rtldinfo=tls_rtldinfo
940DYNFLAGS +=	$(RTLDINFO)
941
942BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
943
944# Override this top level flag so the compiler builds in its native
945# C99 mode.  This has been enabled to support the complex arithmetic
946# added to libc.
947C99MODE=	$(C99_ENABLE)
948
949# libc method of building an archive
950BUILD.AR= $(RM) $@ ; \
951	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
952
953# extra files for the clean target
954CLEANFILES=			\
955	../port/gen/errlst.c	\
956	../port/gen/new_list.c	\
957	assym.h			\
958	genassym		\
959	crt/_rtld.s		\
960	pics/crti.o		\
961	pics/crtn.o		\
962	$(ALTPICS)
963
964CLOBBERFILES +=	$(LIB_PIC)
965
966# list of C source for lint
967SRCS=							\
968	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
969	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
970	$(PORTFP:%.o=../port/fp/%.c)			\
971	$(PORTGEN:%.o=../port/gen/%.c)			\
972	$(PORTI18N:%.o=../port/i18n/%.c)		\
973	$(PORTPRINT:%.o=../port/print/%.c)		\
974	$(PORTREGEX:%.o=../port/regex/%.c)		\
975	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
976	$(PORTSYS:%.o=../port/sys/%.c)			\
977	$(AIOOBJS:%.o=../port/aio/%.c)			\
978	$(RTOBJS:%.o=../port/rt/%.c)			\
979	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
980	$(THREADSOBJS:%.o=../port/threads/%.c)		\
981	$(THREADSMACHOBJS:%.o=threads/%.c)		\
982	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
983	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
984	$(FPOBJS:%.o=fp/%.c)				\
985	$(I386FPOBJS:%.o=../i386/fp/%.c)		\
986	$(LIBCBASE)/gen/ecvt.c				\
987	$(LIBCBASE)/gen/lexp10.c			\
988	$(LIBCBASE)/gen/llog10.c			\
989	$(LIBCBASE)/gen/ltostr.c			\
990	$(LIBCBASE)/gen/makectxt.c			\
991	$(LIBCBASE)/gen/siginfolst.c			\
992	$(LIBCBASE)/gen/siglongjmp.c			\
993	$(LIBCBASE)/gen/sync_instruction_memory.c	\
994	$(LIBCBASE)/sys/uadmin.c
995
996# conditional assignments
997# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
998$(DYNLIB) := CRTI = crti.o
999$(DYNLIB) := CRTN = crtn.o
1000
1001# Files which need the threads .il inline template
1002TIL=				\
1003	aio.o			\
1004	alloc.o			\
1005	assfail.o		\
1006	atexit.o		\
1007	atfork.o		\
1008	cancel.o		\
1009	door_calls.o		\
1010	errno.o			\
1011	lwp.o			\
1012	ma.o			\
1013	machdep.o		\
1014	posix_aio.o		\
1015	pthr_attr.o		\
1016	pthr_barrier.o		\
1017	pthr_cond.o		\
1018	pthr_mutex.o		\
1019	pthr_rwlock.o		\
1020	pthread.o		\
1021	rand.o			\
1022	rtsched.o		\
1023	rwlock.o		\
1024	scalls.o		\
1025	sema.o			\
1026	sigaction.o		\
1027	sigev_thread.o		\
1028	spawn.o			\
1029	stack.o			\
1030	synch.o			\
1031	tdb_agent.o		\
1032	thr.o			\
1033	thread_interface.o	\
1034	thread_pool.o		\
1035	thrp_unwind.o		\
1036	tls.o			\
1037	tsd.o
1038
1039$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1040
1041# pics/mul64.o := CFLAGS64 += crt/mul64.il
1042
1043# large-file-aware components that should be built large
1044
1045#$(COMSYSOBJS64:%=pics/%) := \
1046#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1047
1048#$(SYSOBJS64:%=pics/%) := \
1049#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1050
1051#$(PORTGEN64:%=pics/%) := \
1052#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1053
1054#$(PORTSTDIO64:%=pics/%) := \
1055#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1056
1057#$(PORTSYS64:%=pics/%) := \
1058#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1059
1060$(PORTSTDIO_W:%=pics/%) := \
1061	CPPFLAGS += -D_WIDE
1062
1063$(PORTPRINT_W:%=pics/%) := \
1064	CPPFLAGS += -D_WIDE
1065
1066$(PORTPRINT_C89:%=pics/%) := \
1067	CPPFLAGS += -D_C89_INTMAX32
1068
1069$(PORTSTDIO_C89:%=pics/%) := \
1070	CPPFLAGS += -D_C89_INTMAX32
1071
1072$(PORTI18N_COND:%=pics/%) := \
1073	CPPFLAGS += -D_WCS_LONGLONG
1074
1075.KEEP_STATE:
1076
1077all: $(LIBS) $(LIB_PIC)
1078
1079lint	:=	CPPFLAGS += -I../$(MACH)/fp
1080lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1081lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1082
1083lint:
1084	@echo $(LINT.c) ... $(LDLIBS)
1085	@$(LINT.c) $(SRCS) $(LDLIBS)
1086
1087$(LINTLIB):= SRCS=../port/llib-lc
1088$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1089$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=amd64
1090
1091# object files that depend on inline template
1092$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1093# pics/mul64.o: crt/mul64.il
1094
1095# include common libc targets
1096include ../Makefile.targ
1097
1098# We need to strip out all CTF data from the static library
1099$(LIB_PIC) := DIR = pics
1100$(LIB_PIC): pics $$(PICS)
1101	$(BUILD.AR)
1102	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1103	$(AR) -ts $@ > /dev/null
1104	$(POST_PROCESS_A)
1105
1106ASSYMDEP_OBJS=			\
1107	_lwp_mutex_unlock.o	\
1108	_stack_grow.o		\
1109	asm_subr.o		\
1110	getcontext.o		\
1111	tls_get_addr.o		\
1112	vforkx.o
1113
1114$(ASSYMDEP_OBJS:%=pics/%): assym.h
1115
1116# assym.h build rules
1117
1118GENASSYM_C = genassym.c
1119
1120# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1121#	live in Makefile.master
1122
1123CPPFLAGS.genassym = \
1124	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1125
1126genassym: $(GENASSYM_C)
1127	$(NATIVECC) -Iinc -I../inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1128
1129OFFSETS = ../$(MACH)/offsets.in
1130
1131assym.h: $(OFFSETS) genassym
1132	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1133	./genassym >>$@
1134
1135# derived C source and related explicit dependencies
1136../port/gen/errlst.c + \
1137../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1138	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1139
1140pics/errlst.o: ../port/gen/errlst.c
1141
1142pics/new_list.o: ../port/gen/new_list.c
1143