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