relocation overflow in R_AARCH64_ADR_PREL_LO21 #152

Closed
opened 2024-10-28 17:44:30 -05:00 by tkekan · 11 comments
tkekan commented 2024-10-28 17:44:30 -05:00 (Migrated from github.com)

Hello All,

I'm getting errors like below whenever the linking happens with isal-crypto via the spdk lib. isal-crypto is built via spdk sources
Any clue / pointers on what is happening here ?

sha1_mb/aarch64/sha1_mb_x1_ce.S:103: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_mb_x2_ce.S:118: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_aarch64_x1.S:248: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_aarch64_x1.S:253: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_aarch64_x1.S:258: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_aarch64_x1.S:263: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_ce.S:163: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_ce.S:255: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_ce.S:263: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1/aarch64/mh_sha1_block_ce.S:271: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha256_mb/aarch64/sha256_mb_x1_ce.S:115: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha256_mb/aarch64/sha256_mb_x2_ce.S:144: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha256_mb/aarch64/sha256_mb_x3_ce.S:166: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha256_mb/aarch64/sha256_mb_x4_ce.S:195: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha512_mb/aarch64/sha512_mb_x1_ce.S:140: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
sha512_mb/aarch64/sha512_mb_x2_ce.S:230: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:219: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:221: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:223: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:225: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:237: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:329: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:337: error: relocation overflow in R_AARCH64_ADR_PREL_LO21
mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:345: error: relocation overflow in R_AARCH64_ADR_PREL_LO21

Hello All, I'm getting errors like below whenever the linking happens with isal-crypto via the spdk lib. isal-crypto is built via spdk sources Any clue / pointers on what is happening here ? ``` sha1_mb/aarch64/sha1_mb_x1_ce.S:103: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_mb_x2_ce.S:118: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_aarch64_x1.S:248: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_aarch64_x1.S:253: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_aarch64_x1.S:258: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_aarch64_x1.S:263: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha1_mb/aarch64/sha1_mb_asimd_x4.S:145: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_asimd.S:82: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_ce.S:163: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_ce.S:255: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_ce.S:263: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1/aarch64/mh_sha1_block_ce.S:271: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha256_mb/aarch64/sha256_mb_x1_ce.S:115: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha256_mb/aarch64/sha256_mb_x2_ce.S:144: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha256_mb/aarch64/sha256_mb_x3_ce.S:166: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha256_mb/aarch64/sha256_mb_x4_ce.S:195: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha512_mb/aarch64/sha512_mb_x1_ce.S:140: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 sha512_mb/aarch64/sha512_mb_x2_ce.S:230: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:219: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:221: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:223: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:225: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:237: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:329: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:337: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 mh_sha1_murmur3_x64_128/aarch64/mh_sha1_murmur3_block_ce.S:345: error: relocation overflow in R_AARCH64_ADR_PREL_LO21 ```
chenxuqiang commented 2024-11-06 20:16:00 -06:00 (Migrated from github.com)

Can you provide a method to reproduce the problem? including the SPDK version and compilation commands and Compiler Version

Can you provide a method to reproduce the problem? including the SPDK version and compilation commands and Compiler Version
tkekan commented 2024-11-12 13:16:44 -06:00 (Migrated from github.com)

@chenxuqiang Yes

Using
Bazel: release 7.3.1
SPDK : 24.9.0-pre
GCC : 13

  1. Build SPDK from sources as below . Below is a SPDK BUILD file
filegroup(
    name = "sources",
    srcs = glob(["**"]),
    visibility = ["//third-party/spdk:__subpackages__"],
)


