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