jedisct1 / libhydrogen

A lightweight, secure, easy-to-use crypto library suitable for constrained environments.
https://libhydrogen.org
Other
594 stars 88 forks source link

do not explicitly pass -arch #129

Closed autoantwort closed 1 year ago

autoantwort commented 2 years ago

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

jedisct1 commented 2 years ago

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

autoantwort commented 2 years ago

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.

jedisct1 commented 2 years ago

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

autoantwort commented 2 years ago

I see. Maybe we could make it an option.