underlinking issues with `LDFLAGS="-Wl,-z,defs"`
After use LDFLAGS="-Wl,-z,now"
is possible to expose several underlinking issues:
[tkloczko@barrel x86_64-redhat-linux-gnu]$ ninja
[1/23] Linking target src/tracker-extract/libextract-oasis.so
FAILED: src/tracker-extract/libextract-oasis.so
/usr/bin/gcc -o src/tracker-extract/libextract-oasis.so src/tracker-extract/libextract-oasis.so.p/tracker-extract-oasis.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-oasis.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libgsf-1.so /usr/lib64/libxml2.so /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/cc3qij3w.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0xc8): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x13a): undefined reference to `tracker_gsf_parse_xml_in_zip'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x16b): undefined reference to `tracker_config_get_max_bytes'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x274): undefined reference to `tracker_gsf_parse_xml_in_zip'
collect2: error: ld returned 1 exit status
[2/23] Linking target src/tracker-extract/libextract-html.so
FAILED: src/tracker-extract/libextract-html.so
/usr/bin/gcc -o src/tracker-extract/libextract-html.so src/tracker-extract/libextract-html.so.p/tracker-extract-html.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-html.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libxml2.so /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/ccwMCsUF.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0xc2): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0xca): undefined reference to `tracker_config_get_max_bytes'
collect2: error: ld returned 1 exit status
[3/23] Linking target src/tracker-extract/libextract-msoffice-xml.so
FAILED: src/tracker-extract/libextract-msoffice-xml.so
/usr/bin/gcc -o src/tracker-extract/libextract-msoffice-xml.so src/tracker-extract/libextract-msoffice-xml.so.p/tracker-extract-msoffice-xml.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-msoffice-xml.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libgsf-1.so /usr/lib64/libxml2.so /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/ccGktzX2.lto.o: in function `xml_read.isra.0':
<artificial>:(.text.xml_read.isra.0[.text.xml_read.isra.0.group]+0x5e): undefined reference to `tracker_gsf_parse_xml_in_zip'
/usr/bin/ld: /tmp/ccGktzX2.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x10c): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x183): undefined reference to `tracker_config_get_max_bytes'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x1c6): undefined reference to `tracker_gsf_parse_xml_in_zip'
collect2: error: ld returned 1 exit status
[4/23] Linking target src/tracker-extract/libextract-epub.so
FAILED: src/tracker-extract/libextract-epub.so
/usr/bin/gcc -o src/tracker-extract/libextract-epub.so src/tracker-extract/libextract-epub.so.p/tracker-extract-epub.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-epub.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libgsf-1.so /usr/lib64/libxml2.so /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/cchXQHKB.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0xc8): undefined reference to `tracker_gsf_parse_xml_in_zip'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x1ce): undefined reference to `tracker_gsf_parse_xml_in_zip'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x24d): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x269): undefined reference to `tracker_config_get_max_bytes'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x2e9): undefined reference to `tracker_gsf_parse_xml_in_zip'
collect2: error: ld returned 1 exit status
[5/23] Linking target src/tracker-extract/libextract-text.so
FAILED: src/tracker-extract/libextract-text.so
/usr/bin/gcc -o src/tracker-extract/libextract-text.so src/tracker-extract/libextract-text.so.p/tracker-extract-text.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-text.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/ccXISR0v.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x34): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x3f): undefined reference to `tracker_config_get_text_allowlist_patterns'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0xb8): undefined reference to `tracker_config_get_max_bytes'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x11e): undefined reference to `tracker_read_text_from_fd'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x1c3): undefined reference to `tracker_extract_error_quark'
collect2: error: ld returned 1 exit status
[6/23] Linking target src/tracker-extract/libextract-pdf.so
FAILED: src/tracker-extract/libextract-pdf.so
/usr/bin/gcc -o src/tracker-extract/libextract-pdf.so src/tracker-extract/libextract-pdf.so.p/tracker-extract-pdf.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-pdf.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libpoppler-glib.so /usr/lib64/libcairo.so /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/ccKFGMgN.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x68f): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x697): undefined reference to `tracker_config_get_max_bytes'
collect2: error: ld returned 1 exit status
[7/23] Linking target src/tracker-extract/libextract-msoffice.so
FAILED: src/tracker-extract/libextract-msoffice.so
/usr/bin/gcc -o src/tracker-extract/libextract-msoffice.so src/tracker-extract/libextract-msoffice.so.p/tracker-extract-msoffice.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libextract-msoffice.so -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wl,--as-needed -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin src/libtracker-extract/libtracker-extract.so src/libtracker-miners-common/libtracker-miners-common.a /usr/lib64/libicuuc.so /usr/lib64/libicudata.so /usr/lib64/libicui18n.so -Wl,--export-dynamic /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libglib-2.0.so /usr/lib64/libtracker-sparql-3.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libexempi.so /usr/lib64/libexif.so /usr/lib64/libiptcdata.so -lm /usr/lib64/libgsf-1.so /usr/lib64/libxml2.so /usr/lib64/libseccomp.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../libtracker-extract' -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/tracker-miners-3.1.0.beta/x86_64-redhat-linux-gnu/src/libtracker-extract
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
/tmp/ccZhfJ5Y.lto.o: in function `tracker_extract_get_metadata':
<artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x1bc): undefined reference to `tracker_main_get_config'
/usr/bin/ld: <artificial>:(.text.tracker_extract_get_metadata[.text.tracker_extract_get_metadata.group]+0x1c4): undefined reference to `tracker_config_get_max_bytes'
collect2: error: ld returned 1 exit status
[8/23] Generating symbol file src/libtracker-miner/libtracker-miner-3.0.so.p/libtracker-miner-3.0.so.symbols
ninja: build stopped: subcommand failed.
Edited by Tomasz Kłoczko