Skip to content

rust-lld: error: undefined symbol: memchr when compiling with nightly-aarch64-unknown-linux-musl #91

@yogh333

Description

@yogh333

Hello,

I have an undefined symbol error when trying to compile qrcodegen.c with toolchain nightly-aarch64-unknown-linux-musl:

 rust-lld: error: undefined symbol: memchr
          >>> referenced by qrcodegen.c:964 (/apps/ledger-device-rust-sdk/target/stax/debug/build/ledger_secure_sdk_sys-d4f9f369bf0ebeb9/out/ledger-secure-sdk/qrcode/src/qrcodegen.c:964)
          >>>               8ea603dc3489e912-qrcodegen.o:(qrcodegen_isAlphanumeric) in archive /apps/ledger-device-rust-sdk/target/stax/debug/deps/libledger_secure_sdk_sys-4bf5710c68e34674.rlib
          >>> referenced by qrcodegen.c:1093 (/apps/ledger-device-rust-sdk/target/stax/debug/build/ledger_secure_sdk_sys-d4f9f369bf0ebeb9/out/ledger-secure-sdk/qrcode/src/qrcodegen.c:1093)
          >>>               8ea603dc3489e912-qrcodegen.o:(qrcodegen_makeAlphanumeric) in archive /apps/ledger-device-rust-sdk/target/stax/debug/deps/libledger_secure_sdk_sys-4bf5710c68e34674.rlib

part of qrcodegen source code raising the error is below:

// Public function - see documentation comment in header file.
bool qrcodegen_isAlphanumeric(const char *text)
{
    assert(text != NULL);
    for (; *text != '\0'; text++) {
        if (strchr(ALPHANUMERIC_CHARSET, *text) == NULL) {
            return false;
        }
    }
    return true;
}

For your information, I am using the following unstable feature in my .cargo/config.toml:

[unstable]
build-std = ["core", "alloc"]
build-std-features = ["compiler-builtins-mem"]

I do not know if I provide enough information to get help, please tell me.
Thanks for your support 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions