libhydrogen icon indicating copy to clipboard operation
libhydrogen copied to clipboard

do not explicitly pass -arch

Open autoantwort opened this issue 2 years ago • 4 comments

Explicitly passing -arch breaks the build for me for arm64-osx and x64-osx.

autoantwort avatar Jun 20 '22 23:06 autoantwort

Can this be changed to -mcpu= instead? Or better, check if -march= is supported by the compiler?

jedisct1 avatar Jun 21 '22 06:06 jedisct1

Hm I think -march is not a good idea in general, at least in the context of vcpkg when binaries are distributed to other computers:

-march: Generate instructions for the machine type cpu-type. In contrast to -mtune=cpu-type, which merely tunes the generated code for the specified cpu-type, -march=cpu-type allows GCC to generate code that may not run at all on processors other than the one indicated.

-mcpu= was replaced by -mtune. At least for vcpkg it would be better to tune for all CPUs and when a user knows that the code will only run on a specific CPU they can pass -mtune manually.

autoantwort avatar Jun 21 '22 11:06 autoantwort

libhydrogen's primary targets are embedded systems, where generating code specifically for a target is useful.

jedisct1 avatar Jun 21 '22 12:06 jedisct1

I see. Maybe we could make it an option.

autoantwort avatar Jun 21 '22 12:06 autoantwort