On Fri, 18 Feb 2022, Steffen Nurpmeso wrote:> The TinyC compiler tcc does > > #?0|kent:tcc.git$ git grep -i musl master > ... > master:configure: --config-uClibc,-musl,-mingw32... enable system specific configurations > master:configure: if test -f "/lib/ld-musl-$cpu.so.1"; then > master:configure: echo "Perhaps you want ./configure --config-musl"Ouch, completely bogus. I?ve found one reliable way to detect musl at configure time, at least for the last couple of years of their releases. Compile and link a hello-world program, then check whether the binary contains MUSL_LOCPATH as string. I?ve managed to not need to rely on that. I believe it?s obvious why I?m trying to. I *did* find something recently that would have benefit from musl detection, but it?s just avoiding a bug in old musl versions, so I?m leaving that to the packager and document it. (The testsuite also catches it so I?m now urging people even more to run it.) bye, //mirabilos -- Sometimes they [people] care too much: pretty printers [and syntax highligh- ting, d.A.] mechanically produce pretty output that accentuates irrelevant detail in the program, which is as sensible as putting all the prepositions in English text in bold font. -- Rob Pike in "Notes on Programming in C"
Thorsten Glaser wrote in <d0d930df-597a-933c-cd96-7bbcdd7e586f at tarent.de>: |On Fri, 18 Feb 2022, Steffen Nurpmeso wrote: | |> The TinyC compiler tcc does |> |> #?0|kent:tcc.git$ git grep -i musl master |> ... |> master:configure: --config-uClibc,-musl,-mingw32... enable system \ |> specific configurations |> master:configure: if test -f "/lib/ld-musl-$cpu.so.1"; then |> master:configure: echo "Perhaps you want ./configure --config-\ |> musl" | |Ouch, completely bogus. It is a nice hint imho. |I?ve found one reliable way to detect musl at configure time, |at least for the last couple of years of their releases. | |Compile and link a hello-world program, then check whether the |binary contains MUSL_LOCPATH as string. That .. does not seem to be true for native musl systems? You could grep for ld-musl or libc.musl though, *i think*. |I?ve managed to not need to rely on that. I believe it?s obvious |why I?m trying to. I *did* find something recently that would |have benefit from musl detection, but it?s just avoiding a bug |in old musl versions, so I?m leaving that to the packager and |document it. (The testsuite also catches it so I?m now urging |people even more to run it.) --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)