[MacPorts] #42702: glibtool drops dylibs at link time
#42702: glibtool drops dylibs at link time ------------------------+--------------------------------- Reporter: jeremyhu@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: | Port: glibtool webkit-gtk ------------------------+--------------------------------- VLC fails to build with opencv support because opencv's pkg-config file lists paths to dylibs rather than -l<lib> arguments. This should work just fine, but glibtool doesn't like it. It just drops the dylibs on the floor when creating the command line to envoke: {{{ /opt/local/bin/glibtool --tag=CXX --mode=link /usr/bin/clang++ -pipe -Os -arch x86_64 -stdlib=libc++ -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build /_Users_jeremy_src_macports_trunk_dports_multimedia_VLC-devel/VLC- devel/work/VLC-devel-2.1.99/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -fvisibility=hidden -ffast-math -funroll-loops -fomit-frame-pointer -avoid-version -module -export-symbols-regex ^vlc_entry -shrext .dylib -no-undefined ../../compat/libcompat.la ../../src/libvlccore.la -rpath '/opt/local/lib/vlc/plugins/video_filter' -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/var/macports/build /_Users_jeremy_src_macports_trunk_dports_multimedia_VLC-devel/VLC- devel/work/VLC-devel-2.1.99/contrib/lib -o libopencv_example_plugin.la libopencv_example_plugin_la-opencv_example.lo /opt/local/lib/libopencv_calib3d.dylib /opt/local/lib/libopencv_contrib.dylib /opt/local/lib/libopencv_core.dylib /opt/local/lib/libopencv_features2d.dylib /opt/local/lib/libopencv_flann.dylib /opt/local/lib/libopencv_gpu.dylib /opt/local/lib/libopencv_highgui.dylib /opt/local/lib/libopencv_imgproc.dylib /opt/local/lib/libopencv_legacy.dylib /opt/local/lib/libopencv_ml.dylib /opt/local/lib/libopencv_nonfree.dylib /opt/local/lib/libopencv_objdetect.dylib /opt/local/lib/libopencv_photo.dylib /opt/local/lib/libopencv_stitching.dylib /opt/local/lib/libopencv_superres.dylib /opt/local/lib/libopencv_ts.a /opt/local/lib/libopencv_video.dylib /opt/local/lib/libopencv_videostab.dylib *** Warning: Linking the shared library libopencv_example_plugin.la against the *** static library /opt/local/lib/libopencv_ts.a is not portable! glibtool: link: rm -fr .libs/libopencv_example_plugin.exp glibtool: link: /usr/bin/nm .libs/libopencv_example_plugin_la- opencv_example.o | sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/libopencv_example_plugin.exp glibtool: link: /usr/bin/grep -E -e "^vlc_entry" ".libs/libopencv_example_plugin.exp" > ".libs/libopencv_example_plugin.expT" glibtool: link: mv -f ".libs/libopencv_example_plugin.expT" ".libs/libopencv_example_plugin.exp" glibtool: link: sed -e 's,^,_,' < .libs/libopencv_example_plugin.exp > .libs/libopencv_example_plugin-symbols.expsym glibtool: link: /usr/bin/clang++ -o .libs/libopencv_example_plugin.dylib -bundle .libs/libopencv_example_plugin_la-opencv_example.o ../../compat/.libs/libcompat.a -L/opt/local/lib -L/opt/local/var/macports/build /_Users_jeremy_src_macports_trunk_dports_multimedia_VLC-devel/VLC- devel/work/VLC-devel-2.1.99/contrib/lib ../../src/.libs/libvlccore.dylib -lintl -lidn -liconv -lm /opt/local/lib/libopencv_ts.a -Os -arch x86_64 -stdlib=libc++ -Wl,-headerpad_max_install_names -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-exported_symbols_list,.libs /libopencv_example_plugin-symbols.expsym Undefined symbols for architecture x86_64: "_cvClearMemStorage", referenced from: Filter(filter_t*, picture_t*) in libopencv_example_plugin_la- opencv_example.o "_cvCreateMemStorage", referenced from: OpenFilter(vlc_object_t*) in libopencv_example_plugin_la- opencv_example.o "_cvGetSeqElem", referenced from: Filter(filter_t*, picture_t*) in libopencv_example_plugin_la- opencv_example.o "_cvHaarDetectObjects", referenced from: Filter(filter_t*, picture_t*) in libopencv_example_plugin_la- opencv_example.o "_cvLoad", referenced from: OpenFilter(vlc_object_t*) in libopencv_example_plugin_la- opencv_example.o "_cvRectangle", referenced from: Filter(filter_t*, picture_t*) in libopencv_example_plugin_la- opencv_example.o "_cvReleaseHaarClassifierCascade", referenced from: CloseFilter(vlc_object_t*) in libopencv_example_plugin_la- opencv_example.o "_cvReleaseMemStorage", referenced from: CloseFilter(vlc_object_t*) in libopencv_example_plugin_la- opencv_example.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) }}} -- Ticket URL: <https://trac.macports.org/ticket/42702> MacPorts <http://www.macports.org/> Ports system for OS X
#42702: glibtool drops dylibs at link time -----------------------------------------+------------------- Reporter: jeremyhu@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: glibtool webkit-gtk opencv | -----------------------------------------+------------------- Changes (by ram@…): * cc: stromnov@… (added) * port: glibtool webkit-gtk => glibtool webkit-gtk opencv Comment: That sounds like a problem with opencv's pkg-config file, surely it should specify the link flags needed to link the library, which libtool then passes these onto the compiler, not the path to the libraries? -- Ticket URL: <https://trac.macports.org/ticket/42702#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#42702: glibtool drops dylibs at link time -----------------------------------------+------------------- Reporter: jeremyhu@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: glibtool webkit-gtk opencv | -----------------------------------------+------------------- Comment (by stromnov@…): Probably fixed by jeremyhu at r117530. My system: {{{ $ port installed opencv The following ports are currently installed: opencv @2.4.8_2+eigen+java+opencl+python27+qt4 (active) }}} and {{{ $ cat /opt/local/lib/pkgconfig/opencv.pc # Package Information for pkg-config prefix=/opt/local exec_prefix=${prefix} libdir= includedir_old=${prefix}/include/opencv includedir_new=${prefix}/include Name: OpenCV Description: Open Source Computer Vision Library Version: 2.4.8 Libs: -L${exec_prefix}/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab Cflags: -I${includedir_old} -I${includedir_new} }}} -- Ticket URL: <https://trac.macports.org/ticket/42702#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#42702: glibtool drops dylibs at link time -----------------------------------------+------------------- Reporter: jeremyhu@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: glibtool webkit-gtk opencv | -----------------------------------------+------------------- Comment (by jeremyhu@…): Replying to [comment:3 stromnov@…]:
Probably fixed by jeremyhu at r117530.
No, that was a workaround in opencv. This is a bug in glibtool. -- Ticket URL: <https://trac.macports.org/ticket/42702#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#42702: glibtool drops dylibs at link time -----------------------------------------+------------------- Reporter: jeremyhu@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: glibtool webkit-gtk opencv | -----------------------------------------+------------------- Comment (by jeremyhu@…): Replying to [comment:2 ram@…]:
That sounds like a problem with opencv's pkg-config file, surely it should specify the link flags needed to link the library, which libtool then passes these onto the compiler, not the path to the libraries?
No, it's not a bug in opencv as I already explained. You can clearly see in the command line that the linker flags *ARE* being passed to glibtoo, and glibtool is not passing them on to the linker. -- Ticket URL: <https://trac.macports.org/ticket/42702#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#42702: glibtool drops dylibs at link time -------------------------+------------------- Reporter: jeremyhu@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: glibtool | -------------------------+------------------- Changes (by jeremyhu@…): * port: glibtool webkit-gtk opencv => glibtool -- Ticket URL: <https://trac.macports.org/ticket/42702#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#42702: glibtool drops dylibs at link time -------------------------+-------------------------------- Reporter: jeremyhu@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: glibtool | -------------------------+-------------------------------- Changes (by ram@…): * owner: ram@… => macports-tickets@… -- Ticket URL: <https://trac.macports.org/ticket/42702#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts