#66711 closed defect (worksforme)

appstream-glib fails with Undefined symbols for architecture x86_64 10.5

Reported by: rmottola (Riccardo) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Leopard Cc:
Port: appstream-glib

Description

This happens on 10.5 x86-64.

Build with gcc-7 on Leopard. clang-7.0 & clang-3.7 have the same issue.

ld: warning: cannot export hidden symbol _as_get_resource from libappstream-glib/libappstream-glib.8.dylib.p/meson-generated_.._as-resources.c.o
Undefined symbols for architecture x86_64:
  "_sb_stemmer_new", referenced from:
      _as_stemmer_init in as-stemmer.c.o
  "_sb_stemmer_stem", referenced from:
      _as_stemmer_process in as-stemmer.c.o
  "_sb_stemmer_length", referenced from:
      _as_stemmer_process in as-stemmer.c.o
  "_sb_stemmer_delete", referenced from:
      _as_stemmer_finalize in as-stemmer.c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Change History (9)

comment:1 Changed 22 months ago by rmottola (Riccardo)

apple gcc 4.2 is not enough to compile.

@kencu do you have some clue here?

Last edited 22 months ago by rmottola (Riccardo) (previous) (diff)

comment:2 Changed 22 months ago by kencu (Ken)

is libstemmer in the link somewhere?

comment:3 Changed 22 months ago by rmottola (Riccardo)

Replying to myself... before deciding if apple gcc 4.2 needs to be blackisted, the error is this:

[1/91] /usr/bin/gcc-4.2 -Ilibappstream-glib/libappstream-glib.8.dylib.p -Ilibappstream-glib -I../hughsie-appstream-glib-572c1ea/libappstream-glib -I. -I../hughsie-appstream-glib-572c1ea -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/gio-unix-2.0 -I/opt/local/include -Wall -Winvalid-pch -std=c99 -O0 -g -D_XOPEN_SOURCE=500 -DAS_COMPILATION -pipe -Os -arch x86_64 '-DG_LOG_DOMAIN="As"' -MD -MQ libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o -MF libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o.d -o libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o -c ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node.c
FAILED: libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o 
/usr/bin/gcc-4.2 -Ilibappstream-glib/libappstream-glib.8.dylib.p -Ilibappstream-glib -I../hughsie-appstream-glib-572c1ea/libappstream-glib -I. -I../hughsie-appstream-glib-572c1ea -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/gio-unix-2.0 -I/opt/local/include -Wall -Winvalid-pch -std=c99 -O0 -g -D_XOPEN_SOURCE=500 -DAS_COMPILATION -pipe -Os -arch x86_64 '-DG_LOG_DOMAIN="As"' -MD -MQ libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o -MF libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o.d -o libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o -c ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node.c
In file included from ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-app.h:17,
                 from ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node-private.h:14,
                 from ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node.c:27:
../hughsie-appstream-glib-572c1ea/libappstream-glib/as-enums.h:162: warning: ‘AsIdKind’ is deprecated
../hughsie-appstream-glib-572c1ea/libappstream-glib/as-enums.h:165: warning: ‘AsIdKind’ is deprecated
In file included from ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node-private.h:14,
                 from ../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node.c:27:
../hughsie-appstream-glib-572c1ea/libappstream-glib/as-app.h:735: warning: ‘AsIdKind’ is deprecated
../hughsie-appstream-glib-572c1ea/libappstream-glib/as-app.h:737: warning: ‘AsIdKind’ is deprecated
../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node.c:44: warning: declaration does not declare anything
../hughsie-appstream-glib-572c1ea/libappstream-glib/as-node.c:49: warning: declaration does not declare anythin

doesn't look at a compiler limitation, at a first glance.

comment:4 Changed 22 months ago by rmottola (Riccardo)

@kencu yes, I see -lstemmer on the command line when building with gcc7