configure_make(
    name = "spdk",
    configure_command = "configure",
    lib_source = ":sources",
    configure_in_place = True,
    configure_options = ["--without-shared", "--without-crypto"],
    includes = ["include", "lib"],
    args = args_attr,
    copts = [
        "-Wno-unused-parameter",
        "-Wno-missing-field-initializers",
        "-Iexternal/spdk/spdk/lib",
        "-Wno-pointer-arith",
        "-Wno-conversion",
        "-Wno-sign-conversion",
        "-Wno-switch-default",
        "-Wno-cast-qual",
        "-Wno-packed",
        "-Wno-pedantic",
        "-Wno-redundant-decls",
        "-Wno-shadow",
        "-Wno-variadic-macros",
        "-Wno-logical-op",
        "-Wno-discarded-qualifiers",
        "-Wno-suggest-attribute=format",
        "-Wno-stack-usage",
        "-Wno-float-equal",
        "-Wno-cpp",
    ],
    linkopts = [
        "-pthread",
        "-lnuma",
        "-luuid",
        "-ldl",
        "-lssl",
        "-lcrypto",
        "-lrt",
        "-lm",
        "-lfuse3",
        "-lz",
        "-laio",
        "-lkeyutils",
    ],
    out_static_libs = [
        "libisal.a",
        "libspdk_accel.a",
        "libspdk_accel_error.a",
        "libspdk_accel_ioat.a",
        "libspdk_bdev.a",
        "libspdk_bdev_aio.a",
        "libspdk_bdev_delay.a",
        "libspdk_bdev_error.a",
        "libspdk_bdev_ftl.a",
        "libspdk_bdev_gpt.a",
        "libspdk_bdev_lvol.a",
        "libspdk_bdev_malloc.a",
        "libspdk_bdev_null.a",
        "libspdk_bdev_nvme.a",
        "libspdk_bdev_passthru.a",
        "libspdk_bdev_raid.a",
        "libspdk_bdev_split.a",
        "libspdk_bdev_virtio.a",
        "libspdk_bdev_zone_block.a",
        "libspdk_blob.a",
        "libspdk_blob_bdev.a",
        "libspdk_blobfs.a",
        "libspdk_blobfs_bdev.a",
        "libspdk_conf.a",
        "libspdk_dma.a",
        "libspdk_env_dpdk.a",
        "libspdk_env_dpdk_rpc.a",
        "libspdk_event.a",
        "libspdk_event_accel.a",
        "libspdk_event_bdev.a",
        "libspdk_event_iobuf.a",
        "libspdk_event_keyring.a",
        "libspdk_event_nbd.a",
        "libspdk_event_scheduler.a",
        "libspdk_event_scsi.a",
        "libspdk_event_sock.a",
        "libspdk_event_vhost_blk.a",
        "libspdk_event_vhost_scsi.a",
        "libspdk_event_vmd.a",
        "libspdk_ftl.a",
        "libspdk_init.a",
        "libspdk_ioat.a",
        "libspdk_iscsi.a",
        "libspdk_json.a",
        "libspdk_jsonrpc.a",
        "libspdk_keyring.a",
        "libspdk_keyring_file.a",
        "libspdk_keyring_linux.a",
        "libspdk_log.a",
        "libspdk_lvol.a",
        "libspdk_nbd.a",
        "libspdk_notify.a",
        "libspdk_nvme.a",
        "libspdk_nvmf.a",
        "libspdk_rpc.a",
        "libspdk_scheduler_dpdk_governor.a",
        "libspdk_scheduler_dynamic.a",
        "libspdk_scheduler_gscheduler.a",
        "libspdk_scsi.a",
        "libspdk_sock.a",
        "libspdk_sock_posix.a",
        "libspdk_thread.a",
        "libspdk_trace.a",
        "libspdk_trace_parser.a",
        "libspdk_util.a",
        "libspdk_vfio_user.a",
        "libspdk_vhost.a",
        "libspdk_virtio.a",
        "libspdk_vmd.a",
        "librte_bus_pci.a",
        "librte_bus_vdev.a",
        "librte_cmdline.a",
        "librte_compressdev.a",
        "librte_cryptodev.a",
        "librte_dmadev.a",
        "librte_eal.a",
        "librte_ethdev.a",
        "librte_hash.a",
        "librte_kvargs.a",
        "librte_log.a",
        "librte_mbuf.a",
        "librte_mempool.a",
        "librte_mempool_ring.a",
        "librte_meter.a",
        "librte_net.a",
        "librte_pci.a",
        "librte_power.a",
        "librte_rcu.a",
        "librte_reorder.a",
        "librte_ring.a",
        "librte_security.a",
        "librte_telemetry.a",
        "librte_timer.a",
        "librte_vhost.a",
        "libisal_crypto.a",
    ] ,
    out_binaries = [
        "nvmf_tgt",
        "spdk_rpc",
        "spdk_nvme_perf",
        "spdk_tgt",
        "spdk_top",
        "spdk_trace",
    ],
    alwayslink = True,
)
  1. Create a sample hello-world program and link the spdk to that binary
