mbox series

[RFC,0/2] meson: Pass objects to declare_dependency()

Message ID 20240524-objects-v1-0-07cbbe96166b@daynix.com (mailing list archive)
Headers show
Series meson: Pass objects to declare_dependency() | expand

Message

Akihiko Odaki May 24, 2024, 8 a.m. UTC
Based-on: <20240524-xkb-v4-0-2de564e5c859@daynix.com>
("[PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1")

This is changes suggested by Paolo Bonzini at:
https://lore.kernel.org/all/CABgObfYoEFZsW-H4WJ7xW0B85OqFi932d3-DmNAb6zTohFn=Og@mail.gmail.com/

Unfortunately it broke builds on my system. Below are the errors I
observed:

clang  -o qemu-img libauthz.a.p/authz_base.c.o libauthz.a.p/authz_list.c.o libauthz.a.p/authz_listfile.c.o libauthz.a.p/authz_simple.c.o libauthz.a.p/authz_pamacct.c.o libqom.a.p/qom_container.c.o libqom.a.p/qom_object.c.o libqom.a.p/qom_object_interfaces.c.o libqom.a.p/qom_qom-qobject.c.o libblock.a.p/block.c.o libblock.a.p/blockjob.c.o libblock.a.p/job.c.o libblock.a.p/qemu-io-cmds.c.o libblock.a.p/replication.c.o libblock.a.p/nbd_client.c.o libblock.a.p/nbd_client-connection.c.o libblock.a.p/nbd_common.c.o libblock.a.p/scsi_utils.c.o libblock.a.p/scsi_pr-manager.c.o libblock.a.p/scsi_pr-manager-helper.c.o libblock.a.p/block_accounting.c.o libblock.a.p/block_aio_task.c.o libblock.a.p/block_amend.c.o libblock.a.p/block_backup.c.o libblock.a.p/block_blkdebug.c.o libblock.a.p/block_blklogwrites.c.o libblock.a.p/block_blkverify.c.o libblock.a.p/block_block-backend.c.o libblock.a.p/block_block-copy.c.o libblock.a.p/block_commit.c.o libblock.a.p/block_copy-before-write.c.o libblock.a.p/block_copy-on-read.c.o libblock.a.p/block_create.c.o libblock.a.p/block_crypto.c.o libblock.a.p/block_dirty-bitmap.c.o libblock.a.p/block_filter-compress.c.o libblock.a.p/block_graph-lock.c.o libblock.a.p/block_io.c.o libblock.a.p/block_mirror.c.o libblock.a.p/block_nbd.c.o libblock.a.p/block_null.c.o libblock.a.p/block_preallocate.c.o libblock.a.p/block_progress_meter.c.o libblock.a.p/block_qapi.c.o libblock.a.p/block_qcow2.c.o libblock.a.p/block_qcow2-bitmap.c.o libblock.a.p/block_qcow2-cache.c.o libblock.a.p/block_qcow2-cluster.c.o libblock.a.p/block_qcow2-refcount.c.o libblock.a.p/block_qcow2-snapshot.c.o libblock.a.p/block_qcow2-threads.c.o libblock.a.p/block_quorum.c.o libblock.a.p/block_raw-format.c.o libblock.a.p/block_reqlist.c.o libblock.a.p/block_snapshot.c.o libblock.a.p/block_snapshot-access.c.o libblock.a.p/block_throttle.c.o libblock.a.p/block_throttle-groups.c.o libblock.a.p/block_write-threshold.c.o libblock.a.p/block_qcow.c.o libblock.a.p/block_vdi.c.o libblock.a.p/block_vhdx-endian.c.o libblock.a.p/block_vhdx-log.c.o libblock.a.p/block_vhdx.c.o libblock.a.p/block_vmdk.c.o libblock.a.p/block_vpc.c.o libblock.a.p/block_cloop.c.o libblock.a.p/block_bochs.c.o libblock.a.p/block_vvfat.c.o libblock.a.p/block_dmg.c.o libblock.a.p/block_qed-check.c.o libblock.a.p/block_qed-cluster.c.o libblock.a.p/block_qed-l2-cache.c.o libblock.a.p/block_qed-table.c.o libblock.a.p/block_qed.c.o libblock.a.p/block_parallels.c.o libblock.a.p/block_parallels-ext.c.o libblock.a.p/block_file-posix.c.o libblock.a.p/block_nvme.c.o libblock.a.p/block_replication.c.o libblock.a.p/block_stream.c.o libblock.a.p/block_monitor_bitmap-qmp-cmds.c.o libblock.a.p/block_curl.c.o libblock.a.p/block_ssh.c.o libblock.a.p/block_dmg-bz2.c.o libblock.a.p/meson-generated_.._block_block-gen.c.o libcrypto.a.p/crypto_afsplit.c.o libcrypto.a.p/crypto_akcipher.c.o libcrypto.a.p/crypto_block-luks.c.o libcrypto.a.p/crypto_block-qcow.c.o libcrypto.a.p/crypto_block.c.o libcrypto.a.p/crypto_cipher.c.o libcrypto.a.p/crypto_der.c.o libcrypto.a.p/crypto_hash.c.o libcrypto.a.p/crypto_hmac.c.o libcrypto.a.p/crypto_ivgen-essiv.c.o libcrypto.a.p/crypto_ivgen-plain.c.o libcrypto.a.p/crypto_ivgen-plain64.c.o libcrypto.a.p/crypto_ivgen.c.o libcrypto.a.p/crypto_pbkdf.c.o libcrypto.a.p/crypto_secret_common.c.o libcrypto.a.p/crypto_secret.c.o libcrypto.a.p/crypto_tlscreds.c.o libcrypto.a.p/crypto_tlscredsanon.c.o libcrypto.a.p/crypto_tlscredspsk.c.o libcrypto.a.p/crypto_tlscredsx509.c.o libcrypto.a.p/crypto_tlssession.c.o libcrypto.a.p/crypto_rsakey.c.o libcrypto.a.p/crypto_hash-gnutls.c.o libcrypto.a.p/crypto_hmac-gnutls.c.o libcrypto.a.p/crypto_pbkdf-gnutls.c.o libcrypto.a.p/crypto_secret_keyring.c.o libio.a.p/io_channel-buffer.c.o libio.a.p/io_channel-command.c.o libio.a.p/io_channel-file.c.o libio.a.p/io_channel-null.c.o libio.a.p/io_channel-socket.c.o libio.a.p/io_channel-tls.c.o libio.a.p/io_channel-util.c.o libio.a.p/io_channel-watch.c.o libio.a.p/io_channel-websock.c.o libio.a.p/io_channel.c.o libio.a.p/io_dns-resolver.c.o libio.a.p/io_net-listener.c.o libio.a.p/io_task.c.o libevent-loop-base.a.p/event-loop-base.c.o qemu-img.p/qemu-img.c.o -Werror -flto -Wl,--as-needed -Wl,--no-undefined -pie -fsanitize=cfi-icall -fsanitize-cfi-icall-generalize-pointers -fsanitize=undefined -fsanitize=address -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -fuse-ld=lld -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a @block.syms /usr/lib64/libgio-2.0.so /usr/lib64/libgobject-2.0.so /usr/lib64/libglib-2.0.so /usr/lib64/libgmodule-2.0.so -pthread /usr/lib64/libgnutls.so -lm /usr/lib64/libpixman-1.so -Wl,--end-group
ld.lld: error: undefined symbol: pam_start
>>> referenced by pamacct.c:40 (/home/me/q/var/qemu/build/../authz/pamacct.c:40)
>>>               qemu-img.lto.o:(qauthz_pam_is_allowed.cfi)