FAILED: libappstream-glib/libappstream-glib.8.dylib 
/opt/local/bin/gcc-mp-7  -o libappstream-glib/libappstream-glib.8.dylib libappstream-glib/libappstream-glib.8.dylib.p/meson-generated_.._as-resources.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-app-builder.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-app.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-app-desktop.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-app-inf.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-app-validate.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-bundle.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-checksum.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-content-rating.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-enums.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-format.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-icon.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-image.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-inf.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-launchable.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-markup.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-monitor.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-node.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-agreement.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-agreement-section.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-problem.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-profile.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-provide.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-ref-string.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-release.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-require.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-review.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-screenshot.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-stemmer.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-store.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-store-cab.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-suggest.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-tag.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-translation.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-utils.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-version.c.o libappstream-glib/libappstream-glib.8.dylib.p/as-yaml.c.o -L/opt/local/lib -I/opt/local/include -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -shared -install_name @rpath/libappstream-glib.8.dylib -compatibility_version 8 -current_version 8 -Wl,-headerpad_max_install_names -arch x86_64 -pipe -Os -arch x86_64 -Wl,-exported_symbols_list,/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_appstream-glib/appstream-glib/work/hughsie-appstream-glib-572c1ea/libappstream-glib/appstream-glib.map.osx-clang /opt/local/lib/libgdk_pixbuf-2.0.dylib /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libglib-2.0.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libgio-2.0.dylib /opt/local/lib/libarchive.dylib /opt/local/lib/libcurl.dylib /opt/local/lib/libyaml.dylib -lstemmer
ld: warning: cannot export hidden symbol _as_get_resource from libappstream-glib/libappstream-glib.8.dylib.p/meson-generated_.._as-resources.c.o
Undefined symbols for architecture x86_64:
  "_sb_stemmer_new", referenced from:
      _as_stemmer_init in as-stemmer.c.o
  "_sb_stemmer_stem", referenced from:
      _as_stemmer_process in as-stemmer.c.o
  "_sb_stemmer_length", referenced from:
      _as_stemmer_process in as-stemmer.c.o
  "_sb_stemmer_delete", referenced from:
      _as_stemmer_finalize in as-stemmer.c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

comment:5 Changed 22 months ago by rmottola (Riccardo)

clang-7.0 fails the same as gcc7 with stemmer symbols.

comment:6 Changed 22 months ago by kencu (Ken)

do you have another libstemmer hiding somewhere (/usr/lib?).

Perhaps go into the right folder, and manually run the link, but add -Wl,-v to the flags to force the linker to be verbose.

comment:7 Changed 19 months ago by rmottola (Riccardo)

I upgraded in the meanwhile most of packages here on 10.5 and retry, with standard gcc 4.2

:info:build In file included from ../appstream-glib-0_8_2/libappstream-glib/as-app.h:17,
:info:build                  from ../appstream-glib-0_8_2/libappstream-glib/as-node-private.h:14,
:info:build                  from ../appstream-glib-0_8_2/libappstream-glib/as-node.c:27:
:info:build ../appstream-glib-0_8_2/libappstream-glib/as-enums.h:162: warning: ‘AsIdKind’ is deprecated
:info:build ../appstream-glib-0_8_2/libappstream-glib/as-enums.h:165: warning: ‘AsIdKind’ is deprecated
:info:build In file included from ../appstream-glib-0_8_2/libappstream-glib/as-node-private.h:14,
:info:build                  from ../appstream-glib-0_8_2/libappstream-glib/as-node.c:27:
:info:build ../appstream-glib-0_8_2/libappstream-glib/as-app.h:735: warning: ‘AsIdKind’ is deprecated

With this I think it is related to: https://trac.macports.org/ticket/66257

comment:8 Changed 19 months ago by rmottola (Riccardo)

building with macports-gcc-7 now works for me now...

comment:9 in reply to:  8 Changed 18 months ago by mascguy (Christopher Nielsen)

Resolution: worksforme
Status: newclosed

Replying to rmottola:

building with macports-gcc-7 now works for me now...

Great, glad this issue is resolved!

Note: See TracTickets for help on using tickets.