/app/watchman-2.9.5/./watchman.h:104: undefined reference to `__sync_add_and_fetch_4'
/app/watchman-2.9.5/./watchman.h:104: undefined reference to `__sync_add_and_fetch_4'
watchman-root.o: In function `w_root_init':
/app/watchman-2.9.5/root.c:191: undefined reference to `__sync_fetch_and_add_4'
watchman-root.o: In function `w_refcnt_del':
/app/watchman-2.9.5/watchman.h:104: undefined reference to `__sync_add_and_fetch_4'
/app/watchman-2.9.5/watchman.h:104: undefined reference to `__sync_add_and_fetch_4'
watchman-root.o: In function `w_root_free_watched_roots':
/app/watchman-2.9.5/root.c:3192: undefined reference to `__sync_fetch_and_add_4'
watchman-string.o: In function `w_refcnt_del':
/app/watchman-2.9.5/watchman.h:104: undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[1]: *** [watchman] Error 1
make[1]: Leaving directory `/app/watchman-2.9.5'
make: *** [all] Error 2
产生原因:
linux为32位版本
查看方式:getconf LONG_BIT
解决办法:
执行make命令时加参数:make CFLAGS=”-march=i686″