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

error: relocation R_X86_64_TPOFF32 against hidden symbol `_ZN2v88internal18g_current_isolate_E' can not be used when making a shared object #1706

Open
mplemay opened this issue Feb 12, 2025 · 5 comments

Comments

@mplemay
Copy link

mplemay commented Feb 12, 2025

When upgrading to the latest version of the v8 create, I encounter the following error:

  = note: /usr/bin/ld: /tmp/rustcnxkAyd/libv8-fa1f4565c5216947.rlib(binding.o): relocation R_X86_64_TPOFF32 against hidden symbol `_ZN2v88internal18g_current_isolate_E' can not be used when making a shared object
          /usr/bin/ld: failed to set dynamic section sizes: bad value
          collect2: error: ld returned 1 exit status

despite the part of my code which references isolation being unchanged (see below)

        // let isolate_params = v8::CreateParams::default().heap_limits(0, 2000 * 1024 * 1024);
        let isolate = &mut v8::Isolate::new(Default::default());
        let handle_scope = &mut v8::HandleScope::new(isolate);
        let mut context = v8::Context::new(handle_scope, Default::default());
        let scope = &mut v8::ContextScope::new(handle_scope, context);

Do y'all have any pointers on how to debug/resolve this issue?

@zty012
Copy link

zty012 commented Feb 15, 2025

Downgrade v8 crate to 129.0.0

@piercefreeman
Copy link

@zty012 Do you have context on why this issue is present in 130.0.0 but not 129.0.0?

@bakjos
Copy link
Contributor

bakjos commented Feb 20, 2025

I have a similar issue when updating from 130.0.7 to 134.4.0, relocation R_X86_64_TPOFF32 against v8::internal::g_current_local_heap_ cannot be used with -shared, not sure if V8 changed the flags used to compile the library

@devsnek
Copy link
Member

devsnek commented Feb 20, 2025

It would be helpful to know more about how you are using this crate. Are you producing a shared library from rustc? What flags are you using? I haven't been able to trivially reproduce a non-pic binary.

@bakjos
Copy link
Contributor

bakjos commented Feb 20, 2025

For me it only happens while compiling to linux, in mac works well, these are the linking flags "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs" "-shared" "--target=x86_64-unknown-linux-gnu" "-no-canonical-prefixes" "-lm" "-fuse-ld=lld" "-Wl,--build-id=md5" "-Wl,--hash-style=gnu" "-Wl,-z,relro,-z,now" "-l:libc++.a" "-l:libc++abi.a"

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

5 participants