Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relocation overflow in R_AARCH64_ADR_PREL_LO21 #152

Open
tkekan opened this issue Oct 28, 2024 · 3 comments
Open

relocation overflow in R_AARCH64_ADR_PREL_LO21 #152

tkekan opened this issue Oct 28, 2024 · 3 comments

Comments

@tkekan
Copy link

tkekan commented Oct 28, 2024

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
Copy link
Contributor

chenxuqiang commented Nov 7, 2024

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

@tkekan
Copy link
Author

tkekan commented Nov 12, 2024

@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

@tkekan
Copy link
Author

tkekan commented Nov 19, 2024

@chenxuqiang Where you able to repro this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants