Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 86C0D2235F4 for <~alpine/users@lists.alpinelinux.org>; Fri, 6 Feb 2026 22:09:47 +0000 (UTC) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-59dd22b9895so3531496e87.0 for <~alpine/users@lists.alpinelinux.org>; Fri, 06 Feb 2026 14:09:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770415785; cv=none; d=google.com; s=arc-20240605; b=edgJkHbw9XN9JzTY4m0GMB7yXZ6y+2Rdrpg/csHxKO3m1uXentOKHVOYarodcnMICE jjdlXFxBb9iS+EFEJVrhKY0hINlO9md+bXFApVibJUhFHvSormOLUkhHRnNXn3VewQFe zx5ZSX+09PAFvxtM4/hwLpTlhgi3NCCgwYdMgX/dd/6n39Xhbpy58O0gvIrGd1XIzy3N Jm7a2f/tR9P6rKSuB/Eh5QHR8Bn5MUj4tC8DKEgWPhz3kbOrYqgJRw/kjg2nY004dg+u YPdu17NyoEOkM8oi3A2B1uaYi8J2oIQpxVS5fjFV9A20nIVGDmXgZ9QgcWItHz2XSDG8 xb/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:dkim-signature; bh=bcKKFCdbweViyxMwwAGKN2zrOlQbX9ohLrW2JbvKg4s=; fh=09n9S7/NlgE/yzAQxerkyFVC0oL+bXXd4IVF2mtyglQ=; b=aWhmyjYejPt78oUiukwHOAF+NfilTyxveHPptPBdaCOu/evjEK3z/twlbBiVAv2GP1 Lge2KV7f45QweIV3AFLZi9tef11VNIFd1nYXC2zQH4SeT6oMgjOmFJWq5jeSQbgSi7WI sKJJxW49HDIQRSd59Si2SOXZSxQ7EEzEq7ZIXt0gYNTKWPkd/fZlBVY7aaFi8Jb29Tq5 y7qS4WxMzjZBubFhcH9JaOT8jn66yDYR9h4KXrlpA79PR+ndEz6AgwNQF2iCIwQ8xyrs LpZx+rD4hsJD2Ka05bDB0qpowQTlsEyL9XYfHyfNoJbnwQIjA34b3i5zhoT3vyEYK9Yk 9TuA==; darn=lists.alpinelinux.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770415785; x=1771020585; darn=lists.alpinelinux.org; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bcKKFCdbweViyxMwwAGKN2zrOlQbX9ohLrW2JbvKg4s=; b=I/Ywc61dYLJgl06+Vwyp3iWbiY0XW70k6+I+weQ+Lx6eGDaeCa1eoyTYRgoDfjzDfO teBQAT2AyNdC0yfcI24WSAoxTxtoR6OsqAtgQMMg/kDeD1UjEJYNfEqmLUrmvdJvpJYR 8vpHhbRo0JcSRgG8fQHCoKqflC9zNSFxkSeSJvz0R14lMGWZngwPqs1np2bq9oyDwTfI T42MS52vmGE5xLcnqbU8LmwyJ1PrlN4uhwPqm8UVeAQDwPCjrwVOoM0mtUS/b4f43siH eTQvaMbVzTE98txaRdJMPZhCrNf1XYY8J9DnmCWb3FBmeo38fP+vdDsi5H1y8RUydFHn r9vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770415785; x=1771020585; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bcKKFCdbweViyxMwwAGKN2zrOlQbX9ohLrW2JbvKg4s=; b=YiYvO+xqD8f+1o/mQsMX8tAoEy9ef5LManZXlzPx71tbpTMs25dHFD54hgZkP3kzj0 nRpCLaXSJsVmDYU6hxNYcDee/U1PtC7n90vgk+vmmQ0xh6EHQb+TATb2HEd/KHSHNCiy EUT1OYUTEbflGZc6c1z3lAcA3ZoT3sSEdTYQ7afcfkXPhKdDFdP8ZD5kT2C4XvheioeH eiC/1Aq0Yd56YCXouF4IVPLoMHk80KY4g5c0rmzYnD1Sv6RQU/FqoFttJxf/cLDfFt/0 rmMaEf5jpVzLZBZeVTkY4PQdGqqEpd6NIE0BojRZsZvS3wwOQQ9QkZIcro52VOlnvVvn QQuw== X-Gm-Message-State: AOJu0YySLua6FXdLFVZX8g+Jlay9EVrvgX9dmzWmMZJiNbaZW9bMNLpW nw+oFdcFO4s2Yu4IEXjQaW4zFonncQKges2m/LPqHFtIKM/R0CX9UO8zEo8AizBwhryNc6vTpE8 wR+5+u9sbfOXXDspsnhqwPBYAQF/uf2E= X-Gm-Gg: AZuq6aLi/KFLM9Jx6bh/a7dVT+v8YPtD3rZDgO4NRWdTM3vRPdP6bqvnyYx2cGFw6nr y4uwI94vpL2GX0txOH7dW5WZkd+Jbtyzl0WBOOEaXHzojd0o01SpqvP7qo1+yKia+Km3lWg+DSq dv7eKh8ViyII0Xyb9/z7c4hbVeL2/eF0jl/N2UqAfOVzZw6tBHu3P6HCs7CokL8pBu0r0baisSA yDE0c4eBJfVSep4v1ELxbuVI6kVrryq7lxW5H5bSJo5SumLhXo3z4OanJqOdEnQ+SAqsZFt5FxW ioRzqZYWwyEQkIfXulp9LcH+JBzMN6NhNZTFNQAWO8necrI7OQJU7yL8PfLC0ddhHg== X-Received: by 2002:a05:6512:3a8a:b0:59e:3288:6b06 with SMTP id 2adb3069b0e04-59e44bd7bf5mr1384892e87.14.1770415784693; Fri, 06 Feb 2026 14:09:44 -0800 (PST) MIME-Version: 1.0 References: <6ee42c20-2936-4655-ba61-608902f5e837@cossu.cc> In-Reply-To: <6ee42c20-2936-4655-ba61-608902f5e837@cossu.cc> Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Fri, 6 Feb 2026 17:09:07 -0500 X-Gm-Features: AZwV_QiJ-1SxX6x4qNc4iIr__1sJJY3wBmGM1VeEOgUjUWY2Bo3L631PIE9jMDs Message-ID: Subject: Re: Linker not finding library To: Stefano Cossu Cc: ~alpine/users@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="000000000000f39176064a2f0b54" --000000000000f39176064a2f0b54 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 6, 2026 at 4:35=E2=80=AFPM Stefano Cossu wro= te: > Hello there, > I am running into a basic linker problem in Alpine, where the linker > cannot find libraries outside of /usr/lib. > > Running in a basic docker container: > > > $ docker run -it alpine:latest sh > / # apk add lua5.4-dev lua5.4-linotify > (1/8) Installing lua5.4-libs (5.4.8-r0) > (2/8) Installing ncurses-terminfo-base (6.5_p20251123-r0) > (3/8) Installing libncursesw (6.5_p20251123-r0) > (4/8) Installing readline (8.3.1-r0) > (5/8) Installing lua5.4 (5.4.8-r0) > (6/8) Installing pkgconf (2.5.1-r0) > (7/8) Installing lua5.4-dev (5.4.8-r0) > (8/8) Installing lua5.4-linotify (0.5-r2) > Executing busybox-1.37.0-r30.trigger > OK: 10.8 MiB in 24 packages > / # export LD_LIBRARY_PATH=3D/usr/local/lib:/usr/lib > / # ldd /usr/lib/lua/5.4/inotify.so > /lib/ld-musl-x86_64.so.1 (0x7ee2fa7d2000) > libc.musl-x86_64.so.1 =3D> /lib/ld-musl-x86_64.so.1 (0x7ee2fa7d20= 00) > Error relocating /usr/lib/lua/5.4/inotify.so: lua_touserdata: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_getfield: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_gettop: symbol not foun= d > Error relocating /usr/lib/lua/5.4/inotify.so: luaL_checklstring: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_setfield: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_newuserdatauv: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushvalue: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushnil: symbol not fou= nd > Error relocating /usr/lib/lua/5.4/inotify.so: luaL_error: symbol not foun= d > Error relocating /usr/lib/lua/5.4/inotify.so: lua_settop: symbol not foun= d > Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushcclosure: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_type: symbol not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushboolean: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_setmetatable: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_rawseti: symbol not fou= nd > Error relocating /usr/lib/lua/5.4/inotify.so: luaL_newmetatable: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushstring: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: luaL_checkinteger: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: luaL_checkudata: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: luaL_setfuncs: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_toboolean: symbol not > found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_createtable: symbol > not found > Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushinteger: symbol > not found > / # > > All the above symbols are in /usr/lib/liblua-5.4.so.0, e.g. > > / # readelf -s /usr/lib/liblua-5.4.so.0 | grep lua_touserdata > 238: 0000000000005a70 13 FUNC GLOBAL DEFAULT 9 lua_touserdat= a > > but even if I add /usr/lib to LD_LIBRARY_PATH, the symbols are not found. > > This is not specific to Lua or to the linotify library, I tried with > other non-system libraries as well. > > Is there something else that I need set up? I seem to recall Musl rejects all library paths if there is one bad library path, even via RPATH and RUNPATH. Note that this is different behavior from GNU's link loader. Also see < https://www.openwall.com/lists/musl/2020/05/21/2> and < https://www.openwall.com/lists/musl/2021/11/17/1>. Can you dump the RPATH and RUNPATH and verify each one of them is valid? Jeff --000000000000f39176064a2f0b54 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On = Fri, Feb 6, 2026 at 4:35=E2=80=AFPM Stefano Cossu <stefano@cossu.cc> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Hello there,
I am running into a basic linker problem in Alpine, where the linker
cannot find libraries outside of /usr/lib.

