Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
731 views
in Technique[技术] by (71.8m points)

makefile - Building CockroachDB binary doesnt seem to work in all x86 machines

I have built cockroachDB binary using "make build" and the result for x86 appeared not to be portable to other x86 machines aside from my build machine due to an error relating to the AVX2 instruction set. Does anyone know if "make build" performs a build that is not optimized to the build machine's processor? or would using "make buildoss" solve the problem? If not, does anyone know of build flags that can be passed to prevent using "advanced" instruction sets during the build, such that the resulting binary can run on any "generic" x86 processor? Like the settings available here in gcc? https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html

question from:https://stackoverflow.com/questions/65832460/building-cockroachdb-binary-doesnt-seem-to-work-in-all-x86-machines

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The creation of non-portable builds is a side-effect of how RocksDB is built by make build (we were failing to specify PORTABLE=1). It can be avoided by building a "release" binary. The official CockroachDB release binaries are built using Docker using build/builder.sh mkrelease which is how I'd recommend a binary be built if you're using it for anything serious. This problem has been fixed on the release-20.2 branch as of https://github.com/cockroachdb/cockroach/pull/59017.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...