ld.lld: error: undefined symbol: pam_strerror
>>> referenced by pamacct.c:45 (/home/me/q/var/qemu/build/../authz/pamacct.c:45)
>>>               qemu-img.lto.o:(qauthz_pam_is_allowed.cfi)
>>> referenced by pamacct.c:53 (/home/me/q/var/qemu/build/../authz/pamacct.c:53)
>>>               qemu-img.lto.o:(qauthz_pam_is_allowed.cfi)

ld.lld: error: undefined symbol: pam_acct_mgmt
>>> referenced by pamacct.c:50 (/home/me/q/var/qemu/build/../authz/pamacct.c:50)
>>>               qemu-img.lto.o:(qauthz_pam_is_allowed.cfi)

ld.lld: error: undefined symbol: pam_end
>>> referenced by pamacct.c:51 (/home/me/q/var/qemu/build/../authz/pamacct.c:51)
>>>               qemu-img.lto.o:(qauthz_pam_is_allowed.cfi)

ld.lld: error: undefined symbol: ZSTD_createCCtx
>>> referenced by qcow2-threads.c:203 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:203)
>>>               qemu-img.lto.o:(qcow2_zstd_compress.cfi)

ld.lld: error: undefined symbol: ZSTD_compressStream2
>>> referenced by qcow2-threads.c:225 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:225)
>>>               qemu-img.lto.o:(qcow2_zstd_compress.cfi)

