Opened 5 years ago

Closed 5 years ago

#60277 closed defect (fixed)

librsvg @2.48.1: `port test` fails with "undefined symbols"

Reported by: dliessi (Davide Liessi) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: librsvg

Description

I tried sudo port -t test after applying https://github.com/macports/macports-ports/pull/6739. It failed.

I'm using

macOS 10.13.6 17G11023
Xcode 9.4.1 9F2000

Here's the relevant part of main.log (full file attached):

:info:test depbase=`echo test-utils.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
:info:test 	/usr/bin/clang -DHAVE_CONFIG_H -I. -I..  -I. -I.. -I../librsvg -DTEST_DATA_DIR="\".\"" -DTEST_SRC_DIR="\"/opt/local/var/macports/build/_opt_macports-git_macports-ports_graphics_librsvg/librsvg/work/librsvg-2.48.1/tests\"" -DTOP_SRC_DIR="\"..\"" -D_REENTRANT -I/opt/local/include/cairo -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libxml2 -I/opt/local/include/pango-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/fribidi -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/ossp -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include  -pipe -Os -arch x86_64 -MT test-utils.o -MD -MP -MF $depbase.Tpo -c -o test-utils.o test-utils.c &&\
:info:test 	mv -f $depbase.Tpo $depbase.Po
:info:test test-utils.c:385:45: warning: implicit declaration of function 'hb_version_string' is invalid in C99 [-Wimplicit-function-declaration]
:info:test     g_test_message ("Harfbuzz version: %s", hb_version_string ());
:info:test                                             ^
:info:test test-utils.c:385:45: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
:info:test     g_test_message ("Harfbuzz version: %s", hb_version_string ());
:info:test                                        ~~   ^~~~~~~~~~~~~~~~~~~~
:info:test                                        %d
:info:test 2 warnings generated.
:info:test /bin/sh ../libtool  --tag=CC   --mode=link /usr/bin/clang  -pipe -Os -arch x86_64  -L/opt/local/lib -Wl,-headerpad_max_install_names -lobjc -arch x86_64 -o api api.o test-utils.o ../librsvg-2.la -L/opt/local/lib -lpng16 -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 -lxml2 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation -lfontconfig -lfreetype  
:info:test libtool: link: /usr/bin/clang -pipe -Os -arch x86_64 -Wl,-headerpad_max_install_names -arch x86_64 -o .libs/api api.o test-utils.o -Wl,-framework -Wl,CoreFoundation  -L/opt/local/lib ../.libs/librsvg-2.dylib -lobjc -lpng16 -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 -lxml2 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype
:info:test ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
:info:test Undefined symbols for architecture x86_64:
:info:test   "_hb_version_string", referenced from:
:info:test       _test_utils_print_dependency_versions in test-utils.o
:info:test ld: symbol(s) not found for architecture x86_64
:info:test clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:test make[2]: *** [api] Error 1
:info:test make[1]: *** [check-am] Error 2
:info:test make: *** [check] Error 2
:info:test Command failed:  cd "/opt/local/var/macports/build/_opt_macports-git_macports-ports_graphics_librsvg/librsvg/work/librsvg-2.48.1/tests" && /usr/bin/make check 
:info:test Exit code: 2

Attachments (1)

main.log (591.1 KB) - added by dliessi (Davide Liessi) 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by dliessi (Davide Liessi)

Attachment: main.log added

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dbevans removed
Owner: set to dbevans
Status: newassigned

Seems like hb_version_string is provided by harfbuzz, but I don't see librsvg linking with the harfbuzz library here (i.e. I don't see -lharfbuzz). Seems like a bug in librsvg.

comment:2 Changed 5 years ago by dliessi (Davide Liessi)

See https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/309, already merged in the development branch but not yet cherry-picked in the stable branch.

Maybe the library uses harfbuzz only through pango, while the tests check for harfbuzz directly.

Should we add an explicit dependence on harfbuzz? And maybe freetype as well (configure.ac checks for both).

comment:3 Changed 5 years ago by dliessi (Davide Liessi)

See also https://gitlab.gnome.org/GNOME/librsvg/-/issues/509: it is unrelated to this issue, but the reported failing link command uses both -lfreetype and -lharfbuzz.

comment:4 Changed 5 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

In b522e280e234061cefa5b25ceeb7911ec3918592/macports-ports (master):

librsvg: update to version 2.48.2

Fixes linking of the test suite against Harfbuzz.
Test pass rate is about 50% but at least the tests build and run.

Closes #60277.

Note: See TracTickets for help on using tickets.