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

SDL2 in Sniper cannot be used for shared objects #736

Open
Gelmo opened this issue Jan 10, 2025 · 4 comments
Open

SDL2 in Sniper cannot be used for shared objects #736

Gelmo opened this issue Jan 10, 2025 · 4 comments

Comments

@Gelmo
Copy link

Gelmo commented Jan 10, 2025

Your system information

  • Steam Runtime Version: Sniper
  • Distribution: Using the image registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest

Please describe your issue in as much detail as possible:

Looks like SDL2 provided in the Sniper image was not built with Position-Independent Code (PIC), and is therefore unable to be used to build shared objects:

2025-01-10T01:13:43.5404082Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_dynapi.o): relocation R_X86_64_32S against hidden symbol `SDL_SetError_REAL' can not be used when making a shared object
2025-01-10T01:13:43.5405909Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_events.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5407709Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_gesture.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5409470Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_keyboard.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5411220Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_mouse.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5412919Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_quit.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5414662Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_touch.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5416978Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_windowevents.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5418843Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_rwops.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5420661Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_haptic.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5422444Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5424240Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_gamecontroller.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5529246Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_joystick.o): relocation R_X86_64_32 against hidden symbol `SDL_HIDAPI_JoystickDriver' can not be used when making a shared object
2025-01-10T01:13:43.5531263Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_steam_virtual_gamepad.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5533196Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(controller_type.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5535038Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_url.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5536783Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_power.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5547340Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_render.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5549106Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_yuv_sw.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5551337Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_render_gl.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5553232Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_shaders_gl.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5564096Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_render_gles2.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5565969Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_shaders_gles2.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5567825Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_render_sw.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5578188Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_triangle.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5580010Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sensor.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5581775Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_iconv.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5583847Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_malloc.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5595893Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_string.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5597649Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_thread.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5599517Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_timer.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5601311Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_bmp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5603173Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_clipboard.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5605016Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_fillrect.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5606840Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_pixels.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5617143Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_rect.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5618940Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_stretch.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5620791Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_surface.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5631532Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_video.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5633628Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_yuv.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5645079Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(yuv_rgb_sse.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5646884Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(yuv_rgb_std.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5648664Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_locale.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5650214Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_nullvideo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5651767Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_offscreenvideo.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5653340Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_offscreenwindow.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5654895Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sysloadso.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5666518Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11video.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5668358Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11vulkan.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5670233Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11window.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5672066Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11xfixes.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5673916Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11xinput2.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5715920Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5717854Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandvulkan.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5719973Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): relocation R_X86_64_32 against hidden symbol `wl_region_interface' can not be used when making a shared object
2025-01-10T01:13:43.5721852Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_dbus.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5723728Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapijoystick.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5725600Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_systhread.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5727389Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_syssem.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5729550Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sysmutex.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5731446Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_syscond.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5733214Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_systls.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5735023Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sysurl.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5736886Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_syslocale.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5738822Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sysjoystick.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5740713Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_syshaptic.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5742912Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_syspower.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5744830Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sysfilesystem.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5746693Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_systimer.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5748500Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_udev.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5750311Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_evdev.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5752093Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_evdev_kbd.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5753907Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_threadprio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5755752Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_sandbox.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5757669Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_virtualjoystick.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5759669Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5761422Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_assert.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5763212Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_error.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5764998Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_guid.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5767112Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hints.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5768955Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_log.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5770677Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_audio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5772491Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_audiocvt.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5774377Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_audiotypecvt.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5776233Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_mixer.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5777979Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_wave.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5780129Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_cpuinfo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5781993Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_scancode_tables.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5783919Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blendfillrect.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5785766Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blendline.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5787637Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blendpoint.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5789527Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_drawline.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5791419Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_drawpoint.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5793278Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_RLEaccel.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5795077Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blit.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5796863Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blit_0.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5798640Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blit_1.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5800603Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blit_A.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5802390Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blit_N.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5804456Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_blit_slow.o): relocation R_X86_64_32S against hidden symbol `SDL_expand_byte' can not be used when making a shared object
2025-01-10T01:13:43.5806222Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_egl.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5808069Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_vulkan_utils.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5810013Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_nullframebuffer.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5811977Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_offscreenframebuffer.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5813938Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_diskaudio.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5815728Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_dummyaudio.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5817727Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_dspaudio.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5819574Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_alsa_audio.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5821426Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_pipewire.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5823311Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_pulseaudio.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5825223Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11clipboard.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5827158Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11dyn.o): relocation R_X86_64_32S against symbol `XAllocSizeHints' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5829066Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11events.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5830994Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11framebuffer.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5832855Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11keyboard.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5834719Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11messagebox.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5836591Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11modes.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5838380Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11mouse.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5840701Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11opengl.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5842636Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_x11opengles.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5844482Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(edid-parse.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5846381Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandclipboard.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5848394Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylanddatamanager.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5982052Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylanddyn.o): relocation R_X86_64_32S against symbol `wl_proxy_marshal' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.5995652Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandevents.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6008536Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandkeyboard.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6017467Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandmessagebox.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6019383Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandmouse.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6021219Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandopengles.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6022784Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_waylandtouch.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6046669Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_ime.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6048272Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_ibus.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6049999Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_fcitx.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6051686Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_combined.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6053420Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_gamecube.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6055039Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_luna.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6056783Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_ps3.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6058461Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_ps4.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6060218Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_ps5.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6061784Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_rumble.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6063528Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_shield.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6065058Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_stadia.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6066717Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_steam.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6068550Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_steamdeck.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6070399Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_switch.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6072622Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_wii.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6074401Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_xbox360.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6076252Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_xbox360w.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6078013Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_hidapi_xboxone.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6080699Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_dataqueue.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6082616Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_audiodev.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6084529Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(SDL_keysym_to_scancode.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
2025-01-10T01:13:43.6086370Z /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSDL2.a(imKStoUCS.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

Is Valve able to provide SDL2 built with -fPIC? We would need to significantly restructure things to be able to link statically, so in the meantime we are building and providing SDL2 with our game for Linux users.

Gelmo pushed a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
pollend pushed a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 11, 2025
https://gitlab.steamos.cloud/steamrt/sniper/sdk/-/blob/steamrt/sniper/README.md

https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md

- Revert to clang-11
- Don't install system libs that won't be provided to users in the SLR
- Use system libs where possible
- Update Dockerfile to match CI pipeline
- [temp] Manually find Ogg/Vorbis when using system libs
- revert once resolved: ValveSoftware/steam-runtime#735
- fix rpath for build
- issue using sdl from steam-runtime: ValveSoftware/steam-runtime#736
- set fpic for all targets
- Don't use system ogg/vorbis ValveSoftware/steam-runtime#735

Signed-off-by: Michael Pollind <[email protected]>
Co-authored-by: Gelmo <[email protected]>
Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 11, 2025
https://gitlab.steamos.cloud/steamrt/sniper/sdk/-/blob/steamrt/sniper/README.md

https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md

- Revert to clang-11
- Don't install system libs that won't be provided to users in the SLR
- Use system libs where possible
- Update Dockerfile to match CI pipeline
- [temp] Manually find Ogg/Vorbis when using system libs
- revert once resolved: ValveSoftware/steam-runtime#735
- fix rpath for build
- issue using sdl from steam-runtime: ValveSoftware/steam-runtime#736
- set fpic for all targets
- Don't use system ogg/vorbis ValveSoftware/steam-runtime#735

Signed-off-by: Michael Pollind <[email protected]>
Co-authored-by: Gelmo <[email protected]>
@smcv
Copy link
Contributor

smcv commented Jan 13, 2025

I don't think we normally recommend linking to SDL statically: SDL frequently gets updated with e.g. support for newer game controllers, and it's harder to make that take effect if an arbitrary version of SDL has been statically linked into a game.

Linking to SDL statically also doesn't actually link fully statically, because some of SDL's dependencies (notably libasound, the ALSA client library) are only available as shared libraries, and not as static; so you will end up with shared library dependencies whatever happens, just a layer or more down the stack.

I had thought that the toolchains in Debian 11 (and therefore sniper) normally create position-independent executables, which isn't possible if static libraries aren't PIC, but it seems that isn't the case.

@smcv
Copy link
Contributor

smcv commented Jan 13, 2025

We would need to significantly restructure things to be able to link statically

I'm confused by this; do you mean "to be able to link [to SDL] dynamically", rather than "... statically"?

Or do you mean you tried to link your main executable as purely static? (That's generally impossible for games, because user-space graphics drivers like Vulkan and (E)GL rely on being able to load GPU-specific drivers dynamically.)

so in the meantime we are building and providing SDL2 with our game for Linux users

For a game that runs in the sniper container runtime as provided by Steam, it is never necessary to provide your own SDL2: if you dynamically link to SDL2, sniper guarantees to provide a relatively up-to-date version of SDL2 (it's rarely more than a couple of months behind upstream). For example the copy of Endless Sky distributed via Steam relies on this.

If you're using the sniper SDK as a convenient "old-ish" environment to build binaries that will be run somewhere else (outside Steam), I'd still recommend linking SDL2 dynamically, and either bundling a suitable SDL shared library (which your users can easily remove to use their system copy if they know that the system copy is newer/better) or documenting a minimum required system version of SDL2. If you link your executable or dependent library with something like -Wl,-rpath,'${ORIGIN}' then it will look for shared libraries in the same directory.

@pollend
Copy link

pollend commented Jan 17, 2025

soo, i guess it's unable to link the shared sdl2 library that is bundled with the sniper docker container.

@smcv
Copy link
Contributor

smcv commented Jan 19, 2025

soo, i guess it's unable to link the shared sdl2 library that is bundled with the sniper docker container.

I don't understand this, please could you elaborate?

You can link a game or library to the SDL2 shared/dynamic library provided by the sniper SDK. That's what we would recommend. Endless Sky and Team Fortress 2 are examples of games that do this successfully.

But the compiler error messages in your initial report indicate that you are linking your own shared/dynamic library to the SDL2 static library provided by the sniper SDK. That won't work. Is that what you meant to do?

I think it would help if you describe:

  • steps to reproduce (what you are doing)
  • expected result (what you thought would happen)

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

3 participants