ld.lld: error: undefined symbol: ZSTD_freeCCtx
>>> referenced by qcow2-threads.c:240 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:240)
>>>               qemu-img.lto.o:(qcow2_zstd_compress.cfi)

ld.lld: error: undefined symbol: deflateInit2_
>>> referenced by qcow2-threads.c:101 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:101)
>>>               qemu-img.lto.o:(qcow2_zlib_compress.cfi)
>>> referenced by qcow.c:1081 (/home/me/q/var/qemu/build/../block/qcow.c:1081)
>>>               qemu-img.lto.o:(qcow_co_pwritev_compressed.cfi)

ld.lld: error: undefined symbol: deflate
>>> referenced by qcow2-threads.c:116 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:116)
>>>               qemu-img.lto.o:(qcow2_zlib_compress.cfi)
>>> referenced by qcow.c:1094 (/home/me/q/var/qemu/build/../block/qcow.c:1094)
>>>               qemu-img.lto.o:(qcow_co_pwritev_compressed.cfi)

ld.lld: error: undefined symbol: deflateEnd
>>> referenced by qcow2-threads.c:123 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:123)
>>>               qemu-img.lto.o:(qcow2_zlib_compress.cfi)
>>> referenced by qcow.c:1102 (/home/me/q/var/qemu/build/../block/qcow.c:1102)
>>>               qemu-img.lto.o:(qcow_co_pwritev_compressed.cfi)
>>> referenced by qcow.c:1096 (/home/me/q/var/qemu/build/../block/qcow.c:1096)
>>>               qemu-img.lto.o:(qcow_co_pwritev_compressed.cfi)

ld.lld: error: undefined symbol: ZSTD_createDCtx
>>> referenced by qcow2-threads.c:271 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:271)
>>>               qemu-img.lto.o:(qcow2_zstd_decompress.cfi)

ld.lld: error: undefined symbol: ZSTD_decompressStream
>>> referenced by qcow2-threads.c:291 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:291)
>>>               qemu-img.lto.o:(qcow2_zstd_decompress.cfi)

ld.lld: error: undefined symbol: ZSTD_isError
>>> referenced by qcow2-threads.c:293 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:293)
>>>               qemu-img.lto.o:(qcow2_zstd_decompress.cfi)

ld.lld: error: undefined symbol: ZSTD_freeDCtx
>>> referenced by qcow2-threads.c:322 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:322)
>>>               qemu-img.lto.o:(qcow2_zstd_decompress.cfi)
>>> referenced by qcow2-threads.c:322 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:322)
>>>               qemu-img.lto.o:(qcow2_zstd_decompress.cfi)

ld.lld: error: undefined symbol: inflateInit2_
>>> referenced by qcow2-threads.c:152 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:152)
>>>               qemu-img.lto.o:(qcow2_zlib_decompress.cfi)
>>> referenced by qcow.c:581 (/home/me/q/var/qemu/build/../block/qcow.c:581)
>>>               qemu-img.lto.o:(decompress_cluster)

