當試圖編譯最近的ImageMagick的版本(v6.8.7-2或更高版本,v6.8.7-1是罰款),我收到了一堆:ImageMagick的pthread.h多個定義
CCLD magick/libMagickCore-6.Q16.la
magick/.libs/magick_libMagickCore_6_Q16_la-animate.o: In function `__pthread_cleanup_routine':
/usr/include/pthread.h:581: multiple definition of `__pthread_cleanup_routine'
magick/.libs/magick_libMagickCore_6_Q16_la-accelerate.o:/usr/include/pthread.h:581: first defined here
magick/.libs/magick_libMagickCore_6_Q16_la-annotate.o: In function `__pthread_cleanup_routine':
/usr/include/pthread.h:581: multiple definition of `__pthread_cleanup_routine'
magick/.libs/magick_libMagickCore_6_Q16_la-accelerate.o:/usr/include/pthread.h:581: first defined here
magick/.libs/magick_libMagickCore_6_Q16_la-artifact.o: In function `__pthread_cleanup_routine':
/usr/include/pthread.h:581: multiple definition of `__pthread_cleanup_routine'
magick/.libs/magick_libMagickCore_6_Q16_la-accelerate.o:/usr/include/pthread.h:581: first defined here
magick/.libs/magick_libMagickCore_6_Q16_la-attribute.o: In function `__pthread_cleanup_routine':
/usr/include/pthread.h:581: multiple definition of `__pthread_cleanup_routine'
magick/.libs/magick_libMagickCore_6_Q16_la-accelerate.o:/usr/include/pthread.h:581: first defined here
... goes on for quite a bit longer, all the same.
的/usr/include/pthread.h(從glibc的報頭2.5-118.el5_10.2)的相關領域是:
/* Function called to call the cleanup handler. As an extern inline
function the compiler is free to decide inlining the change when
needed or fall back on the copy which must exist somewhere else. */
extern __inline void
__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
{
if (__frame->__do_it) // <======= this is :581
__frame->__cancel_routine (__frame->__cancel_arg);
}
我已經張貼在ImageMagick的論壇沒有響應。
即使您不能確切地說出發生了什麼,我該如何開始計算問題是否與ImageMagick或pthread.h?我從哪裏去?
grep pthread_cleanup_routine -r *僅顯示與二進制對象文件相匹配的內容 - ImageMagick的源代碼都沒有pthread_cleanup_routine。其中一些來源當然包括「pthread.h」。
這讓我相信這是一個glibc問題,而不是ImageMagick問題......但是,ImageMagick的先前版本再次編譯得很好。 (我已經區分了各種版本之間的svn源代碼,很多配置文件/ makefile文件發生了變化,但是爲什麼它會導致這種情況。)
我在CentOS 5,kernel 2.6 .18-308.24.1.el5,gcc v4.9.0,ld v2.24,glibc-headers 2.5-118.el5_10.2