Running in a basic docker container:


$ docker run -it alpine:latest sh
/ # apk add lua5.4-dev lua5.4-linotify
(1/8) Installing lua5.4-libs (5.4.8-r0)
(2/8) Installing ncurses-terminfo-base (6.5_p20251123-r0)
(3/8) Installing libncursesw (6.5_p20251123-r0)
(4/8) Installing readline (8.3.1-r0)
(5/8) Installing lua5.4 (5.4.8-r0)
(6/8) Installing pkgconf (2.5.1-r0)
(7/8) Installing lua5.4-dev (5.4.8-r0)
(8/8) Installing lua5.4-linotify (0.5-r2)
Executing busybox-1.37.0-r30.trigger
OK: 10.8 MiB in 24 packages
/ # export LD_LIBRARY_PATH=3D/usr/local/lib:/usr/lib
/ # ldd /usr/lib/lua/5.4/inotify.so
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /lib/ld-musl-x86_64.so.1 (0x7ee2fa7d2000)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 libc.musl-x86_64.so.1 =3D> /lib/ld-musl-x86_= 64.so.1 (0x7ee2fa7d2000)
Error relocating /usr/lib/lua/5.4/inotify.so: lua_touserdata: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_getfield: symbol not foun= d
Error relocating /usr/lib/lua/5.4/inotify.so: lua_gettop: symbol not found<= br> Error relocating /usr/lib/lua/5.4/inotify.so: luaL_checklstring: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_setfield: symbol not foun= d
Error relocating /usr/lib/lua/5.4/inotify.so: lua_newuserdatauv: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushvalue: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushnil: symbol not found=
Error relocating /usr/lib/lua/5.4/inotify.so: luaL_error: symbol not found<= br> Error relocating /usr/lib/lua/5.4/inotify.so: lua_settop: symbol not found<= br> Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushcclosure: symbol
not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_type: symbol not found Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushboolean: symbol
not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_setmetatable: symbol
not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_rawseti: symbol not found=
Error relocating /usr/lib/lua/5.4/inotify.so: luaL_newmetatable: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushstring: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: luaL_checkinteger: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: luaL_checkudata: symbol
not found
Error relocating /usr/lib/lua/5.4/inotify.so: luaL_setfuncs: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_toboolean: symbol not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_createtable: symbol
not found
Error relocating /usr/lib/lua/5.4/inotify.so: lua_pushinteger: symbol
not found
/ #

All the above symbols are in /usr/lib/liblua-5.4.so.0, e.g.

/ # readelf -s /usr/lib/liblua-5.4.so.0 | grep lua_touserdata
=C2=A0 =C2=A0 238: 0000000000005a70=C2=A0 =C2=A0 13 FUNC=C2=A0 =C2=A0 GLOBA= L DEFAULT=C2=A0 =C2=A0 9 lua_touserdata

but even if I add /usr/lib to LD_LIBRARY_PATH, the symbols are not found.
This is not specific to Lua or to the linotify library, I tried with
other non-system libraries as well.

Is there something else that I need set up?

I seem to recall Musl rejects all library paths if there is one bad librar= y path, even via RPATH and RUNPATH.=C2=A0 Note that this is different behav= ior from GNU's link loader. Also see <https://www.openwall.com/l= ists/musl/2020/05/21/2> and <https://www.openwall.com/lists/musl/2021/11/17/1>.


--000000000000f39176064a2f0b54--