# cat sample_program/hello-world.cpp
#include <iostream>

using namespace std;

int main() {
    cout << "Hello World!" << endl;
    return 0;
}

# This is a bazel build file
cc_binary(
    name = "hello-world",
    srcs = ["hello-world.cpp"],
    deps = [
            "//third-party/spdk:spdk",  
            ]
)
  1. Compile the sample_program
# bazel build //sample_program:hello-world
INFO: Analyzed target //sample_program:hello-world (1 packages loaded, 2 targets configured).
ERROR: /root/dpp-workspace/sample_program/BUILD:1:10: Linking sample_program/hello-world failed: (Exit 1): gcc failed: error executing CppLink command (from target //sample_program:hello-world) /opt/rh/gcc-toolset-13/root/bin/gcc @bazel-out/aarch64-fastbuild/bin/sample_program/hello-world-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x1_ce.o): in function `sha256_mb_ce_x1':
/root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x1_ce.S:115:(.text+0xc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16'
bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x2_ce.o): in function `sha256_mb_ce_x2':
/root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x2_ce.S:144:(.text+0x28): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16'
bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x3_ce.o): in function `sha256_mb_ce_x3':
/root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x3_ce.S:166:(.text+0x34): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16'
bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x4_ce.o): in function `sha256_mb_ce_x4':
/root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x4_ce.S:195:(.text+0x40): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16'
bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha512_mb_x1_ce.o): in function `sha512_mb_ce_x1':
/root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha512_mb/aarch64/sha512_mb_x1_ce.S:140:(.text+0xc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16'
bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha512_mb_x2_ce.o): in function `sha512_mb_ce_x2':
/root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha512_mb/aarch64/sha512_mb_x2_ce.S:230:(.text+0x28): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16'
collect2: error: ld returned 1 exit status
Target //sample_program:hello-world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.014s, Critical Path: 0.58s
INFO: 7 processes: 6 internal, 1 processwrapper-sandbox.
ERROR: Build did NOT complete successfully
@chenxuqiang Yes **Using** Bazel: release 7.3.1 SPDK : 24.9.0-pre GCC : 13 1. Build SPDK from sources as below . Below is a SPDK BUILD file ``` filegroup( name = "sources", srcs = glob(["**"]), visibility = ["//third-party/spdk:__subpackages__"], ) configure_make( name = "spdk", configure_command = "configure", lib_source = ":sources", configure_in_place = True, configure_options = ["--without-shared", "--without-crypto"], includes = ["include", "lib"], args = args_attr, copts = [ "-Wno-unused-parameter", "-Wno-missing-field-initializers", "-Iexternal/spdk/spdk/lib", "-Wno-pointer-arith", "-Wno-conversion", "-Wno-sign-conversion", "-Wno-switch-default", "-Wno-cast-qual", "-Wno-packed", "-Wno-pedantic", "-Wno-redundant-decls", "-Wno-shadow", "-Wno-variadic-macros", "-Wno-logical-op", "-Wno-discarded-qualifiers", "-Wno-suggest-attribute=format", "-Wno-stack-usage", "-Wno-float-equal", "-Wno-cpp", ], linkopts = [ "-pthread", "-lnuma", "-luuid", "-ldl", "-lssl", "-lcrypto", "-lrt", "-lm", "-lfuse3", "-lz", "-laio", "-lkeyutils", ], out_static_libs = [ "libisal.a", "libspdk_accel.a", "libspdk_accel_error.a", "libspdk_accel_ioat.a", "libspdk_bdev.a", "libspdk_bdev_aio.a", "libspdk_bdev_delay.a", "libspdk_bdev_error.a", "libspdk_bdev_ftl.a", "libspdk_bdev_gpt.a", "libspdk_bdev_lvol.a", "libspdk_bdev_malloc.a", "libspdk_bdev_null.a", "libspdk_bdev_nvme.a", "libspdk_bdev_passthru.a", "libspdk_bdev_raid.a", "libspdk_bdev_split.a", "libspdk_bdev_virtio.a", "libspdk_bdev_zone_block.a", "libspdk_blob.a", "libspdk_blob_bdev.a", "libspdk_blobfs.a", "libspdk_blobfs_bdev.a", "libspdk_conf.a", "libspdk_dma.a", "libspdk_env_dpdk.a", "libspdk_env_dpdk_rpc.a", "libspdk_event.a", "libspdk_event_accel.a", "libspdk_event_bdev.a", "libspdk_event_iobuf.a", "libspdk_event_keyring.a", "libspdk_event_nbd.a", "libspdk_event_scheduler.a", "libspdk_event_scsi.a", "libspdk_event_sock.a", "libspdk_event_vhost_blk.a", "libspdk_event_vhost_scsi.a", "libspdk_event_vmd.a", "libspdk_ftl.a", "libspdk_init.a", "libspdk_ioat.a", "libspdk_iscsi.a", "libspdk_json.a", "libspdk_jsonrpc.a", "libspdk_keyring.a", "libspdk_keyring_file.a", "libspdk_keyring_linux.a", "libspdk_log.a", "libspdk_lvol.a", "libspdk_nbd.a", "libspdk_notify.a", "libspdk_nvme.a", "libspdk_nvmf.a", "libspdk_rpc.a", "libspdk_scheduler_dpdk_governor.a", "libspdk_scheduler_dynamic.a", "libspdk_scheduler_gscheduler.a", "libspdk_scsi.a", "libspdk_sock.a", "libspdk_sock_posix.a", "libspdk_thread.a", "libspdk_trace.a", "libspdk_trace_parser.a", "libspdk_util.a", "libspdk_vfio_user.a", "libspdk_vhost.a", "libspdk_virtio.a", "libspdk_vmd.a", "librte_bus_pci.a", "librte_bus_vdev.a", "librte_cmdline.a", "librte_compressdev.a", "librte_cryptodev.a", "librte_dmadev.a", "librte_eal.a", "librte_ethdev.a", "librte_hash.a", "librte_kvargs.a", "librte_log.a", "librte_mbuf.a", "librte_mempool.a", "librte_mempool_ring.a", "librte_meter.a", "librte_net.a", "librte_pci.a", "librte_power.a", "librte_rcu.a", "librte_reorder.a", "librte_ring.a", "librte_security.a", "librte_telemetry.a", "librte_timer.a", "librte_vhost.a", "libisal_crypto.a", ] , out_binaries = [ "nvmf_tgt", "spdk_rpc", "spdk_nvme_perf", "spdk_tgt", "spdk_top", "spdk_trace", ], alwayslink = True, ) ``` 2. Create a sample hello-world program and link the spdk to that binary ``` # cat sample_program/hello-world.cpp #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } ``` ``` # This is a bazel build file cc_binary( name = "hello-world", srcs = ["hello-world.cpp"], deps = [ "//third-party/spdk:spdk", ] ) ``` 3. Compile the sample_program ``` # bazel build //sample_program:hello-world INFO: Analyzed target //sample_program:hello-world (1 packages loaded, 2 targets configured). ERROR: /root/dpp-workspace/sample_program/BUILD:1:10: Linking sample_program/hello-world failed: (Exit 1): gcc failed: error executing CppLink command (from target //sample_program:hello-world) /opt/rh/gcc-toolset-13/root/bin/gcc @bazel-out/aarch64-fastbuild/bin/sample_program/hello-world-2.params Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x1_ce.o): in function `sha256_mb_ce_x1': /root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x1_ce.S:115:(.text+0xc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16' bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x2_ce.o): in function `sha256_mb_ce_x2': /root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x2_ce.S:144:(.text+0x28): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16' bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x3_ce.o): in function `sha256_mb_ce_x3': /root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x3_ce.S:166:(.text+0x34): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16' bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha256_mb_x4_ce.o): in function `sha256_mb_ce_x4': /root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha256_mb/aarch64/sha256_mb_x4_ce.S:195:(.text+0x40): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16' bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha512_mb_x1_ce.o): in function `sha512_mb_ce_x1': /root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha512_mb/aarch64/sha512_mb_x1_ce.S:140:(.text+0xc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16' bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk/lib/libisal_crypto.a(sha512_mb_x2_ce.o): in function `sha512_mb_ce_x2': /root/.cache/bazel/_bazel_root/78159c4ab73ed818c6000c3e550185d3/sandbox/processwrapper-sandbox/1/execroot/_main/bazel-out/aarch64-fastbuild/bin/third-party/spdk/spdk.build_tmpdir/isa-l-crypto/sha512_mb/aarch64/sha512_mb_x2_ce.S:230:(.text+0x28): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rol0_data.cst16' collect2: error: ld returned 1 exit status Target //sample_program:hello-world failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 1.014s, Critical Path: 0.58s INFO: 7 processes: 6 internal, 1 processwrapper-sandbox. ERROR: Build did NOT complete successfully ```
tkekan commented 2024-11-19 16:25:10 -06:00 (Migrated from github.com)

