Skip to content

relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC #209

Description

@ApsarasX

I'm linking some object files(compiled with -fPIC) into a shared library using wasm-ld and wasi-sdk, but I get errors like the following

/opt/emsdk/upstream/bin/wasm-ld --shared -L/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi -lc --no-entry --allow-undefined --export=eval --export=__wasm_call_ctors --lto-O2 -o build/quickjs.wasm .obj/wasm.o .obj/cutils.o .obj/libbf.o .obj/libregexp.o .obj/libunicode.o .obj/quickjs.o
wasm-ld: warning: creating shared libraries, with -shared, is not yet stable
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(close.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(writev.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(writev.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(isatty.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(__stdout_write.o): relocation R_WASM_TABLE_INDEX_SLEB cannot be used against symbol __stdio_write; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(lseek.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(strerror.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol __libc; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(strerror.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol __libc; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(strerror.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol __libc; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(strerror.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol __libc; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(strerror.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol errmsgidx; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(strerror.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol errmsgstr; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(wcrtomb.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol __libc; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(wcrtomb.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(wcrtomb.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol errno; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(vfprintf.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol states; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(vfprintf.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(vfprintf.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(vfprintf.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol xdigits; recompile with -fPIC
wasm-ld: error: /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(vfprintf.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol .L.str; recompile with -fPIC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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