aminems / stressapptest

Automatically exported from code.google.com/p/stressapptest
0 stars 0 forks source link

Build stressapptest as a statically linked executable #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.make CXXFLAGS=-static

What is the expected output? What do you see instead?
g++  -static  -pthread -laio -o stressapptest main.o os.o os_factory.o 
pattern.o queue.o sat.o sat_factory.o worker.o finelock_queue.o error_diag.o 
disk_blocks.o adler32memcpy.o logger.o   
worker.o: In function `DiskThread::Work()':
worker.cc:(.text+0x1aac): undefined reference to `io_setup'
worker.cc:(.text+0x1b49): undefined reference to `io_destroy'
worker.o: In function `DiskThread::AsyncDiskIO(DiskThread::IoOp, int, void*, 
long long, long long, long long)':
worker.cc:(.text+0x29de): undefined reference to `io_submit'
worker.cc:(.text+0x2b6e): undefined reference to `io_getevents'
worker.cc:(.text+0x2d0c): undefined reference to `io_cancel'
worker.cc:(.text+0x2d1f): undefined reference to `io_destroy'
worker.cc:(.text+0x2d49): undefined reference to `io_setup'
collect2: ld returned 1 exit status

What version of the product are you using? On what operating system?
stressapptest-1.0.2_autoconf, OS is 2.6.18-1.2798.fc6(GNU/Linux)

Please provide any additional information below.

[root@pc-87-12-odi-pod2-br-pc1 stressapptest-1.0.2_autoconf]# ls -l 
/usr/lib64/libaio.*
-rw-r--r-- 1 root root 57470 Apr 19 23:40 /usr/lib64/libaio.a
lrwxrwxrwx 1 root root    15 Apr 19 23:40 /usr/lib64/libaio.so -> 
libaio.so.1.0.1
lrwxrwxrwx 1 root root    15 Apr 19 23:40 /usr/lib64/libaio.so.1 -> 
libaio.so.1.0.1
-rwxr-xr-x 1 root root 19775 Apr 19 23:40 /usr/lib64/libaio.so.1.0.1
[root@pc-87-12-odi-pod2-br-pc1 stressapptest-1.0.2_autoconf]# 
[root@pc-87-12-odi-pod2-br-pc1 stressapptest-1.0.2_autoconf]# 
[root@pc-87-12-odi-pod2-br-pc1 stressapptest-1.0.2_autoconf]# find / -name 
librt.a
/usr/lib/librt.a
/usr/lib64/librt.a

Original issue reported on code.google.com by anand.va...@gmail.com on 20 Apr 2011 at 6:09

GoogleCodeExporter commented 8 years ago
Moving the libraries inclusion right after the obj_list solved the issue.

Original comment by anand.va...@gmail.com on 21 Apr 2011 at 2:02

GoogleCodeExporter commented 8 years ago
stressapptest currently compiles statically linked by default. for future 
versions this will be a configure option.

Original comment by nick.j.s...@gmail.com on 6 Nov 2011 at 12:52