@chenxuqiang Where you able to repro this ?

@chenxuqiang Where you able to repro this ?
tkekan commented 2025-01-03 12:49:05 -06:00 (Migrated from github.com)

@chenxuqiang Where you able to repro this ?

Hello @chenxuqiang , did above instructions helped in repro the issue ?

> @chenxuqiang Where you able to repro this ? Hello @chenxuqiang , did above instructions helped in repro the issue ?
tkekan commented 2025-01-27 15:52:03 -06:00 (Migrated from github.com)

Hello @pablodelara , can someone please help on this issue ?

Hello @pablodelara , can someone please help on this issue ?
pablodelara commented 2025-01-27 16:12:39 -06:00 (Migrated from github.com)

Hi @tkekan. I need someone with ARM experience. @chenxuqiang, could you take another look again?

Hi @tkekan. I need someone with ARM experience. @chenxuqiang, could you take another look again?
waldoweng commented 2025-04-24 07:32:10 -05:00 (Migrated from github.com)

hit the same problem, may I know is there any progress?

hit the same problem, may I know is there any progress?
waldoweng commented 2025-04-25 03:31:00 -05:00 (Migrated from github.com)

just reproduce with this tiny repo: https://github.com/waldoweng/isa-l_crypto-compile-troubleshooting

gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SPDK: b2818ead500b6663c9600ac8b81619dbc8590e04 -- It's the latest commit hash by now.

