3 ms·
> This is how you did compile time assertions in C before C introduced _Static_assert. That's the biggest issue with autoconf... it tends to spend a lot of tim
by jcranmer 6y ago
> This is how you did compile time assertions in C before C introduced _Static_assert.
That's the biggest issue with autoconf... it tends to spend a lot of time basically asking the question "are you some weird Unix from 1997?" that no one actually cares about the answer to, because people don't take the time to curate their build systems.
At its core task of figuring out how to compile and install properly on a system, autotools can do a surprisingly bad job. One of its most frustrating habits is dropping flags from the linker invocation ("I don't know what -flto does, but I'll drop it from the linker even though the user explicitly told me to link with it because unknown flags tend to bad for the linker").
Yes, build systems are a complicated three-way tussle between the system, the developer, and the user, and we've done a very bad job as a community at finding good tools to mediate this tug-of-war.
- fefe23 6y agoYOU may not care about old crappy systems, but you'd be surprised how much cruft is still in use in large organisations. And I for one am glad GNU went through all the trouble to make their code work on non-standard environments, because it means that I can use GNU stuff to bootstrap a non-crufty userland on those systems. About the LTO stuff: Maybe you did it wrong? I just tried to reproduce your problem by downloading GNU coreutils and running configure like this: $ LDFLAGS=-flto CFLAGS="-Os -flto" ./configure it definitely passes -flto to the compiler. I can't get to the linking stage because binutils is missing a plugin. Probably something wrong with my gcc setup. But autoconf is not removing -flto. BTW: About non-standard environments: Go ask among your friends for people who do embedded systems development, and let them show you their environment. You'd be surprised.
- jcranmer 6y agoSupport for -flto was added in libtool about the time I was working with this (I want to say 2012 or 2013), which also means you get to run into the fun situation where it's fixed in the upstream codebase, but the repository you're working with has a checked-in stale version of it.