1f08c3bdfSopenharmony_ciBuild Notes for POSIX Test Suite
2f08c3bdfSopenharmony_ci================================
3f08c3bdfSopenharmony_ciLast update : 2010-07-10 updated for LTP-head (based off of posixtestsuite 1.40)
4f08c3bdfSopenharmony_ci
5f08c3bdfSopenharmony_ciThe POSIX Test Suite should be able to be run independently of any given
6f08c3bdfSopenharmony_ciOS, so the OS-specific steps for configuring the POSIX Test Suite to run
7f08c3bdfSopenharmony_ciare currently manual.
8f08c3bdfSopenharmony_ci
9f08c3bdfSopenharmony_ciIN GENERAL
10f08c3bdfSopenharmony_ci==========
11f08c3bdfSopenharmony_ciIn general, when calling *make:
12f08c3bdfSopenharmony_ci- If you need to pass in any header locations, preprocessor definitions, etc,
13f08c3bdfSopenharmony_ci  set the value via CFLAGS.
14f08c3bdfSopenharmony_ci- If you need to pass in any libraries for linking, set the value via LDLIBS.
15f08c3bdfSopenharmony_ci- If you need to pass any other values to the linker, set the value via LDFLAGS.
16f08c3bdfSopenharmony_ci- Each subdirectory optionally contains one of the above files to denote the
17f08c3bdfSopenharmony_ci  fact that it needs special linker flags, preprocessor defines, etc. This is
18f08c3bdfSopenharmony_ci  done in this fashion to ensure that the requirements for each subdirectory is
19f08c3bdfSopenharmony_ci  correctly tuned in a deterministic manner.
20f08c3bdfSopenharmony_ci
21f08c3bdfSopenharmony_ciFREEBSD
22f08c3bdfSopenharmony_ci=======
23f08c3bdfSopenharmony_ci
24f08c3bdfSopenharmony_ci================
25f08c3bdfSopenharmony_ciAsynchronous I/O
26f08c3bdfSopenharmony_ci================
27f08c3bdfSopenharmony_ciRealtime asynchronous I/O has been available in FreeBSD since 5.x. Please add:
28f08c3bdfSopenharmony_ci
29f08c3bdfSopenharmony_cioptions		VFS_AIO
30f08c3bdfSopenharmony_ci
31f08c3bdfSopenharmony_cito your kernel conf or build, install, and load the aio module.
32f08c3bdfSopenharmony_ci
33f08c3bdfSopenharmony_ci================
34f08c3bdfSopenharmony_ciMessage Queues
35f08c3bdfSopenharmony_ci================
36f08c3bdfSopenharmony_ciPOSIX message queues have been available in FreeBSD since 6.x. Please add:
37f08c3bdfSopenharmony_ci
38f08c3bdfSopenharmony_cioptions		P1003_1B_MQUEUE
39f08c3bdfSopenharmony_ci
40f08c3bdfSopenharmony_cito your kernel conf or build and install the mqueue module, and load it with:
41f08c3bdfSopenharmony_ci
42f08c3bdfSopenharmony_cikldload mqueuefs
43f08c3bdfSopenharmony_ci
44f08c3bdfSopenharmony_ci================
45f08c3bdfSopenharmony_ciRealtime Support
46f08c3bdfSopenharmony_ci================
47f08c3bdfSopenharmony_ciRealtime support has been available for a long time (I think 3.x). Please add:
48f08c3bdfSopenharmony_ci
49f08c3bdfSopenharmony_cioptions		_KPOSIX_PRIORITY_SCHEDULING
50f08c3bdfSopenharmony_ci
51f08c3bdfSopenharmony_cito your kernel conf. There isn't a corresponding module for this feature.
52f08c3bdfSopenharmony_ci
53f08c3bdfSopenharmony_ci================
54f08c3bdfSopenharmony_ciSemaphores
55f08c3bdfSopenharmony_ci================
56f08c3bdfSopenharmony_ciPOSIX semaphores have been available in FreeBSD since 5.x. Please add:
57f08c3bdfSopenharmony_ci
58f08c3bdfSopenharmony_cioptions		P1003_1B_SEMAPHORES
59f08c3bdfSopenharmony_ci
60f08c3bdfSopenharmony_cito your kernel conf or build, install, and load the sem module.
61f08c3bdfSopenharmony_ci
62f08c3bdfSopenharmony_ciLINUX
63f08c3bdfSopenharmony_ci=====
64f08c3bdfSopenharmony_ciNotes for running POSIX Test Suite against Linux implementations of
65f08c3bdfSopenharmony_ciPOSIX functionality.  (Note:  If these implementations are accepted into
66f08c3bdfSopenharmony_cithe kernel, then the manual intervention will no longer apply, and we will
67f08c3bdfSopenharmony_ciupdate this document.)
68f08c3bdfSopenharmony_ci
69f08c3bdfSopenharmony_ciPlease refer to your linux distribution's manual for the kernel and
70f08c3bdfSopenharmony_cilibrary information.
71f08c3bdfSopenharmony_ci
72f08c3bdfSopenharmony_ciNotes for each test section are here. It is targeted for general linux
73f08c3bdfSopenharmony_cikernel 2.6 and glibc-2.3.3.
74f08c3bdfSopenharmony_ci
75f08c3bdfSopenharmony_ci=======
76f08c3bdfSopenharmony_ciThreads
77f08c3bdfSopenharmony_ci=======
78f08c3bdfSopenharmony_ci
79f08c3bdfSopenharmony_ciLinuxThreads
80f08c3bdfSopenharmony_ci-------------
81f08c3bdfSopenharmony_ciIf LinuxThreads is the default POSIX thread implementation,
82f08c3bdfSopenharmony_cito build against LinuxThreads, add '-lpthread' to LDLIBS.
83f08c3bdfSopenharmony_ci
84f08c3bdfSopenharmony_ciNPTL
85f08c3bdfSopenharmony_ci----
86f08c3bdfSopenharmony_ciIf NPTL is the default POSIX thread implementation, add '-lpthread' to LDLIBS.
87f08c3bdfSopenharmony_ci
88f08c3bdfSopenharmony_ciOtherwise, to build against NPTL, export the following variable:
89f08c3bdfSopenharmony_ci
90f08c3bdfSopenharmony_ciexport GLIBCDIR=/path/to/NPTL/libc-build
91f08c3bdfSopenharmony_ci
92f08c3bdfSopenharmony_ciThen in LDFLAGS, add the following lines:
93f08c3bdfSopenharmony_ci
94f08c3bdfSopenharmony_ci$GLIBCDIR/nptl/libpthread.so.0 $GLIBCDIR/libc.so.6 -Wl,-rpath,$GLIBCDIR:$GLIBCDIR/nptl:$GLIBCDIR/elf,-dynamic-linker,$GLIBCDIR/elf/ld-linux.so.2
95f08c3bdfSopenharmony_ci
96f08c3bdfSopenharmony_ciNGPT
97f08c3bdfSopenharmony_ci----
98f08c3bdfSopenharmony_ciTo build against NGPT, export the following variables:
99f08c3bdfSopenharmony_ci
100f08c3bdfSopenharmony_ciexport LD_PRELOAD=libpthread.so.0
101f08c3bdfSopenharmony_ciexport LD_LIBRARY_PATH="/usr/lib:/lib:$LD_LIBRARY_PATH"
102f08c3bdfSopenharmony_ci
103f08c3bdfSopenharmony_ciThen make sure to add '-lpthread' to LDLIBS.
104f08c3bdfSopenharmony_ci
105f08c3bdfSopenharmony_ci==============
106f08c3bdfSopenharmony_ciMessage Queues
107f08c3bdfSopenharmony_ci==============
108f08c3bdfSopenharmony_ciPOSIX Message Queue (Wronski/Benedyczak's implementation) has been
109f08c3bdfSopenharmony_ciincluded into linux kernel since 2.6.4-rc1-mm1.
110f08c3bdfSopenharmony_ciBut you still need to install a user library at the time of writing this
111f08c3bdfSopenharmony_cidocument.
112f08c3bdfSopenharmony_ci
113f08c3bdfSopenharmony_ciposix1b
114f08c3bdfSopenharmony_ci-------
115f08c3bdfSopenharmony_ciTo build against the posix1b message queues, see the semaphores information for posix1b.
116f08c3bdfSopenharmony_ciAlso, add -I/usr/include/posix1b/ to CPPFLAGS.
117f08c3bdfSopenharmony_ci
118f08c3bdfSopenharmony_ciWronski/Benedyczak
119f08c3bdfSopenharmony_ci------------------
120f08c3bdfSopenharmony_ciTo build against the Michal Wronski/Krzysztof Benedyczak message queues,
121f08c3bdfSopenharmony_ciinstall the kernel patches from http://www.mat.uni.torun.pl/~wrona/posix_ipc/
122f08c3bdfSopenharmony_ciand then build the user library from the same site.  Add '-lmqueue' to
123f08c3bdfSopenharmony_ciLDLIBS to run tests.
124f08c3bdfSopenharmony_ciTo create the message queue file system, do:
125f08c3bdfSopenharmony_ci# mkdir /dev/mqueue
126f08c3bdfSopenharmony_ci# mount -t mqueue none /dev/mqueue
127f08c3bdfSopenharmony_ci
128f08c3bdfSopenharmony_ci==========
129f08c3bdfSopenharmony_ciSemaphores
130f08c3bdfSopenharmony_ci==========
131f08c3bdfSopenharmony_ciNPTL
132f08c3bdfSopenharmony_ci----
133f08c3bdfSopenharmony_ciIf NPTL is installed as default POSIX thread library, set '-lpthread -lrt' in
134f08c3bdfSopenharmony_ciLDLIBS.
135f08c3bdfSopenharmony_ci
136f08c3bdfSopenharmony_ciOtherwise, to build against NPTL, export the following variable:
137f08c3bdfSopenharmony_ci
138f08c3bdfSopenharmony_ciexport GLIBCDIR=/path/to/NPTL/libc-build
139f08c3bdfSopenharmony_ci
140f08c3bdfSopenharmony_ciThen set the following to LDFLAGS:
141f08c3bdfSopenharmony_ci
142f08c3bdfSopenharmony_ci$GLIBCDIR/nptl/libpthread.so.0 $GLIBCDIR/libc.so.6 -Wl,-rpath,$GLIBCDIR:$GLIBCDIR/nptl:$GLIBCDIR/elf,-dynamic-linker,$GLIBCDIR/elf/ld-linux.so.2
143f08c3bdfSopenharmony_ci
144f08c3bdfSopenharmony_ci
145f08c3bdfSopenharmony_ciposix1b
146f08c3bdfSopenharmony_ci-------
147f08c3bdfSopenharmony_ciTo run the semaphore test suite against posix1b, you will need to download
148f08c3bdfSopenharmony_ciand install the posix1b library.
149f08c3bdfSopenharmony_ci
150f08c3bdfSopenharmony_ciStart downloading it from: http://www.garret.ru/~knizhnik/posix1b.tar.gz
151f08c3bdfSopenharmony_ciOnce you have the library compiled and installed in /usr/lib.
152f08c3bdfSopenharmony_ciAdd '-lposix1b' to LDLIBS:
153f08c3bdfSopenharmony_ci
154f08c3bdfSopenharmony_ciMake sure /usr/lib/ is in your PATH.
155f08c3bdfSopenharmony_ci
156f08c3bdfSopenharmony_ci=======
157f08c3bdfSopenharmony_ciSignals
158f08c3bdfSopenharmony_ci=======
159f08c3bdfSopenharmony_ci
160f08c3bdfSopenharmony_ciFor the signals-related interfaces that start with "pthread_", refer to
161f08c3bdfSopenharmony_cithe Threads section above to learn how to build those particular tests.
162f08c3bdfSopenharmony_ci
163f08c3bdfSopenharmony_ciAlso, please note that if you using version of gcc older than version 3.2-7,
164f08c3bdfSopenharmony_ciyou may run into lots of build and link errors. Please use gcc version 3.2-7
165f08c3bdfSopenharmony_cior newer.
166f08c3bdfSopenharmony_ci
167f08c3bdfSopenharmony_ci=====
168f08c3bdfSopenharmony_ciXCOFF
169f08c3bdfSopenharmony_ci=====
170f08c3bdfSopenharmony_ci
171f08c3bdfSopenharmony_ciSince the XCOFF main is called .main, the line:
172f08c3bdfSopenharmony_ci64          nm -g --defined-only $< | grep -q " T main" || exit 0; \
173f08c3bdfSopenharmony_ci
174f08c3bdfSopenharmony_cineeds to replace main with .main to get these tests to compile.
175f08c3bdfSopenharmony_ci
176f08c3bdfSopenharmony_ciMaintainers:	Julie Fleischer
177f08c3bdfSopenharmony_ci		Rolla Selbak
178f08c3bdfSopenharmony_ci		Salwan Searty
179f08c3bdfSopenharmony_ci		Majid Awad
180f08c3bdfSopenharmony_ci		Crystal Xiong
181f08c3bdfSopenharmony_ci		Adam Li
182f08c3bdfSopenharmony_ciContributors:	Jerome Marchand
183f08c3bdfSopenharmony_ci		Ulrich Drepper
184f08c3bdfSopenharmony_ci		Ngie Cooper
185