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