-DBUILDGENERIC doesn't propagate to runtime libraries
Currently, we use -DBUILDGENERIC=ON
to make sure that sac2c
is not relying on the exact architecture that it is being compiled on. This is needed when creating packages, so that they work on a larger set of cpus.
However, while BUILDGENERIC does the right thing for sac2c, default sac2c flags for compiling sac programs, contain -march=native -mtune=native
. Unfortunately, these very flags are used when building runtime libraries. As a result, runtime libraries may contain illegal instructions.