git clone https://github.com/waldoweng/isa-l_crypto-compile-troubleshooting
cd isa-l_crypto-compile-troubleshooting && git submodule update --init --recursive

# build spdk
# cat setup.sh
# cd third-party/spdk && sudo scripts/pkgdep.sh && ./configure --without-shared --without-crypto && make -j
./setup.sh

# build main.cc
./build.sh

below is output on my machine:

/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libcrypto.a(libcrypto-lib-f_impl64.o): in function `gf_mul':
(.text+0x0): multiple definition of `gf_mul'; ./third-party/spdk/isa-l/.libs//libisal.a(ec_base.o):/home/waldo/demo/third-party/spdk/isa-l/erasure_code/ec_base.c:50: first defined here
/usr/bin/ld: ./third-party/spdk/dpdk/build/lib//librte_eal.a(eal_common_eal_common_options.c.o): in function `eal_plugins_init':
eal_common_options.c:(.text.unlikely+0x214): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: ./third-party/spdk/dpdk/build/lib//librte_eal.a(eal_common_eal_common_trace_utils.c.o): in function `rte_trace_save':
eal_common_trace_utils.c:(.text.experimental+0x354): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: ./third-party/spdk/build/lib//libspdk_iscsi.a(portal_grp.o): in function `iscsi_parse_redirect_addr':
/home/waldo/demo/third-party/spdk/lib/iscsi/portal_grp.c:224: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libcrypto.a(libcrypto-lib-bio_sock.o): in function `BIO_gethostbyname':
(.text+0x70): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_mb_x1_ce.o): in function `sha1_mb_ce_x1':
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_x1_ce.S:103:(.text+0xc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_mb_x2_ce.o): in function `sha1_mb_ce_x2':
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_x2_ce.S:118:(.text+0x4): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_aarch64_x1.o): in function `.block_loop':
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:248:(.text+0x50): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:253:(.text+0x3c4): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:258:(.text+0x78c): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:263:(.text+0xc44): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_mb_asimd_x4.o): in function `.block_loop':
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0xdc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0x56c): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0xa74): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
/home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0x106c): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16'
./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(mh_sha1_block_sve.o): in function `mh_sha1_block_sve':
/home/waldo/demo/third-party/spdk/isa-l-crypto/mh_sha1/aarch64/mh_sha1_block_sve.S:258:(.text+0x3c): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
just reproduce with this tiny repo: https://github.com/waldoweng/isa-l_crypto-compile-troubleshooting ```bash gcc --version gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` SPDK: [b2818ead500b6663c9600ac8b81619dbc8590e04](https://github.com/spdk/spdk/tree/b2818ead500b6663c9600ac8b81619dbc8590e04) -- It's the latest commit hash by now. ```bash git clone https://github.com/waldoweng/isa-l_crypto-compile-troubleshooting cd isa-l_crypto-compile-troubleshooting && git submodule update --init --recursive # build spdk # cat setup.sh # cd third-party/spdk && sudo scripts/pkgdep.sh && ./configure --without-shared --without-crypto && make -j ./setup.sh # build main.cc ./build.sh ``` below is output on my machine: ```bash /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libcrypto.a(libcrypto-lib-f_impl64.o): in function `gf_mul': (.text+0x0): multiple definition of `gf_mul'; ./third-party/spdk/isa-l/.libs//libisal.a(ec_base.o):/home/waldo/demo/third-party/spdk/isa-l/erasure_code/ec_base.c:50: first defined here /usr/bin/ld: ./third-party/spdk/dpdk/build/lib//librte_eal.a(eal_common_eal_common_options.c.o): in function `eal_plugins_init': eal_common_options.c:(.text.unlikely+0x214): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: ./third-party/spdk/dpdk/build/lib//librte_eal.a(eal_common_eal_common_trace_utils.c.o): in function `rte_trace_save': eal_common_trace_utils.c:(.text.experimental+0x354): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: ./third-party/spdk/build/lib//libspdk_iscsi.a(portal_grp.o): in function `iscsi_parse_redirect_addr': /home/waldo/demo/third-party/spdk/lib/iscsi/portal_grp.c:224: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libcrypto.a(libcrypto-lib-bio_sock.o): in function `BIO_gethostbyname': (.text+0x70): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_mb_x1_ce.o): in function `sha1_mb_ce_x1': /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_x1_ce.S:103:(.text+0xc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' ./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_mb_x2_ce.o): in function `sha1_mb_ce_x2': /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_x2_ce.S:118:(.text+0x4): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' ./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_aarch64_x1.o): in function `.block_loop': /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:248:(.text+0x50): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:253:(.text+0x3c4): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:258:(.text+0x78c): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_aarch64_x1.S:263:(.text+0xc44): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' ./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(sha1_mb_asimd_x4.o): in function `.block_loop': /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0xdc): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0x56c): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0xa74): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' /home/waldo/demo/third-party/spdk/isa-l-crypto/sha1_mb/aarch64/sha1_mb_asimd_x4.S:145:(.text+0x106c): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata.cst16' ./third-party/spdk/isa-l-crypto/.libs//libisal_crypto.a(mh_sha1_block_sve.o): in function `mh_sha1_block_sve': /home/waldo/demo/third-party/spdk/isa-l-crypto/mh_sha1/aarch64/mh_sha1_block_sve.S:258:(.text+0x3c): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status ```
waldoweng commented 2025-04-25 03:34:13 -05:00 (Migrated from github.com)

just talk with chatGPT and it advice me to Use ADRP + ADD instead of ADR, split the address load into a high/low pair:

adrp x0, .rodata.cst16
add  x0, x0, :lo12:.rodata.cst16

If that's OK (I hope one more instruction is not a big deal?), maybe I can help with a PR to fix this?

just talk with chatGPT and it advice me to Use ADRP + ADD instead of ADR, split the address load into a high/low pair: ```asm adrp x0, .rodata.cst16 add x0, x0, :lo12:.rodata.cst16 ``` If that's OK (I hope one more instruction is not a big deal?), maybe I can help with a PR to fix this?
mpiszczek commented 2025-11-07 08:27:24 -06:00 (Migrated from github.com)

Any progress on this issue?

Any progress on this issue?
pablodelara commented 2025-11-10 04:05:36 -06:00 (Migrated from github.com)

This should be fixed now, thanks!

This should be fixed now, thanks!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-intel/isa-l_crypto#152
No description provided.