我发现如果我添加-shared,它会解决make问题,但是,我不知道在哪里修改Makefile。我已经在 Makefile https://gist.github.com/anonymous/5453234中尝试过 LDFLAGS,CXXFLAGS ,但它无法正常工作。
[dlin@h perf]$ make V=1
/bin/sh ../libtool --tag=CXX --mode=link g++ -O2 -pipe -shared -shared -o local_lat local_lat.o ../src/libzmq.la -lrt -lpthread -shared
libtool: link: g++ -O2 -pipe -o .libs/local_lat local_lat.o ../src/.libs/libzmq.so -lrt -lpthread
/usr/bin/ld: .libs/local_lat: hidden symbol `__sync_fetch_and_add_2' in /usr/lib/gcc/sh4-linux/4.2.4/libgcc.a(linux-atomic.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make: *** [local_lat] Error 1
[dlin@h perf]$ g++ -O2 -pipe -o .libs/local_lat local_lat.o ../src/.libs/libzmq.so -lrt -lpthread
/usr/bin/ld: .libs/local_lat: hidden symbol `__sync_fetch_and_add_2' in /usr/lib/gcc/sh4-linux/4.2.4/libgcc.a(linux-atomic.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
[dlin@h perf]$ g++ -O2 -pipe -o .libs/local_lat local_lat.o ../src/.libs/libzmq.so -lrt -lpthread -shared
-shared 选项可在最后一个命令中手动写入,但如何放入 Makefile?