-
Notifications
You must be signed in to change notification settings - Fork 509
Fix building Ubuntu shared libraries #4988
Comments
Made another attempt, this time using the ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against '__readonlydata_S_P_TypeLoader_System_Reflection_Runtime_General_QHandle____GetFieldHelper' which may
overflow at runtime; recompile with -fPIC
ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against '_ZTV61S_P_CoreLib_System_Resources_MissingManifestResourceException' which may overflow at runtime;
recompile with -fPIC
ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against 'Internal_CompilerGenerated__Module___InvokeRetOI<System___Canon__Int32>' which may overflow at runti
me; recompile with -fPIC
ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against 'S_P_TypeLoader_System_Collections_Generic_ArrayBuilder_1<System___Canon>____GetFieldHelper' which ma
y overflow at runtime; recompile with -fPIC
ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against '_ZTV74Boxed_S_P_Reflection_Metadata_Internal_Metadata_NativeFormat_AssemblyFlags' which may overflow
at runtime; recompile with -fPIC
ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against 'S_P_TypeLoader_System_Reflection_Runtime_General_QHandle____GetFieldHelper' which may overflow at ru
ntime; recompile with -fPIC
ld.gold: error: obj/Debug/netstandard2.0/native/cslib.o: requires dynamic R_X86_64_PC32 reloc against '_lsda0S_P_TypeLoader_System_Reflection_Runtime_General_QHandle____GetFieldHelper' which may overflow
at runtime; recompile with -fPIC
ld.gold: error: /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libRuntime.a(AllocFast.S.o): requires dynamic R_X86_64_PC32 reloc against 'RhExceptionHandling_FailedAllocation' which may overflow at runti
me; recompile with -fPIC
ld.gold: error: /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libRuntime.a(ExceptionHandling.S.o): requires dynamic R_X86_64_PC32 reloc against 'RhThrowHwEx' which may overflow at runtime; recompile wit
h -fPIC
ld.gold: error: /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libRuntime.a(StubDispatch.S.o): requires dynamic R_X86_64_PC32 reloc against 'RhpCidResolve' which may overflow at runtime; recompile with -
fPIC |
Full clang-3.9 "obj/Debug/netstandard2.0/native/cslib.o" -o "bin/Debug/netstandard2.0/native/cslib.so" -exported_symbols_list "obj/Debug/netstandard2.0/native/cslib.export
s" /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libbootstrapperdll.a /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libRuntime.a /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libSystem.Private.CoreLib
.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Globalization.Native.a /root/Workspace/corert/bin/Linux.x64.Debu
g/framework/System.IO.Compression.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Net.Http.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Net.Security.Native.a
/root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -pthread -lstdc++ -ldl -lm -lcurl -lz -lgssapi_krb5 -lrt -shared Resulting "/usr/bin/ld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -shared -o bin/Debug/netstandard2.0/native/cslib.so /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crti.o /usr/
bin/../lib/gcc/x86_64-linux-gnu/5.4.0/crtbeginS.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib
64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../.. -L/usr/lib/llvm-3.9/bin/../lib -L/lib -L/usr/lib obj/Debug/netstandard2.0/native/cslib.o /root/Workspace/corert/bin/Li
nux.x64.Debug/sdk/libbootstrapperdll.a /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libRuntime.a /root/Workspace/corert/bin/Linux.x64.Debug/sdk/libSystem.Private.CoreLib.Native.a /root/Workspace/corert
/bin/Linux.x64.Debug/framework/System.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Globalization.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.IO.Compressio
n.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Net.Http.Native.a /root/Workspace/corert/bin/Linux.x64.Debug/framework/System.Net.Security.Native.a /root/Workspace/corert/bin/Linux
.x64.Debug/framework/System.Security.Cryptography.Native.OpenSsl.a -rpath "\$ORIGIN" -lstdc++ -ldl -lm -lcurl -lz -lgssapi_krb5 -lrt -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-need
ed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/crtendS.o /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crtn.o |
May I ask if there are any updates on this? |
when this is going to be fixed? it is pretty important platform to support i tried the sample of native library to build as a shared library and hit below errors clang : warning : argument unused during compilation: '-exported_symbols_list obj/release/netstandard2.0/linux-x64/native/NativeLibrary.exports' /usr/bin/ld: obj/release/netstandard2.0/linux-x64/native/NativeLibrary.o: relocation R_X86_64_PC32 against symbol `__readonlydata_S_P_TypeLoader_System_Reflection_Runtime_General_QHandle____GetFieldHelper' can not be used when making a shared object; recompile with -fPIC |
There's a work in progress pull request in #6847, but I'll need someone to volunteer to finish it up. |
Currently building shared libraries (.so) on Ubuntu throws the below error:
Parent issue: #1285
The text was updated successfully, but these errors were encountered: