I would like to port a C++ physics engine to XBox and make it available commercially as a precompiled binary for game developers.
Do I need to register as an XBox developer with Microsoft for this? Will I be compiling on Visual Studio and cross compile for XBox?
To be a middleware vendor for Xbox, you need to join the registered Xbox program.
If your code is entirely CPU-based and makes no use of GPU/DirectX then it should be possible to build a binary that's compatible across multiple side-by-side versions of the Game OS.
x64 native only
Build two binaries: One with /arch:AVX
(Xbox One) and one with /arch:AVX2
(Xbox Series X|S).
Use _WIN32_WINNT=0x0A00
and WINAPI_FAMILY=WINAPI_FAMILY_GAMES
to ensure you are only using the subset of Win32 APIs supported by the Game OS and PC.
There are additional considerations depending on if you are planning to ship a DLL or a static C++ library to function across the range of supported compilers, make use of the "OneCore" variant of the Visual C/C++ Runtime, and link with the appropriate umbrella library. Those details can be worked out through official support channels.
You should review CMakeExample and CMakeXboxConsoleApp on GitHub which will provide insight to how you build for Xbox using the private Microsoft GDK with Xbox extensions.
You can also make use of UWP on Xbox to do initial testing and validation on the Xbox CPUs as well for the quality of your port.
UPDATE: See Vcpkg now supports targeting Xbox