ld.lld: error: undefined symbol: inflate
>>> referenced by qcow2-threads.c:157 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:157)
>>>               qemu-img.lto.o:(qcow2_zlib_decompress.cfi)
>>> referenced by qcow.c:584 (/home/me/q/var/qemu/build/../block/qcow.c:584)
>>>               qemu-img.lto.o:(decompress_cluster)
>>> referenced by cloop.c:244 (/home/me/q/var/qemu/build/../block/cloop.c:244)
>>>               qemu-img.lto.o:(cloop_read_block)
>>> referenced 3 more times

ld.lld: error: undefined symbol: inflateEnd
>>> referenced by qcow2-threads.c:169 (/home/me/q/var/qemu/build/../block/qcow2-threads.c:169)
>>>               qemu-img.lto.o:(qcow2_zlib_decompress.cfi)
>>> referenced by qcow.c:0 (/home/me/q/var/qemu/build/../block/qcow.c:0)
>>>               qemu-img.lto.o:(decompress_cluster)
>>> referenced by qcow.c:0 (/home/me/q/var/qemu/build/../block/qcow.c:0)
>>>               qemu-img.lto.o:(decompress_cluster)
>>> referenced 2 more times

ld.lld: error: undefined symbol: uncompress
>>> referenced by vmdk.c:1958 (/home/me/q/var/qemu/build/../block/vmdk.c:1958)
>>>               qemu-img.lto.o:(vmdk_read_extent)

ld.lld: error: undefined symbol: compress
>>> referenced by vmdk.c:1865 (/home/me/q/var/qemu/build/../block/vmdk.c:1865)
>>>               qemu-img.lto.o:(vmdk_write_extent)

ld.lld: error: undefined symbol: inflateReset
>>> referenced by cloop.c:240 (/home/me/q/var/qemu/build/../block/cloop.c:240)
>>>               qemu-img.lto.o:(cloop_read_block)
>>> referenced by cloop.c:240 (/home/me/q/var/qemu/build/../block/cloop.c:240)
>>>               qemu-img.lto.o:(cloop_read_block)
>>> referenced by dmg.c:658 (/home/me/q/var/qemu/build/../block/dmg.c:658)
>>>               qemu-img.lto.o:(dmg_read_chunk)
>>> referenced 1 more times

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
Akihiko Odaki (2):
      meson: Pass objects to declare_dependency()
      Revert "meson: Propagate gnutls dependency"

 docs/devel/build-system.rst           |  2 +-
 meson.build                           | 31 ++++++++++++++++---------------
 block/meson.build                     |  2 +-
 gdbstub/meson.build                   |  4 ++--
 io/meson.build                        |  2 +-
 storage-daemon/meson.build            |  2 +-
 subprojects/libvhost-user/meson.build |  2 +-
 tests/qtest/libqos/meson.build        |  2 +-
 ui/meson.build                        |  2 +-
 9 files changed, 25 insertions(+), 24 deletions(-)
---
base-commit: 4a207ef32de97bc785ced1987eacab7665b49420
change-id: 20240524-objects-3dc07e485b7f

Best regards,

Comments

Paolo Bonzini May 24, 2024, 9:14 a.m. UTC | #1
On Fri, May 24, 2024 at 10:00 AM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> Based-on: <20240524-xkb-v4-0-2de564e5c859@daynix.com>
> ("[PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1")
>
> This is changes suggested by Paolo Bonzini at:
> https://lore.kernel.org/all/CABgObfYoEFZsW-H4WJ7xW0B85OqFi932d3-DmNAb6zTohFn=Og@mail.gmail.com/
>
> Unfortunately it broke builds on my system. Below are the errors I
> observed:
>
> ld.lld: error: undefined symbol: pam_start
> >>> referenced by pamacct.c:40 (/home/me/q/var/qemu/build/../authz/pamacct.c:40)
> >>>               qemu-img.lto.o:(qauthz_pam_is_allowed.cfi)

Thanks Akihiko for putting together the RFC! This is simply because
dependencies need to be added to the declare_dependency(). I'll post
the full series once I finish testing it.

Paolo