On Fri, 2025-07-25 at 20:33 +0300, gnu-bug...@mekboy.ru wrote: > > I believe this is just a test problem. > > > > When the test suite builds the shared libraries it uses the same > > compiler and compiler flags that were used to build "make". If you > > have added something like -static to the compiler flags used when > > building GNU Make, then when the test tries to build the .so it > > won't work well. > > export CC=musl-gcc CFLAGS="-Os" LDFLAGS="-static" > ./configure --prefix=/usr --without-guile > ./build.sh > ./make -k check > > From what I can see in ./configure --help output there's no way to > give build.sh any directions in regards to static/dynamic linking, > right?
If what you mean is, can you configure without static then add static in the build.sh invocation, then currently no. > The goal is to get a statically linked binary, if building .so files > along the way is unavoidable that's fine, I'll just delete them > afterwards. There are no shared libraries built, as part of building make itself. > But I would prefer to have a clean make check run. I think Dmitry is correct. If you want to keep the dynamic load facility of GNU Make, then you can't build it with the -static flag. The problem is that while GNU Make doesn't create any .so files, the make binary itself does export symbols: it has to do that otherwise the loadable modules that it dlopen()'s can't call any of the exported loadable module API functions, which makes them useless. If you compile/link statically, then none of those symbols are exported of course. It looks like you can do EITHER: * Don't use -static when building GNU Make, OR * Add the --disable-load option to the ./configure command line