aboutsummaryrefslogtreecommitdiff
path: root/testcases/open_posix_testsuite/BUILD
blob: 2fd7f0762495ed06c9ca095044a0f711f25a3e0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
Build Notes for POSIX Test Suite
================================
Last update : 2010-07-10 updated for LTP-head (based off of posixtestsuite 1.40)

The POSIX Test Suite should be able to be run independently of any given
OS, so the OS-specific steps for configuring the POSIX Test Suite to run
are currently manual.

IN GENERAL
==========
In general, when calling *make:
- If you need to pass in any header locations, preprocessor definitions, etc,
  set the value via CFLAGS.
- If you need to pass in any libraries for linking, set the value via LDLIBS.
- If you need to pass any other values to the linker, set the value via LDFLAGS.
- Each subdirectory optionally contains one of the above files to denote the
  fact that it needs special linker flags, preprocessor defines, etc. This is
  done in this fashion to ensure that the requirements for each subdirectory is
  correctly tuned in a deterministic manner.

FREEBSD
=======

================
Asynchronous I/O
================
Realtime asynchronous I/O has been available in FreeBSD since 5.x. Please add:

options		VFS_AIO

to your kernel conf or build, install, and load the aio module.

================
Message Queues
================
POSIX message queues have been available in FreeBSD since 6.x. Please add:

options		P1003_1B_MQUEUE

to your kernel conf or build and install the mqueue module, and load it with:

kldload mqueuefs

================
Realtime Support
================
Realtime support has been available for a long time (I think 3.x). Please add:

options		_KPOSIX_PRIORITY_SCHEDULING

to your kernel conf. There isn't a corresponding module for this feature.

================
Semaphores
================
POSIX semaphores have been available in FreeBSD since 5.x. Please add:

options		P1003_1B_SEMAPHORES

to your kernel conf or build, install, and load the sem module.

LINUX
=====
Notes for running POSIX Test Suite against Linux implementations of
POSIX functionality.  (Note:  If these implementations are accepted into
the kernel, then the manual intervention will no longer apply, and we will
update this document.)

Please refer to your linux distribution's manual for the kernel and
library information.

Notes for each test section are here. It is targeted for general linux
kernel 2.6 and glibc-2.3.3.

=======
Threads
=======

LinuxThreads
-------------
If LinuxThreads is the default POSIX thread implementation,
to build against LinuxThreads, add '-lpthread' to LDLIBS.

NPTL
----
If NPTL is the default POSIX thread implementation, add '-lpthread' to LDLIBS.

Otherwise, to build against NPTL, export the following variable:

export GLIBCDIR=/path/to/NPTL/libc-build

Then in LDFLAGS, add the following lines:

$GLIBCDIR/nptl/libpthread.so.0 $GLIBCDIR/libc.so.6 -Wl,-rpath,$GLIBCDIR:$GLIBCDIR/nptl:$GLIBCDIR/elf,-dynamic-linker,$GLIBCDIR/elf/ld-linux.so.2

NGPT
----
To build against NGPT, export the following variables:

export LD_PRELOAD=libpthread.so.0
export LD_LIBRARY_PATH="/usr/lib:/lib:$LD_LIBRARY_PATH"

Then make sure to add '-lpthread' to LDLIBS.

==============
Message Queues
==============
POSIX Message Queue (Wronski/Benedyczak's implementation) has been
included into linux kernel since 2.6.4-rc1-mm1.
But you still need to install a user library at the time of writing this
document.

posix1b
-------
To build against the posix1b message queues, see the semaphores information for posix1b.
Also, add -I/usr/include/posix1b/ to CPPFLAGS.

Wronski/Benedyczak
------------------
To build against the Michal Wronski/Krzysztof Benedyczak message queues,
install the kernel patches from http://www.mat.uni.torun.pl/~wrona/posix_ipc/
and then build the user library from the same site.  Add '-lmqueue' to
LDLIBS to run tests.
To create the message queue file system, do:
# mkdir /dev/mqueue
# mount -t mqueue none /dev/mqueue

==========
Semaphores
==========
NPTL
----
If NPTL is installed as default POSIX thread library, set '-lpthread -lrt' in
LDLIBS.

Otherwise, to build against NPTL, export the following variable:

export GLIBCDIR=/path/to/NPTL/libc-build

Then set the following to LDFLAGS:

$GLIBCDIR/nptl/libpthread.so.0 $GLIBCDIR/libc.so.6 -Wl,-rpath,$GLIBCDIR:$GLIBCDIR/nptl:$GLIBCDIR/elf,-dynamic-linker,$GLIBCDIR/elf/ld-linux.so.2


posix1b
-------
To run the semaphore test suite against posix1b, you will need to download
and install the posix1b library.

Start downloading it from: http://www.garret.ru/~knizhnik/posix1b.tar.gz
Once you have the library compiled and installed in /usr/lib.
Add '-lposix1b' to LDLIBS:

Make sure /usr/lib/ is in your PATH.

=======
Signals
=======

For the signals-related interfaces that start with "pthread_", refer to
the Threads section above to learn how to build those particular tests.

Also, please note that if you using version of gcc older than version 3.2-7,
you may run into lots of build and link errors. Please use gcc version 3.2-7
or newer.

=====
XCOFF
=====

Since the XCOFF main is called .main, the line:
64          nm -g --defined-only $< | grep -q " T main" || exit 0; \

needs to replace main with .main to get these tests to compile.

Maintainers:	Julie Fleischer
		Rolla Selbak
		Salwan Searty
		Majid Awad
		Crystal Xiong
		Adam Li
Contributors:	Jerome Marchand
		Ulrich Drepper
		Ngie Cooper