Sadly I can't open source the code, belongs to my employer, but the code to output an ASTC (in amongst a lot of other code nothing to do with images) is literally a wrapper around enc_astc_file() as per the example source; the application it is in happily loads other formats (JPG, PNG, BMP) through an intermediate uncompressed representation and writes them again correctly (so intermediate format and loading other images not at fault); when I substitute enc_astc_file() in our app on Windows, I get a correct ASTC out as above, and on linux the same code unchanged produces the example with bad blocks.
Let me try the -O0, that's a good plan. I admit, I am surprised - I am pretty sure you wouldn't release code behaving that differently between the two OSs, so I am suspecting something in our build environment (it's on a back end server, so maybe I am missing something obvious).
Let me investigate more. I can try upgrading too.
Al