Return to Level1Techs.com

AUR package fails to build with ld.lld: error

I’m attempting to install the looking glass client from the AUR, this is the looking-glass package, but the looking-glass-git package also fails with a similar error. Anyone have any idea what could be causing this?

Full output:

:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  looking-glass-2:B4-1

  1 looking-glass                    (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A
:: Deleting (1/1): /home/user/.cache/yay/looking-glass
:: (1/1) Downloaded PKGBUILD: looking-glass
:: (1/1) Parsing SRCINFO: looking-glass
  1 looking-glass                    (Build Files Exist)
==> PKGBUILDs to edit?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
==> Making package: looking-glass 2:B4-1 (Sat 27 Nov 2021 07:43:59 PM MST)
==> Retrieving sources...
  -> Downloading looking-glass-B4.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  517k  100  517k    0     0   331k      0  0:00:01  0:00:01 --:--:--  331k
==> Validating source files with sha512sums...
    looking-glass-B4.tar.gz ... Passed
==> Making package: looking-glass 2:B4-1 (Sat 27 Nov 2021 07:44:03 PM MST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found looking-glass-B4.tar.gz
==> Validating source files with sha512sums...
    looking-glass-B4.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting looking-glass-B4.tar.gz with bsdtar
==> Sources are ready.
==> Making package: looking-glass 2:B4-1 (Sat 27 Nov 2021 07:44:07 PM MST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
~/.cache/yay/looking-glass/src/looking-glass-B4/client ~/.cache/yay/looking-glass/src/looking-glass-B4
-- The C compiler identification is Clang 13.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE
-- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE - Success
-- GMP libs: /usr/lib/libgmp.so /usr/lib/libgmpxx.so
-- Found GMP: /usr/include  
-- BFD libs: /usr/lib/libbfd.so
-- Found BFD: /usr/lib/libbfd.so  
-- BFD libs: /usr/lib/libbfd.so
-- Found PkgConfig: /usr/bin/pkgconf (found version "1.8.0") 
-- Checking for modules 'spice-protocol;nettle;hogweed'
--   Found spice-protocol, version 0.14.3
--   Found nettle, version 3.7.3
--   Found hogweed, version 3.7.3
-- Checking for module 'wayland-client'
--   Found wayland-client, version 1.19.0
-- Checking for module 'wayland-protocols>=1.15'
--   Found wayland-protocols, version 1.24
-- Checking for modules 'x11;xi;xfixes;xscrnsaver;xinerama'
--   Found x11, version 1.7.2
--   Found xi, version 1.8
--   Found xfixes, version 6.0.0
--   Found xscrnsaver, version 1.2.3
--   Found xinerama, version 1.1.4
-- Checking for modules 'egl;gl'
--   Found egl, version 1.5
--   Found gl, version 1.2
-- Checking for module 'wayland-egl'
--   Found wayland-egl, version 18.1.0
-- Checking for module 'gl'
--   Found gl, version 1.2
-- Checking for modules 'freetype2;fontconfig'
--   Found freetype2, version 24.0.18
--   Found fontconfig, version 2.13.94
-- The following features have been enabled:

 * ENABLE_OPENGL, Legacy OpenGL renderer.
 * ENABLE_EGL, EGL renderer.
 * ENABLE_BACKTRACE, Backtrace support.
 * ENABLE_X11, X11 support.
 * ENABLE_WAYLAND, Wayland support.

-- The following features have been disabled:

 * ENABLE_ASAN, AddressSanitizer support.
 * ENABLE_UBSAN, UndefinedBehaviorSanitizer support.
 * ENABLE_SDL, SDL support.
 * ENABLE_LIBDECOR, libdecor support.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/.cache/yay/looking-glass/src/looking-glass-B4/client
[  1%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/debug.c.o
[  2%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/thread.c.o
[  4%] Building C object PureSpice/CMakeFiles/purespice.dir/src/queue.c.o
[  4%] Building C object LGMP/CMakeFiles/lgmp.dir/src/status.c.o
[  4%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/event.c.o
[  5%] Building C object LGMP/CMakeFiles/lgmp.dir/src/client.c.o
[  7%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/crash.c.o
[  7%] Building C object PureSpice/CMakeFiles/purespice.dir/src/spice.c.o
[  7%] Building C object PureSpice/CMakeFiles/purespice.dir/src/rsa.c.o
[  9%] Building C object LGMP/CMakeFiles/lgmp.dir/src/host.c.o
[ 10%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/time.c.o
[  9%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/ivshmem.c.o
[ 11%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/sysinfo.c.o
[ 12%] Linking C static library liblgmp.a
[ 13%] Linking C static library liblg_common_platform_code.a
[ 13%] Built target lgmp
[ 13%] Built target lg_common_platform_code
[ 14%] Building C object common/CMakeFiles/lg_common.dir/src/stringutils.c.o
[ 16%] Building C object common/CMakeFiles/lg_common.dir/src/option.c.o
[ 16%] Building C object common/CMakeFiles/lg_common.dir/src/stringlist.c.o
[ 17%] Building C object common/CMakeFiles/lg_common.dir/src/framebuffer.c.o
[ 17%] Building C object common/CMakeFiles/lg_common.dir/src/countedbuffer.c.o
[ 18%] Building C object common/CMakeFiles/lg_common.dir/src/KVMFR.c.o
[ 19%] Building C object common/CMakeFiles/lg_common.dir/src/runningavg.c.o
[ 20%] Linking C static library libpurespice.a
[ 20%] Built target purespice
[ 21%] Linking C static library liblg_common.a
[ 21%] Built target lg_common
[ 22%] Generating ../../wayland/wayland-idle-inhibit-unstable-v1-client-protocol.h
[ 23%] Generating ../../wayland/wayland-xdg-shell-client-protocol.h
[ 24%] Generating ../../wayland/wayland-keyboard-shortcuts-inhibit-unstable-v1-client-protocol.c
[ 24%] Generating ../../wayland/wayland-pointer-constraints-unstable-v1-client-protocol.h
[ 25%] Generating ../../wayland/wayland-keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h
[ 25%] Generating ../../wayland/wayland-pointer-constraints-unstable-v1-client-protocol.c
[ 27%] Generating ../../wayland/wayland-relative-pointer-unstable-v1-client-protocol.h
[ 27%] Generating ../../wayland/wayland-xdg-decoration-unstable-v1-client-protocol.c
[ 28%] Generating ../../wayland/wayland-idle-inhibit-unstable-v1-client-protocol.c
[ 29%] Generating ../../wayland/wayland-relative-pointer-unstable-v1-client-protocol.c
[ 30%] Generating ../../wayland/wayland-xdg-decoration-unstable-v1-client-protocol.h
[ 31%] Generating ../../wayland/wayland-xdg-shell-client-protocol.c
[ 32%] Building C object fonts/freetype/CMakeFiles/font_freetype.dir/src/freetype.c.o
[ 33%] Building C object displayservers/X11/CMakeFiles/displayserver_X11.dir/x11.c.o
[ 34%] Building C object displayservers/X11/CMakeFiles/displayserver_X11.dir/clipboard.c.o
[ 35%] Building C object displayservers/X11/CMakeFiles/displayserver_X11.dir/atoms.c.o
[ 36%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/output.c.o
[ 37%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/gl.c.o
[ 39%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/cursor.c.o
[ 39%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/poll.c.o
[ 40%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/clipboard.c.o
[ 40%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/idle.c.o
[ 41%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/wayland.c.o
[ 42%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/input.c.o
[ 43%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/registry.c.o
[ 44%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/state.c.o
[ 46%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/__/__/wayland/wayland-xdg-decoration-unstable-v1-client-protocol.c.o
[ 46%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/__/__/wayland/wayland-xdg-shell-client-protocol.c.o
[ 46%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/shell_xdg.c.o
[ 47%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/window.c.o
[ 48%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/__/__/wayland/wayland-relative-pointer-unstable-v1-client-protocol.c.o
[ 49%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/__/__/wayland/wayland-keyboard-shortcuts-inhibit-unstable-v1-client-protocol.c.o
[ 50%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/__/__/wayland/wayland-pointer-constraints-unstable-v1-client-protocol.c.o
[ 51%] Building C object displayservers/Wayland/CMakeFiles/displayserver_Wayland.dir/__/__/wayland/wayland-idle-inhibit-unstable-v1-client-protocol.c.o
[ 51%] Linking C static library libfont_freetype.a
[ 51%] Built target font_freetype
[ 52%] Building C object fonts/CMakeFiles/fonts.dir/__/src/fonts.c.o
[ 53%] Linking C static library libfonts.a
[ 53%] Linking C static library libdisplayserver_Wayland.a
[ 53%] Built target fonts
[ 54%] Creating object from shader/desktop.vert
[ 55%] Creating object from shader/alert.vert
[ 57%] Creating object from shader/alert.frag
[ 57%] Creating object from shader/cursor.vert
[ 58%] Creating object from shader/fps_bg.frag
[ 59%] Creating object from shader/desktop_rgb.frag
[ 60%] Creating object from shader/splash_logo.vert
[ 60%] Creating object from shader/alert_bg.frag
[ 61%] Creating object from shader/cursor_rgb.frag
[ 63%] Creating #defines from /home/user/.cache/yay/looking-glass/src/looking-glass-B4/client/renderers/EGL/shader/desktop_rgb.frag
[ 63%] Creating object from shader/cursor_mono.frag
[ 63%] Creating object from shader/fps.vert
[ 64%] Creating object from shader/help.frag
[ 65%] Creating object from shader/fps.frag
[ 66%] Creating object from shader/help_bg.frag
[ 67%] Creating object from shader/splash_bg.frag
[ 69%] Creating object from shader/splash_logo.frag
[ 69%] Creating object from shader/splash_bg.vert
[ 70%] Creating object from shader/help.vert
[ 71%] Building C object renderers/OpenGL/CMakeFiles/renderer_OpenGL.dir/opengl.c.o
ld.lldld.lldld.lldld.lldld.lldld.lldld.lld: : : : : : : error: error: error: error: target emulation unknown: -m or at least one .o file requirederror: 
target emulation unknown: -m or at least one .o file required
error: target emulation unknown: -m or at least one .o file required
target emulation unknown: -m or at least one .o file requirederror: target emulation unknown: -m or at least one .o file required
target emulation unknown: -m or at least one .o file required
target emulation unknown: -m or at least one .o file required

ld.lld: error: target emulation unknown: -m or at least one .o file required
ld.lld: error: target emulation unknown: -m or at least one .o file required
ld.lld: error: target emulation unknown: -m or at least one .o file required
ld.lld: error: target emulation unknown: -m or at least one .o file required
[ 71%] Built target displayserver_Wayland
ld.lld: error: target emulation unknown: -m or at least one .o file requiredld.lld: error: 
target emulation unknown: -m or at least one .o file required
ld.lld: error: target emulation unknown: -m or at least one .o file required
ld.lld: error: target emulation unknown: -m or at least one .o file required
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:74: renderers/EGL/shader/desktop.vert.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:194: renderers/EGL/shader/splash_bg.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:202: renderers/EGL/shader/splash_logo.vert.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:170: renderers/EGL/shader/alert.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:130: renderers/EGL/shader/fps_bg.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:98: renderers/EGL/shader/cursor_rgb.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:178: renderers/EGL/shader/alert_bg.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:162: renderers/EGL/shader/alert.vert.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:154: renderers/EGL/shader/help_bg.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:90: renderers/EGL/shader/cursor.vert.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:114: renderers/EGL/shader/fps.vert.o] Error 1
ld.lld: error: target emulation unknown: -m or at least one .o file required
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:82: renderers/EGL/shader/desktop_rgb.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:146: renderers/EGL/shader/help.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:138: renderers/EGL/shader/help.vert.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:122: renderers/EGL/shader/fps.frag.o] Error 1
ld.lld: error: target emulation unknown: -m or at least one .o file required
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:106: renderers/EGL/shader/cursor_mono.frag.o] Error 1
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:186: renderers/EGL/shader/splash_bg.vert.o] Error 1
ld.lld: error: target emulation unknown: -m or at least one .o file required
make[2]: *** [renderers/EGL/CMakeFiles/renderer_EGL.dir/build.make:210: renderers/EGL/shader/splash_logo.frag.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:560: renderers/EGL/CMakeFiles/renderer_EGL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 72%] Linking C static library libdisplayserver_X11.a
[ 72%] Built target displayserver_X11
[ 73%] Linking C static library librenderer_OpenGL.a
[ 73%] Built target renderer_OpenGL
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: looking-glass

Don’t use packaged builds, we do not support them at this time. Follow the official installation guide at https://looking-glass.io/docs and use the package lists provided at https://looking-glass.io/wiki for your platform.

Any reason why you are using the LLVM toolchain? The LLVM linker (lld) is currently not supported on our builds and that’s what is causing your errors. You should use the default GCC toolchain. Make sure to also fix /etc/makepkg.conf and remove the clang/ldd modifications to get the AUR packages to build. They build just fine using a vanilla Arch.

Thanks for the responses, I didn’t realize I was using LLVM, I think I had some dumb symlink from gcc to something from LLVM that was causing it that I forgot about and was somehow working for everything until now. Reinstalling gcc fixed this.